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

0.0.34 • Public • Published

Installation

npm install --save @types/emissary

Summary

This package contains type definitions for emissary (https://github.com/atom/emissary).

Details

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

index.d.ts

/// <reference types="mixto" />

export as namespace Emissary;

export interface IEmitterStatic extends Mixto.IMixinStatic {
    new(): IEmitter;
}

export interface IEmitter {
    on(eventNames: string, handler: Function): any; // return value type are Signal
    once(eventName: string, handler: Function): any; // return value type are Signal
    signal(eventName: string): void;
    behavior(eventName: string, initialValue: any): void;
    emit(eventName: string, ...args: any[]): void;
    off(eventNames: string, handler: Function): void;
    pauseEvents(eventNames: string): void;
    resumeEvents(eventNames: string): void;
    incrementSubscriptionCount(eventName: string): number;
    decrementSubscriptionCount(eventName: string): number;
    getSubscriptionCount(eventName: string): number;
    hasSubscriptions(eventName: string): boolean;
}

export interface ISubscriberStatic extends Mixto.IMixinStatic {
    new(): ISubscriber;
}

export interface ISubscriber {
    subscribeWith(eventEmitter: any, methodName: string, args: any): ISubscription;

    addSubscription(subscription: any): ISubscription;

    subscribe(eventEmitterOrSubscription: any, ...args: any[]): ISubscription;

    subscribeToCommand(eventEmitter: any, ...args: any[]): ISubscription;

    unsubscribe(object?: any): any;
}

export interface ISubscriptionStatic {
    new(emitter: any, eventNames: string, handler: Function): ISubscription;
}

export interface ISubscription extends IEmitter {
    cancelled: boolean;

    off(): any;
}

export var Emitter: IEmitterStatic;
export var Subscriber: ISubscriberStatic;
export var Signal: Function; // TODO
export var Behavior: Function; // TODO
export var combine: Function; // TODO

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/mixto

Credits

These definitions were written by vvakame.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/emissary

Weekly Downloads

16

Version

0.0.34

License

MIT

Unpacked Size

6.03 kB

Total Files

5

Last publish

Collaborators

  • types