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

3.0.3 • Public • Published

Installation

npm install --save @types/dush

Summary

This package contains type definitions for dush (https://github.com/tunnckocore/dush#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dush.

index.d.ts

declare var dush: dush.DushStatic;

declare namespace dush {
    type Handler = (...event: any[]) => void;
    type WildcardHandler = (type?: string, ...event: any[]) => void;

    interface DushStatic {
        (): Emitter;
    }

    interface Emitter {
        _allEvents: Array<{ [eventName: string]: Handler[] }>;
        use: (plugin: (app: Emitter, options: any) => void, options?: any) => Emitter;
        on(type: string, handler: Handler): Emitter;
        on(type: "*", handler: WildcardHandler): Emitter;
        once(type: string, handler: Handler): Emitter;
        once(type: "*", handler: WildcardHandler): Emitter;
        off(type: string, handler?: Handler): Emitter;
        off(type: "*", handler?: WildcardHandler): Emitter;
        emit(type: string, ...event: any[]): Emitter;
    }
}

export = dush;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/dush

Weekly Downloads

55

Version

3.0.3

License

MIT

Unpacked Size

3.95 kB

Total Files

5

Last publish

Collaborators

  • types