npm.io
3.0.0 • Published 2 years ago

@types/consumable-stream

Licence
MIT
Version
3.0.0
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/consumable-stream

Summary

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

Details

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

index.d.ts

/// <reference types="node" />

declare abstract class ConsumableStream<T> implements AsyncIterator<T>, AsyncIterable<T> {
    next(timeout?: number): Promise<IteratorResult<T>>;
    once(timeout?: number): Promise<T>;
    abstract createConsumer(timeout?: number): ConsumableStream.Consumer<T>;
    [Symbol.asyncIterator](): AsyncIterator<T>;
}

export = ConsumableStream;

declare namespace ConsumableStream {
    interface Consumer<T> {
        next(): Promise<IteratorResult<T>>;
        return(): void;
    }
}

Additional Details

  • Last updated: Sat, 30 Dec 2023 0344 GMT
  • Dependencies: @types/node

Credits

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