npm.io
1.1.2 • Published 2 years ago

@types/sweet-pubsub

Licence
MIT
Version
1.1.2
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/sweet-pubsub

Summary

This package contains type definitions for sweet-pubsub (https://github.com/oldboyxx/sweet-pubsub).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sweet-pubsub.

index.d.ts

interface SweetPubsub {
    on<CBFn extends (...args: any[]) => unknown>(
        topic: string,
        unsubscribeLabel: string,
        callback: CBFn,
        priority?: number,
    ): CBFn;
    on<CBFn extends (...args: any[]) => unknown>(topic: string, callback: CBFn, priority?: number): CBFn;
    sub<CBFn extends (...args: any[]) => unknown>(
        topic: string,
        unsubscribeLabel: string,
        callback: CBFn,
        priority?: number,
    ): CBFn;
    sub<CBFn extends (...args: any[]) => unknown>(topic: string, callback: CBFn, priority?: number): CBFn;
    once<CBFn extends (...args: any[]) => unknown>(
        topic: string,
        unsubscribeLabel: string,
        callback: CBFn,
        priority?: number,
    ): CBFn;
    once<CBFn extends (...args: any[]) => unknown>(topic: string, callback: CBFn, priority?: number): CBFn;
    subOnce<CBFn extends (...args: any[]) => unknown>(
        topic: string,
        unsubscribeLabel: string,
        callback: CBFn,
        priority?: number,
    ): CBFn;
    subOnce<CBFn extends (...args: any[]) => unknown>(
        topic: string,
        callback: CBFn,
        priority?: number,
    ): CBFn;
    emit(topic: string, ...arguments: any[]): unknown;
    pub(topic: string, ...arguments: any[]): unknown;
    emits(topic: string, ...arguments: any[]): unknown;
    pubs(topic: string, ...arguments: any[]): unknown;
    off(callback: (...args: any[]) => unknown): unknown[];
    off(topicOrUnsubscribeLabel: string, callback?: (...args: any[]) => unknown): unknown[];
    off(topic: string, unsubscribeLabel: string): unknown[];
    unsub(callback: (...args: any[]) => unknown): unknown[];
    unsub(topicOrUnsubscribeLabel: string, callback?: (...args: any[]) => unknown): unknown[];
    unsub(topic: string, unsubscribeLabel: string): unknown[];
}

declare const sweetPubsub: SweetPubsub;

export = sweetPubsub;

Additional Details

  • Last updated: Tue, 07 Nov 2023 1536 GMT
  • Dependencies: none

Credits

These definitions were written by Emilio Escobar.