UNPKG

@types/consumable-stream

Version:
37 lines (28 loc) 1.26 kB
# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/consumable-stream/index.d.ts) ````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 03:35:44 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node) # Credits These definitions were written by [Daniel Rose](https://github.com/DanielRose), and [Nathan Bierema](https://github.com/Methuselah96).