1 |
|
2 |
|
3 |
|
4 | export class Decoder {
|
5 | |
6 |
|
7 |
|
8 | constructor(uint8Array: Uint8Array);
|
9 | /**
|
10 | * Decoding target.
|
11 | *
|
12 | * @type {Uint8Array}
|
13 | */
|
14 | arr: Uint8Array;
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 | pos: number;
|
21 | }
|
22 | export function createDecoder(uint8Array: Uint8Array): Decoder;
|
23 | export function hasContent(decoder: Decoder): boolean;
|
24 | export function clone(decoder: Decoder, newPos?: number | undefined): Decoder;
|
25 | export function readUint8Array(decoder: Decoder, len: number): Uint8Array;
|
26 | export function readVarUint8Array(decoder: Decoder): Uint8Array;
|
27 | export function readTailAsUint8Array(decoder: Decoder): Uint8Array;
|
28 | export function skip8(decoder: Decoder): number;
|
29 | export function readUint8(decoder: Decoder): number;
|
30 | export function readUint16(decoder: Decoder): number;
|
31 | export function readUint32(decoder: Decoder): number;
|
32 | export function readUint32BigEndian(decoder: Decoder): number;
|
33 | export function peekUint8(decoder: Decoder): number;
|
34 | export function peekUint16(decoder: Decoder): number;
|
35 | export function peekUint32(decoder: Decoder): number;
|
36 | export function readVarUint(decoder: Decoder): number;
|
37 | export function readVarInt(decoder: Decoder): number;
|
38 | export function peekVarUint(decoder: Decoder): number;
|
39 | export function peekVarInt(decoder: Decoder): number;
|
40 | export function _readVarStringPolyfill(decoder: Decoder): string;
|
41 | export function _readVarStringNative(decoder: Decoder): string;
|
42 | export function readVarString(decoder: Decoder): string;
|
43 | export function readTerminatedUint8Array(decoder: Decoder): Uint8Array;
|
44 | export function readTerminatedString(decoder: Decoder): string;
|
45 | export function peekVarString(decoder: Decoder): string;
|
46 | export function readFromDataView(decoder: Decoder, len: number): DataView;
|
47 | export function readFloat32(decoder: Decoder): number;
|
48 | export function readFloat64(decoder: Decoder): number;
|
49 | export function readBigInt64(decoder: Decoder): any;
|
50 | export function readBigUint64(decoder: Decoder): any;
|
51 | export function readAny(decoder: Decoder): any;
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | export class RleDecoder<T> extends Decoder {
|
58 | |
59 |
|
60 |
|
61 |
|
62 | constructor(uint8Array: Uint8Array, reader: (arg0: Decoder) => T);
|
63 | /**
|
64 | * The reader
|
65 | */
|
66 | reader: (arg0: Decoder) => T;
|
67 | /**
|
68 | * Current state
|
69 | * @type {T|null}
|
70 | */
|
71 | s: T | null;
|
72 | count: number;
|
73 | read(): T;
|
74 | }
|
75 | export class IntDiffDecoder extends Decoder {
|
76 | |
77 |
|
78 |
|
79 |
|
80 | constructor(uint8Array: Uint8Array, start: number);
|
81 | /**
|
82 | * Current state
|
83 | * @type {number}
|
84 | */
|
85 | s: number;
|
86 | |
87 |
|
88 |
|
89 | read(): number;
|
90 | }
|
91 | export class RleIntDiffDecoder extends Decoder {
|
92 | |
93 |
|
94 |
|
95 |
|
96 | constructor(uint8Array: Uint8Array, start: number);
|
97 | /**
|
98 | * Current state
|
99 | * @type {number}
|
100 | */
|
101 | s: number;
|
102 | count: number;
|
103 | |
104 |
|
105 |
|
106 | read(): number;
|
107 | }
|
108 | export class UintOptRleDecoder extends Decoder {
|
109 | |
110 |
|
111 |
|
112 | s: number;
|
113 | count: number;
|
114 | read(): number;
|
115 | }
|
116 | export class IncUintOptRleDecoder extends Decoder {
|
117 | |
118 |
|
119 |
|
120 | s: number;
|
121 | count: number;
|
122 | read(): number;
|
123 | }
|
124 | export class IntDiffOptRleDecoder extends Decoder {
|
125 | |
126 |
|
127 |
|
128 | s: number;
|
129 | count: number;
|
130 | diff: number;
|
131 | |
132 |
|
133 |
|
134 | read(): number;
|
135 | }
|
136 | export class StringDecoder {
|
137 | |
138 |
|
139 |
|
140 | constructor(uint8Array: Uint8Array);
|
141 | decoder: UintOptRleDecoder;
|
142 | str: string;
|
143 | /**
|
144 | * @type {number}
|
145 | */
|
146 | spos: number;
|
147 | |
148 |
|
149 |
|
150 | read(): string;
|
151 | }
|
152 |
|
\ | No newline at end of file |