|
1 | 1 | declare module '@discoveryjs/json-ext' { |
2 | | - type Chunk = string | Uint8Array | Buffer; |
| 2 | + export type Chunk = string | Uint8Array | Buffer; |
3 | 3 |
|
4 | | - type Reviver = (this: any, key: string, value: any) => any; |
5 | | - type ParseChunkedState = { |
| 4 | + export type Reviver = (this: any, key: string, value: any) => any; |
| 5 | + export type ParseChunkedState = { |
6 | 6 | readonly mode: 'json' | 'jsonl'; |
7 | 7 | readonly returnValue: any; |
8 | 8 | readonly currentRootValue: any; |
9 | 9 | readonly rootValuesCount: number; |
10 | 10 | readonly consumed: number; |
11 | 11 | readonly parsed: number; |
12 | 12 | }; |
13 | | - type OnRootValue = (value: any, state: ParseChunkedState) => void; |
14 | | - type OnChunk = (chunkParsed: number, chunk: string | null, pending: string | null, state: ParseChunkedState) => void; |
15 | | - type ParseOptions = { |
| 13 | + export type OnRootValue = (value: any, state: ParseChunkedState) => void; |
| 14 | + export type OnChunk = (chunkParsed: number, chunk: string | null, pending: string | null, state: ParseChunkedState) => void; |
| 15 | + export type ParseOptions = { |
16 | 16 | reviver?: Reviver; |
17 | 17 | mode?: 'json' | 'jsonl' | 'auto'; |
18 | 18 | onRootValue?: OnRootValue; |
19 | 19 | onChunk?: OnChunk; |
20 | 20 | }; |
21 | 21 |
|
22 | | - type Replacer = |
| 22 | + export type Replacer = |
23 | 23 | | ((this: any, key: string, value: any) => any) |
24 | 24 | | (string | number)[] |
25 | 25 | | null; |
26 | | - type Space = string | number | null; |
27 | | - type StringifyOptions = { |
| 26 | + export type Space = string | number | null; |
| 27 | + export type StringifyOptions = { |
28 | 28 | replacer?: Replacer; |
29 | 29 | space?: Space; |
30 | 30 | mode?: 'json' | 'jsonl'; |
31 | 31 | highWaterMark?: number; |
32 | | - } |
33 | | - type StringifyInfoOptions = { |
| 32 | + }; |
| 33 | + export type StringifyInfoOptions = { |
34 | 34 | replacer?: Replacer; |
35 | 35 | space?: Space; |
36 | 36 | mode?: 'json' | 'jsonl'; |
37 | 37 | continueOnCircular?: boolean; |
38 | | - } |
39 | | - type StringifyInfoResult = { |
| 38 | + }; |
| 39 | + export type StringifyInfoResult = { |
40 | 40 | bytes: number; |
41 | 41 | spaceBytes: number; |
42 | 42 | circular: object[]; |
|
0 commit comments