1.1.2 • Published 6 months ago

@types/sweet-pubsub v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for sweet-pubsub 1.1
// Project: https://github.com/oldboyxx/sweet-pubsub
// Definitions by: Emilio Escobar <https://github.com/emilioivan12>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Thu, 06 Jan 2022 14:01:23 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Emilio Escobar.