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
- Last updated: Sat, 30 Dec 2023 03:35:44 GMT
- Dependencies: @types/consumable-stream, @types/writable-consumable-stream
Credits
These definitions were written by Daniel Rose, and Nathan Bierema.