[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:
Dimitri Benin
2017-07-24 11:06:30 -07:00
committed by Andy
parent 3e729f323d
commit c77239cbcb
+6 -5
View File
@@ -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;