Skip to content

Commit

Permalink
Fix TReplacer and add TSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
lexich committed Sep 13, 2021
1 parent d3c132b commit a5709e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.d.ts
@@ -1,16 +1,17 @@
declare module '@discoveryjs/json-ext' {
import { Readable } from 'stream';

type TReplacer = (this: any, key: string, value: any) => any;
type TReplacer = null | string[] | number[] | ((this: any, key: string, value: any) => any);
type TSpace = string | number | null;

export function parseChunked(stream: Readable | (() => AsyncGenerator<any, any, any>)): Promise<any>;

export function stringifyStream(value: any, replacer?: TReplacer, space?: string | number): Readable;
export function stringifyStream(value: any, replacer?: TReplacer, space?: TSpace): Readable;

export function stringifyInfo(
value: any,
replacer?: TReplacer,
space?: string | number,
space?: TSpace,
options?: {
async?: boolean;
continueOnCircular?: boolean;
Expand Down

0 comments on commit a5709e0

Please sign in to comment.