@andrew_l/tl-pack 0.3.21 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,481 @@
1
+ import { Data } from "@andrew_l/toolkit";
2
+ declare function createDictionary(values?: string[]): Dictionary;
3
+ declare class Dictionary {
4
+ private _count;
5
+ private _wordToIndex;
6
+ private _words;
7
+ private _offset;
8
+ constructor(values?: string[], offset?: number);
9
+ clear(): void;
10
+ get size(): number;
11
+ /**
12
+ * Returns inserted index or nothing
13
+ */
14
+ maybeInsert(word: string): number | null;
15
+ getValue(index: number): string | null;
16
+ getIndex(value: string): number | null;
17
+ hasValue(value: string): boolean;
18
+ hasIndex(index: number): boolean;
19
+ }
20
+ type EncodeHandler<T = any> = (this: BinaryWriter, value: T) => void;
21
+ type DecodeHandler<T = any> = (this: BinaryReader) => T;
22
+ interface TLExtension<T = any> {
23
+ token: number;
24
+ encode: EncodeHandler<T>;
25
+ decode: DecodeHandler<T>;
26
+ }
27
+ declare function createExtension(token: number, {
28
+ encode,
29
+ decode
30
+ }: {
31
+ encode: EncodeHandler;
32
+ decode: DecodeHandler;
33
+ }): TLExtension;
34
+ interface BinaryWriterOptions {
35
+ gzip?: boolean;
36
+ dictionary?: string[] | Dictionary;
37
+ extensions?: TLExtension[];
38
+ structures?: Structure.Constructor[];
39
+ }
40
+ declare class BinaryWriter {
41
+ private withGzip;
42
+ private target;
43
+ private dictionary;
44
+ private dictionaryExtended;
45
+ private extensions;
46
+ private structures;
47
+ private _last;
48
+ private offsetChecksum;
49
+ private _repeat?;
50
+ offset: number;
51
+ constructor({
52
+ gzip,
53
+ dictionary,
54
+ extensions,
55
+ structures
56
+ }?: BinaryWriterOptions);
57
+ /**
58
+ * Reset internal state
59
+ */
60
+ reset(): this;
61
+ allocate(size: number): this;
62
+ private makeRoom;
63
+ get safeEnd(): number;
64
+ getBuffer(): Uint8Array;
65
+ writeByte(value: number): this;
66
+ writeBool(value: boolean): this;
67
+ writeNull(): this;
68
+ writeInt64(value: number | bigint, signed?: boolean): this;
69
+ writeInt32(value: number, signed?: boolean): this;
70
+ writeInt16(value: number, signed?: boolean): this;
71
+ writeInt8(value: number, signed?: boolean): this;
72
+ writeFloat(value: number): this;
73
+ writeDouble(value: number): this;
74
+ writeDate(value: number | Date): this;
75
+ writeString(value: string): this;
76
+ writeChecksum(withConstructor?: boolean): this;
77
+ writeBytes(value: Uint8Array): this;
78
+ writeLength(value: number): this;
79
+ writeVector(value: Array<any>): this;
80
+ writeMap(object: Record<string, any>): this;
81
+ wireDictionary(value: string): this;
82
+ writeStructure(value: Structure): this;
83
+ writeGzip(value: Uint8Array | ArrayBuffer): this;
84
+ encode(value: any): Uint8Array;
85
+ startDynamicVector(): this;
86
+ endDynamicVector(): this;
87
+ private _writeCustom;
88
+ writeObject(value: any): this;
89
+ writeObjectGzip(value: any): this;
90
+ private writeCore;
91
+ private writeRepeat;
92
+ }
93
+ declare enum CORE_TYPES {
94
+ None = 0,
95
+ Binary = 1,
96
+ BoolFalse = 2,
97
+ BoolTrue = 3,
98
+ Null = 4,
99
+ Date = 5,
100
+ Vector = 6,
101
+ VectorDynamic = 7,
102
+ Int64 = 22,
103
+ Int32 = 8,
104
+ Int16 = 9,
105
+ Int8 = 10,
106
+ UInt64 = 23,
107
+ UInt32 = 11,
108
+ UInt16 = 12,
109
+ UInt8 = 13,
110
+ Float = 14,
111
+ Double = 15,
112
+ Map = 16,
113
+ DictValue = 17,
114
+ DictIndex = 18,
115
+ String = 19,
116
+ Repeat = 20,
117
+ Checksum = 21,
118
+ GZIP = 25,
119
+ Structure = 26
120
+ }
121
+ declare const MAX_BUFFER_SIZE = 2144337920;
122
+ interface DefineStructureOptions<Props extends Structure.ObjectPropsOptions> {
123
+ /**
124
+ * Unique name of binary structure
125
+ */
126
+ readonly name: string;
127
+ /**
128
+ * Version of binary structure
129
+ */
130
+ readonly version: number;
131
+ /**
132
+ * Binary structure properties
133
+ */
134
+ readonly properties: Props;
135
+ /**
136
+ * Write checksum to verify decoded data
137
+ * @default false
138
+ */
139
+ readonly checksum?: boolean;
140
+ }
141
+ /**
142
+ * Create binary structure definition with type safety and performance optimization
143
+ *
144
+ * @example
145
+ * // Define a user structure
146
+ * const User = defineStructure({
147
+ * name: 'User',
148
+ * version: 1,
149
+ * checksum: true,
150
+ * properties: {
151
+ * id: { type: Number, required: true },
152
+ * name: { type: String, required: true },
153
+ * email: { type: String, required: false },
154
+ * isActive: { type: Boolean, required: true },
155
+ * createdAt: { type: Date, required: true },
156
+ * tags: { type: Array, required: false }
157
+ * }
158
+ * });
159
+ *
160
+ * // Create and serialize a user
161
+ * const user = new User({
162
+ * id: 123,
163
+ * name: 'John Doe',
164
+ * email: 'john@example.com',
165
+ * isActive: true,
166
+ * createdAt: new Date(),
167
+ * tags: ['admin', 'verified']
168
+ * });
169
+ *
170
+ * const buffer = user.toBuffer();
171
+ * const restored = User.fromBuffer(buffer);
172
+ *
173
+ * @example
174
+ * // Define nested structures
175
+ * const Address = defineStructure({
176
+ * name: 'Address',
177
+ * version: 1,
178
+ * properties: {
179
+ * street: { type: String, required: true },
180
+ * city: { type: String, required: true },
181
+ * zipCode: { type: String, required: true }
182
+ * }
183
+ * });
184
+ *
185
+ * const Person = defineStructure({
186
+ * name: 'Person',
187
+ * version: 1,
188
+ * properties: {
189
+ * name: { type: String, required: true },
190
+ * address: { type: Address, required: false }
191
+ * }
192
+ * });
193
+ *
194
+ * @example
195
+ * // Using with complex data types
196
+ * const GameState = defineStructure({
197
+ * name: 'GameState',
198
+ * version: 2,
199
+ * checksum: true,
200
+ * properties: {
201
+ * playerData: { type: Object, required: true }, // Untrusted data
202
+ * screenshot: { type: Uint8Array, required: false }, // Binary data
203
+ * timestamp: { type: Date, required: true },
204
+ * metadata: { type: Object, required: false }
205
+ * }
206
+ * });
207
+ *
208
+ * @group Main
209
+ */
210
+ declare function defineStructure<PropsOptions extends Structure.ObjectPropsOptions, T extends Data = Structure.ExtractPropTypes<PropsOptions>>({
211
+ name,
212
+ properties,
213
+ version,
214
+ checksum
215
+ }: DefineStructureOptions<PropsOptions>): Structure.Constructor<T>;
216
+ declare class Structure<T extends Data = Data> implements Structure.Structure<T> {
217
+ readonly value: T;
218
+ constructor(value: T);
219
+ toBuffer(options?: BinaryWriterOptions): Uint8Array;
220
+ static fromBuffer(buffer: Uint8Array, options?: BinaryReaderOptions): Data;
221
+ static readonly estimatedSizeBytes: number;
222
+ static readonly structures: Structure.Constructor[];
223
+ static readonly extension: TLExtension;
224
+ }
225
+ declare namespace Structure {
226
+ export interface Options<T extends Data = Data> {
227
+ readonly encode: EncodeHandler<T>;
228
+ readonly decode: DecodeHandler<T>;
229
+ }
230
+ export interface Structure<T extends Data = Data> {
231
+ /**
232
+ * The structured data value
233
+ * @type {T}
234
+ * @readonly
235
+ *
236
+ * @example
237
+ * const user = new UserStruct({ id: 1, name: 'Alice' });
238
+ * console.log(user.value.name); // 'Alice'
239
+ */
240
+ readonly value: T;
241
+ /**
242
+ * Serializes the structure to a binary buffer
243
+ *
244
+ * @param {BinaryWriterOptions} [options] - Writer configuration options
245
+ * @returns {Uint8Array} Serialized binary data
246
+ *
247
+ * @example
248
+ * const user = new User({ id: 1, name: 'Alice' });
249
+ * const buffer = user.toBuffer();
250
+ * console.log(buffer.length); // Size in bytes
251
+ *
252
+ * @example
253
+ * // With custom writer options
254
+ * const buffer = user.toBuffer({
255
+ * initialSize: 1024,
256
+ * growthFactor: 2
257
+ * });
258
+ */
259
+ toBuffer(options?: BinaryWriterOptions): Uint8Array;
260
+ }
261
+ /**
262
+ * Base Structure class for binary serialization with type safety
263
+ *
264
+ * @template T - Data type extending Data interface
265
+ *
266
+ * @example
267
+ * // Direct usage (not recommended, use defineStructure instead)
268
+ * class CustomStruct extends Structure<{id: number, name: string}> {
269
+ * // Custom implementation
270
+ * }
271
+ *
272
+ * @example
273
+ * // Typical usage through defineStructure
274
+ * const MyStruct = defineStructure({
275
+ * name: 'MyStruct',
276
+ * version: 1,
277
+ * properties: { id: { type: Number, required: true } }
278
+ * });
279
+ *
280
+ * const instance = new MyStruct({ id: 42 });
281
+ * console.log(instance.value.id); // 42
282
+ */
283
+ export interface Constructor<T extends Data = any> {
284
+ /**
285
+ * Creates a new Structure instance
286
+ *
287
+ * @param {T} value - The data to structure
288
+ *
289
+ * @example
290
+ * const data = { id: 123, name: 'Test' };
291
+ * const struct = new MyStructure(data);
292
+ */
293
+ new (value: T): Structure<T>;
294
+ /**
295
+ * Deserializes a structure from a binary buffer
296
+ *
297
+ * @param {Uint8Array} buffer - Binary data to deserialize
298
+ * @param {BinaryReaderOptions} [options] - Reader configuration options
299
+ * @returns {Data} Deserialized structure data
300
+ *
301
+ * @example
302
+ * const buffer = user.toBuffer();
303
+ * const restored = User.fromBuffer(buffer);
304
+ * console.log(restored.id); // Original user ID
305
+ */
306
+ fromBuffer(buffer: Uint8Array, options?: BinaryReaderOptions): T;
307
+ /**
308
+ * Estimated size of bytes
309
+ */
310
+ readonly estimatedSizeBytes: number;
311
+ /**
312
+ * Nested structures defining encoding/decoding behavior
313
+ */
314
+ readonly structures: Constructor[];
315
+ /**
316
+ * Structure extension defining encoding/decoding behavior
317
+ */
318
+ readonly extension: TLExtension;
319
+ }
320
+ type PropConstructor<T = any> = {
321
+ new (...args: any[]): T & {};
322
+ } | {
323
+ (): T;
324
+ } | PropMethod<T>;
325
+ type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
326
+ new (): TConstructor;
327
+ (): T;
328
+ readonly prototype: TConstructor;
329
+ } : never;
330
+ type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
331
+ type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
332
+ required: true;
333
+ } ? K : never }[keyof T];
334
+ type Prop<T> = PropOptions<T> | PropType<T>;
335
+ type CoreInt = CORE_TYPES.Int8 | CORE_TYPES.Int16 | CORE_TYPES.Int32 | CORE_TYPES.UInt8 | CORE_TYPES.UInt16 | CORE_TYPES.UInt32 | CORE_TYPES.Float | CORE_TYPES.Double;
336
+ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
337
+ type: null;
338
+ }] ? any : [T] extends [{
339
+ type: [null];
340
+ }] ? any[] : [T] extends [{
341
+ type: ObjectConstructor | CORE_TYPES.Map;
342
+ }] ? Record<string, any> : [T] extends [{
343
+ type: CoreInt;
344
+ }] ? number : [T] extends [{
345
+ type: CORE_TYPES.String;
346
+ }] ? string : [T] extends [{
347
+ type: CORE_TYPES.Vector;
348
+ }] ? unknown[] : [T] extends [{
349
+ type: CORE_TYPES.Binary;
350
+ }] ? Uint8Array : [T] extends [{
351
+ type: BooleanConstructor;
352
+ }] ? boolean : [T] extends [{
353
+ type: DateConstructor | CORE_TYPES.Date;
354
+ }] ? Date : [T] extends [{
355
+ type: CORE_TYPES.UInt64 | CORE_TYPES.Int64;
356
+ }] ? bigint : [T] extends [{
357
+ type: Constructor<infer U>;
358
+ }] ? U : [T] extends [{
359
+ type: [infer U];
360
+ }] ? U extends DateConstructor ? Date[] : U extends Constructor<infer V> ? V[] : InferPropType<U, false>[] : [T] extends [{
361
+ type: (infer U)[];
362
+ }] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V>] ? V : T;
363
+ export type ObjectPropsOptions<P = Data> = { readonly [K in keyof P]: PropOptions<P[K]> };
364
+ export interface PropOptions<T = any> {
365
+ type: PropType<T> | null | [null];
366
+ required?: boolean;
367
+ }
368
+ export type PropType<T> = PropConstructor<T> | [PropConstructor<T>] | CORE_TYPES | [CORE_TYPES];
369
+ export type ExtractType<T extends Constructor> = T extends Constructor<infer U> ? U : never;
370
+ export type ExtractPropTypes<O> = { [K in keyof Pick<O, RequiredKeys<O>>]: O[K] extends {
371
+ default: any;
372
+ } ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]> } & { [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]> | null };
373
+ export {};
374
+ }
375
+ interface BinaryReaderOptions {
376
+ dictionary?: string[] | Dictionary;
377
+ extensions?: TLExtension[];
378
+ structures?: Structure.Constructor[];
379
+ }
380
+ declare class BinaryReader {
381
+ private target;
382
+ private _last?;
383
+ private _lastObject?;
384
+ private dictionary?;
385
+ private dictionaryExtended;
386
+ private extensions;
387
+ private structures;
388
+ private _repeat?;
389
+ private _checksumOffset;
390
+ offset: number;
391
+ length: number;
392
+ /**
393
+ * Small utility class to read binary data.
394
+ */
395
+ constructor(data: Uint8Array, {
396
+ dictionary,
397
+ extensions,
398
+ structures
399
+ }?: BinaryReaderOptions);
400
+ readByte(): number;
401
+ readInt64(signed?: boolean): bigint;
402
+ readInt32(signed?: boolean): number;
403
+ readInt16(signed?: boolean): number;
404
+ readInt8(signed?: boolean): number;
405
+ /**
406
+ * Reads a real floating point (4 bytes) value.
407
+ * @returns {number}
408
+ */
409
+ readFloat(): number;
410
+ /**
411
+ * Reads a real floating point (8 bytes) value.
412
+ */
413
+ readDouble(): number;
414
+ /**
415
+ * Throws error if provided length cannot be read from buffer
416
+ * @param length {number}
417
+ */
418
+ assertRead(length: number): void;
419
+ assertConstructor(constructorId: CORE_TYPES): void;
420
+ /**
421
+ * Gets the byte array representing the current buffer as a whole.
422
+ */
423
+ getBuffer(): Uint8Array;
424
+ readNull(): null;
425
+ readLength(): number;
426
+ readAll(): any[];
427
+ readBytes(): Uint8Array;
428
+ /**
429
+ * Reads encoded string.
430
+ */
431
+ readString(): string;
432
+ /**
433
+ * Reads a boolean value.
434
+ */
435
+ readBool(): boolean;
436
+ /**
437
+ * Reads and converts Unix time
438
+ * into a Javascript {Date} object.
439
+ */
440
+ readDate(): Date;
441
+ readStructure<T extends Data = Data>(checkConstructor?: boolean): T;
442
+ /**
443
+ * Reads a object.
444
+ */
445
+ readObject(): any;
446
+ readObjectGzip(): any;
447
+ readGzip(): any;
448
+ private readCore;
449
+ getDictionaryValue(index: number): string | null;
450
+ readDictionary(): null | string;
451
+ readMap(checkConstructor?: boolean): Record<string, any>;
452
+ decode<T = any>(value: Uint8Array): T;
453
+ /**
454
+ * Reads a vector (a list) of objects.
455
+ */
456
+ readVector<T = any>(checkConstructor?: boolean): T[];
457
+ /**
458
+ * Reads a vector (a list) of objects.
459
+ */
460
+ readVectorDynamic<T>(checkConstructor?: boolean): T[];
461
+ readChecksum(checkConstructor?: boolean): void;
462
+ /**
463
+ * Tells the current position on the stream.
464
+ */
465
+ tellPosition(): number;
466
+ /**
467
+ * Sets the current position on the stream.
468
+ */
469
+ setPosition(position: number): void;
470
+ /**
471
+ * Seeks the stream position given an offset from the current position.
472
+ * The offset may be negative.
473
+ */
474
+ seek(offset: number): void;
475
+ /**
476
+ * Sets the current buffer and reset initial state.
477
+ */
478
+ reset(data?: Uint8Array): void;
479
+ }
480
+ export { BinaryReader, BinaryReaderOptions, BinaryWriter, BinaryWriterOptions, CORE_TYPES, DecodeHandler, DefineStructureOptions, EncodeHandler, MAX_BUFFER_SIZE, Structure, TLExtension, createDictionary, createExtension, defineStructure };
481
+ //# sourceMappingURL=BinaryReader.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BinaryReader.d.mts","names":["values","Dictionary","_count","_wordToIndex","_words","_offset","constructor","offset","clear","size","maybeInsert","word","getValue","index","getIndex","value","hasValue","hasIndex","T","BinaryWriter","this","value","BinaryReader","token","encode","EncodeHandler","decode","DecodeHandler","TLExtension","gzip","dictionary","Dictionary","extensions","TLExtension","structures","Structure","Constructor","withGzip","target","dictionaryExtended","_last","offsetChecksum","_repeat","offset","constructor","BinaryWriterOptions","reset","allocate","size","makeRoom","safeEnd","getBuffer","Uint8Array","writeByte","value","writeBool","writeNull","writeInt64","signed","writeInt32","writeInt16","writeInt8","writeFloat","writeDouble","writeDate","Date","writeString","writeChecksum","withConstructor","writeBytes","writeLength","writeVector","Array","writeMap","Record","object","wireDictionary","writeStructure","writeGzip","ArrayBuffer","encode","startDynamicVector","endDynamicVector","_writeCustom","writeObject","writeObjectGzip","writeCore","writeRepeat","None","Binary","BoolFalse","BoolTrue","Null","Date","Vector","VectorDynamic","Int64","Int32","Int16","Int8","UInt64","UInt32","UInt16","UInt8","Float","Double","Map","DictValue","DictIndex","String","Repeat","Checksum","GZIP","Structure","Props","Structure","ObjectPropsOptions","name","version","properties","checksum","PropsOptions","T","Data","ExtractPropTypes","DefineStructureOptions","Constructor","value","constructor","toBuffer","BinaryWriterOptions","options","Uint8Array","fromBuffer","buffer","BinaryReaderOptions","estimatedSizeBytes","structures","extension","TLExtension","Options","encode","EncodeHandler","decode","DecodeHandler","PropConstructor","args","PropMethod","TConstructor","prototype","OptionalKeys","Exclude","RequiredKeys","K","required","Prop","PropOptions","PropType","CoreInt","CORE_TYPES","Int8","Int16","Int32","UInt8","UInt16","UInt32","Float","Double","InferPropType","NullAsAny","type","ObjectConstructor","Map","Record","String","Vector","Binary","BooleanConstructor","DateConstructor","Date","UInt64","Int64","U","V","P","ExtractType","O","Pick","default","dictionary","Dictionary","extensions","TLExtension","structures","Structure","Constructor","target","_last","_lastObject","dictionaryExtended","_repeat","_checksumOffset","offset","length","constructor","Uint8Array","data","BinaryReaderOptions","readByte","readInt64","signed","readInt32","readInt16","readInt8","readFloat","readDouble","assertRead","assertConstructor","CORE_TYPES","constructorId","getBuffer","readNull","readLength","readAll","readBytes","readString","readBool","readDate","Date","readStructure","T","Data","checkConstructor","readObject","readObjectGzip","readGzip","readCore","getDictionaryValue","index","readDictionary","readMap","Record","decode","value","readVector","readVectorDynamic","readChecksum","tellPosition","setPosition","position","seek","reset"],"sources":["../../src/dictionary.d.ts","../../src/extension.d.ts","../../src/BinaryWriter.d.ts","../../src/constants.d.ts","../../src/Structure.d.ts","../../src/BinaryReader.d.ts"],"mappings":";iBAAwB,gBAAA,CAAiBA,MAAAA,cAAoB,UAAU;AAAA,cAClD,UAAA;EAAA,QACTE,MAAAA;EAAAA,QACAC,YAAAA;EAAAA,QACAC,MAAAA;EAAAA,QACAC,OAAAA;EACRC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