diff --git a/types/papaparse/index.d.ts b/types/papaparse/index.d.ts index d97a25010b..49dcdfdd95 100644 --- a/types/papaparse/index.d.ts +++ b/types/papaparse/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for PapaParse v4.1 +// Type definitions for PapaParse v4.5 // Project: https://github.com/mholt/PapaParse // Definitions by: Pedro Flemming // Rain Shen // João Loff // John Reilly +// Alberto Restifo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -18,6 +19,8 @@ export function parse(file: File, config?: ParseConfig): ParseResult; export function parse(stream: ReadableStream, config?: ParseConfig): ParseResult; +export function parse(stream: typeof NODE_STREAM_INPUT, config?: ParseConfig): ReadableStream; + /** * Unparses javascript data objects and returns a csv string */ @@ -45,6 +48,9 @@ export const WORKERS_SUPPORTED: boolean; // The relative path to Papa Parse. This is automatically detected when Papa Parse is loaded synchronously. export const SCRIPT_PATH: string; +// When passed to Papa Parse a Readable stream is returned. +export const NODE_STREAM_INPUT = 1; + /** * Configurable Properties */ diff --git a/types/papaparse/papaparse-tests.ts b/types/papaparse/papaparse-tests.ts index 1e527c4c32..5edcf9a251 100644 --- a/types/papaparse/papaparse-tests.ts +++ b/types/papaparse/papaparse-tests.ts @@ -36,6 +36,9 @@ Papa.parse(file, { } }); + +Papa.parse(Papa.NODE_STREAM_INPUT); + /** * Unparsing */