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

7.0.0 • Public • Published

Installation

npm install --save @types/async-stream-emitter

Summary

This package contains type definitions for async-stream-emitter (https://github.com/SocketCluster/async-stream-emitter).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-stream-emitter.

index.d.ts

import ConsumableStream = require("consumable-stream");
import Consumer = require("writable-consumable-stream/consumer");

declare class AsyncStreamEmitter<T> {
    emit(eventName: string, data: T): void;

    listener(eventName: string): ConsumableStream<T>;
    closeListener(eventName: string): void;
    closeAllListeners(): void;
    removeListener(eventName: string): void;

    getListenerConsumerStats(consumerId: number): Consumer.ConsumerStats;
    getListenerConsumerStatsList(eventName: string): Consumer.ConsumerStats[];
    getAllListenersConsumerStatsList(): Consumer.ConsumerStats[];

    getListenerConsumerCount(eventName: string): number;
    getAllListenersConsumerCount(): number;

    killListener(eventName: string): void;
    killAllListeners(): void;
    killListenerConsumer(consumerId: number): void;

    getListenerBackpressure(eventName: string): number;
    getAllListenersBackpressure(): number;
    getListenerConsumerBackpressure(consumerId: number): number;

    hasListenerConsumer(eventName: string, consumerId: number): boolean;
    hasAnyListenerConsumer(consumerId: number): boolean;
}

export = AsyncStreamEmitter;

Additional Details

Credits

These definitions were written by Daniel Rose, and Nathan Bierema.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/async-stream-emitter

Weekly Downloads

4,340

Version

7.0.0

License

MIT

Unpacked Size

5.43 kB

Total Files

5

Last publish

Collaborators

  • types