Typedef

DecoratedMethodEvent (utils)

@ckeditor/ckeditor5-utils/src/observablemixin

typedefobject

Utility type that creates an event describing type from decorated method.

class Foo extends ObservableMixin() {
	constructor() {
		super();
		this.decorate( 'method' );
	}

	method( a: number, b: number ): number {
		return a + b;
	}
}

type FooMethodEvent = DecoratedMethodEvent<Foo, 'method'>;

const foo = new Foo();

foo.on<FooMethodEvent>( 'method', ( evt, [ a, b ] ) => {
	// `a` and `b` are inferred as numbers.
} )

Filtering

Type parameters

Properties

  • args : tuple

  • name : TName

  • return : ReturnType<TObservable[ TName ]>