diff --git a/StronglyTypesEvents-0.2.0.ts b/StronglyTypesEvents-0.2.0.ts index d2614636..64a91c90 100644 --- a/StronglyTypesEvents-0.2.0.ts +++ b/StronglyTypesEvents-0.2.0.ts @@ -90,7 +90,6 @@ class SimpleEventDispatcher extends DispatcherBase extends DispatcherBase { + /** + * @sender The sender. + * @args The argument. + */ (sender: TSender, args: TArgs): void } @@ -18,6 +22,9 @@ interface IEventHandler { * Event handler function with a generic argument */ interface ISimpleEventHandler { + /** + * @args The argument. + */ (args: TArgs): void } @@ -26,8 +33,14 @@ interface ISimpleEventHandler { */ interface ISubscribable { + /** Subscribe to the event. + * @param fn The event handler that is called when the event is dispatched. + */ subscribe(fn: THandlerType): void; + /** Unsubscribe from the event. + * @param fn The event handler that is will be unsubsribed from the event. + */ unsubscribe(fn: THandlerType): void; } @@ -48,8 +61,16 @@ interface ISimpleEvent extends ISubscribable> */ interface IBaseEventHandling { + /** Subscribe to the event with the specified name. + * @param name The name of the event. + * @param fn The event handler that is called when the event is dispatched. + */ subscribe(name: string, fn: TEventHandler): void; - + + /** Unsubscribe from the event with the specified name. + * @param name The name of the event. + * @param fn The event handler that is will be unsubsribed from the event. + */ unsubscribe(name: string, fn: TEventHandler): void; }