DecoratedMethodEvent
typedef
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.
} )
Type parameters
-
TObservable
-
TName