mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[get-stream] fix typo and introduce more specific typings (#18314)
* [get-stream] fix typo and introduce more specific typings * [get-stream] add myself to contributors list
This commit is contained in:
Vendored
+6
-5
@@ -1,18 +1,19 @@
|
||||
// Type definitions for get-stream 3.0
|
||||
// Project: https://github.com/sindresorhus/get-stream#readme
|
||||
// Definitions by: Douglas Duteil <https://github.com/douglasduteil>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import {Stream} from 'stream';
|
||||
import { Stream } from 'stream';
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Encoding of the incoming stream.
|
||||
* @default 'utf8'
|
||||
*/
|
||||
encoding?: string;
|
||||
encoding?: BufferEncoding | 'buffer';
|
||||
/**
|
||||
* Maximum length of the returned string. If it exceeds this value before
|
||||
* the stream ends, the promise will be rejected.
|
||||
@@ -27,8 +28,8 @@ interface Options {
|
||||
* stream, indicating that there is no more data to be read.
|
||||
* The stream is switched to flowing mode.
|
||||
*/
|
||||
declare function getStrem(stream: Stream, options?: Options): Promise<string>;
|
||||
declare namespace getStrem {
|
||||
declare function getStream(stream: Stream, options?: Options): Promise<string>;
|
||||
declare namespace getStream {
|
||||
/**
|
||||
* Get the `stream` as an array of values.
|
||||
*
|
||||
@@ -58,4 +59,4 @@ declare namespace getStrem {
|
||||
function buffer(stream: Stream, options?: Options): Promise<Buffer>;
|
||||
}
|
||||
|
||||
export = getStrem;
|
||||
export = getStream;
|
||||
|
||||
Reference in New Issue
Block a user