Installation
npm install --save @types/node-observer
Summary
This package contains type definitions for node-observer (https://github.com/hormander/node-observer).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-observer.
index.d.ts
export = observer;
declare class Observer {
private subscribers: object[];
/**
* subscirpt event
* @param targetObj objects that subscribe to events
* @param eventName the event name
* @param callback callback function executed when an event is fired
*/
subscribe(targetObj: object, eventName: string, callback: any): void;
/**
* unsubscript event
* @param targetObj objects that subscribe to events
* @param eventName the event name
*/
unsubscribe(targetObj: object, eventName: string): void;
/**
* triggering event
* @param targetObj objects that subscribe to events
* @param eventName the event name
* @param data passed to the callback function when the event is fired
*/
send(targetObj: object, eventName: string, data: any): void;
}
declare let observer: Observer;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: none
Credits
These definitions were written by wjchi.