index.d.ts 900 B

12345678910111213141516171819202122232425262728293031
  1. declare module '@discoveryjs/json-ext' {
  2. import { Readable } from 'stream';
  3. type TReplacer =
  4. | ((this: any, key: string, value: any) => any)
  5. | string[]
  6. | number[]
  7. | null;
  8. type TSpace = string | number | null;
  9. type TChunk = string | Buffer | Uint8Array;
  10. export function parseChunked(input: Readable): Promise<any>;
  11. export function parseChunked(input: () => (Iterable<TChunk> | AsyncIterable<TChunk>)): Promise<any>;
  12. export function stringifyStream(value: any, replacer?: TReplacer, space?: TSpace): Readable;
  13. export function stringifyInfo(
  14. value: any,
  15. replacer?: TReplacer,
  16. space?: TSpace,
  17. options?: {
  18. async?: boolean;
  19. continueOnCircular?: boolean;
  20. }
  21. ): {
  22. minLength: number;
  23. circular: any[];
  24. duplicate: any[];
  25. async: any[];
  26. };
  27. }