7.0.0 • Published 11 months ago

@types/async-stream-emitter v7.0.0

Weekly downloads
1,418
License
MIT
Repository
github
Last release
11 months ago

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/v3.

index.d.ts

// Type definitions for async-stream-emitter 3.0
// Project: https://github.com/SocketCluster/async-stream-emitter
// Definitions by: Daniel Rose <https://github.com/DanielRose>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.7

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;

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

    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.

5.0.0

11 months ago

6.0.0

11 months ago

4.1.0

11 months ago

7.0.0

11 months ago

3.0.4

1 year ago

3.0.3

1 year ago

4.0.1

1 year ago

4.0.3

1 year ago

3.0.5

1 year ago

4.0.2

1 year ago

3.0.2

3 years ago

4.0.0

3 years ago

3.0.1

3 years ago

3.0.0

5 years ago