Skip to content

Commit

Permalink
Add: typings
Browse files Browse the repository at this point in the history
  • Loading branch information
lexich committed Sep 13, 2021
1 parent 705ff91 commit cbfd163
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions index.d.ts
@@ -0,0 +1,22 @@
declare module '@discoveryjs/json-ext' {
import { Readable } from 'stream';

export function parseChunked<T>(stream: Readable | Generator<any, void, unknown>): Promise<T>;

export function stringifyStream(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): Readable;

export function stringifyInfo(
value: any,
replacer?: ((this: any, key: string, value: any) => any) | undefined,
space?: string | number | undefined,
options?: {
async?: boolean;
continueOnCircular?: boolean;
}
): {
minLength: Number;
circular: any[];
duplicate: any[];
async: [];
}
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -19,6 +19,7 @@
"./src/stringify-stream.js": "./src/stringify-stream-browser.js",
"./src/text-decoder.js": "./src/text-decoder-browser.js"
},
"types": "./index.d.ts",
"scripts": {
"test": "mocha --reporter progress",
"lint": "eslint src test",
Expand Down

0 comments on commit cbfd163

Please sign in to comment.