@types/node-observer
TypeScript icon, indicating that this package has built-in type declarations

0.4.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-observer

Weekly Downloads

6

Version

0.4.2

License

MIT

Unpacked Size

4.29 kB

Total Files

5

Last publish

Collaborators

  • types