forked from msgpack/msgpack-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecoder.d.ts
More file actions
108 lines (108 loc) · 3.27 KB
/
Copy pathDecoder.d.ts
File metadata and controls
108 lines (108 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { ExtensionCodecType } from "./ExtensionCodec";
import { KeyDecoder } from "./CachedKeyDecoder";
import type { ContextOf } from "./context";
export type DecoderOptions<ContextType = undefined> = Readonly<Partial<{
extensionCodec: ExtensionCodecType<ContextType>;
/**
* Decodes Int64 and Uint64 as bigint if it's set to true.
* Depends on ES2020's {@link DataView#getBigInt64} and
* {@link DataView#getBigUint64}.
*
* Defaults to false.
*/
useBigInt64: boolean;
/**
* Maximum string length.
*
* Defaults to 4_294_967_295 (UINT32_MAX).
*/
maxStrLength: number;
/**
* Maximum binary length.
*
* Defaults to 4_294_967_295 (UINT32_MAX).
*/
maxBinLength: number;
/**
* Maximum array length.
*
* Defaults to 4_294_967_295 (UINT32_MAX).
*/
maxArrayLength: number;
/**
* Maximum map length.
*
* Defaults to 4_294_967_295 (UINT32_MAX).
*/
maxMapLength: number;
/**
* Maximum extension length.
*
* Defaults to 4_294_967_295 (UINT32_MAX).
*/
maxExtLength: number;
/**
* An object key decoder. Defaults to the shared instance of {@link CachedKeyDecoder}.
* `null` is a special value to disable the use of the key decoder at all.
*/
keyDecoder: KeyDecoder | null;
}>> & ContextOf<ContextType>;
export declare const DataViewIndexOutOfBoundsError: RangeErrorConstructor;
export declare class Decoder<ContextType = undefined> {
private readonly extensionCodec;
private readonly context;
private readonly useBigInt64;
private readonly maxStrLength;
private readonly maxBinLength;
private readonly maxArrayLength;
private readonly maxMapLength;
private readonly maxExtLength;
private readonly keyDecoder;
private totalPos;
private pos;
private view;
private bytes;
private headByte;
private readonly stack;
constructor(options?: DecoderOptions<ContextType>);
private reinitializeState;
private setBuffer;
private appendBuffer;
private hasRemaining;
private createExtraByteError;
/**
* @throws {@link DecodeError}
* @throws {@link RangeError}
*/
decode(buffer: ArrayLike<number> | BufferSource): unknown;
decodeMulti(buffer: ArrayLike<number> | BufferSource): Generator<unknown, void, unknown>;
decodeAsync(stream: AsyncIterable<ArrayLike<number> | BufferSource>): Promise<unknown>;
decodeArrayStream(stream: AsyncIterable<ArrayLike<number> | BufferSource>): AsyncGenerator<unknown, void, unknown>;
decodeStream(stream: AsyncIterable<ArrayLike<number> | BufferSource>): AsyncGenerator<unknown, void, unknown>;
private decodeMultiAsync;
private doDecodeSync;
private readHeadByte;
private complete;
private readArraySize;
private pushMapState;
private pushArrayState;
private decodeUtf8String;
private stateIsMapKey;
private decodeBinary;
private decodeExtension;
private lookU8;
private lookU16;
private lookU32;
private readU8;
private readI8;
private readU16;
private readI16;
private readU32;
private readI32;
private readU64;
private readI64;
private readU64AsBigInt;
private readI64AsBigInt;
private readF32;
private readF64;
}