1 |
|
2 |
|
3 |
|
4 | export declare class ValueWrapper<T> {
|
5 | value: T;
|
6 | constructor(value: T);
|
7 | equals(obj: ValueWrapper<T>): boolean;
|
8 | }
|
9 | /**
|
10 | * @group HomeKit Data Streams (HDS)
|
11 | */
|
12 | export declare class Int8 extends ValueWrapper<number> {
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 | export declare class Int16 extends ValueWrapper<number> {
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 | export declare class Int32 extends ValueWrapper<number> {
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 | export declare class Int64 extends ValueWrapper<number> {
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | export declare class Float32 extends ValueWrapper<number> {
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 | export declare class Float64 extends ValueWrapper<number> {
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 | export declare class SecondsSince2001 extends ValueWrapper<number> {
|
43 | }
|
44 |
|
45 |
|
46 |
|
47 | export declare class UUID extends ValueWrapper<string> {
|
48 | constructor(value: string);
|
49 | }
|
50 | /**
|
51 | * @group HomeKit Data Streams (HDS)
|
52 | */
|
53 | export declare const enum DataFormatTags {
|
54 | INVALID = 0,
|
55 | TRUE = 1,
|
56 | FALSE = 2,
|
57 | TERMINATOR = 3,
|
58 | NULL = 4,
|
59 | UUID = 5,
|
60 | DATE = 6,
|
61 | INTEGER_MINUS_ONE = 7,
|
62 | INTEGER_RANGE_START_0 = 8,
|
63 | INTEGER_RANGE_STOP_39 = 46,
|
64 | INT8 = 48,
|
65 | INT16LE = 49,
|
66 | INT32LE = 50,
|
67 | INT64LE = 51,
|
68 | FLOAT32LE = 53,
|
69 | FLOAT64LE = 54,
|
70 | UTF8_LENGTH_START = 64,
|
71 | UTF8_LENGTH_STOP = 96,
|
72 | UTF8_LENGTH8 = 97,
|
73 | UTF8_LENGTH16LE = 98,
|
74 | UTF8_LENGTH32LE = 99,
|
75 | UTF8_LENGTH64LE = 100,
|
76 | UTF8_NULL_TERMINATED = 111,
|
77 | DATA_LENGTH_START = 112,
|
78 | DATA_LENGTH_STOP = 144,
|
79 | DATA_LENGTH8 = 145,
|
80 | DATA_LENGTH16LE = 146,
|
81 | DATA_LENGTH32LE = 147,
|
82 | DATA_LENGTH64LE = 148,
|
83 | DATA_TERMINATED = 159,
|
84 | COMPRESSION_START = 160,
|
85 | COMPRESSION_STOP = 207,
|
86 | ARRAY_LENGTH_START = 208,
|
87 | ARRAY_LENGTH_STOP = 222,
|
88 | ARRAY_TERMINATED = 223,
|
89 | DICTIONARY_LENGTH_START = 224,
|
90 | DICTIONARY_LENGTH_STOP = 238,
|
91 | DICTIONARY_TERMINATED = 239
|
92 | }
|
93 |
|
94 |
|
95 |
|
96 | export declare class DataStreamParser {
|
97 | static decode(buffer: DataStreamReader): any;
|
98 | static encode(data: any, buffer: DataStreamWriter): void;
|
99 | }
|
100 |
|
101 |
|
102 |
|
103 | export declare class DataStreamReader {
|
104 | private readonly data;
|
105 | readerIndex: number;
|
106 | private trackedCompressedData;
|
107 | constructor(data: Buffer);
|
108 | finished(): void;
|
109 | decompressData(index: number): any;
|
110 | private trackData;
|
111 | private ensureLength;
|
112 | readTag(): number;
|
113 | readTrue(): true;
|
114 | readFalse(): false;
|
115 | readNegOne(): -1;
|
116 | readIntRange(tag: number): number;
|
117 | readInt8(): number;
|
118 | readInt16LE(): number;
|
119 | readInt32LE(): number;
|
120 | readInt64LE(): number;
|
121 | readFloat32LE(): number;
|
122 | readFloat64LE(): number;
|
123 | private readLength8;
|
124 | private readLength16LE;
|
125 | private readLength32LE;
|
126 | private readLength64LE;
|
127 | readUTF8(length: number): string;
|
128 | readUTF8_Length8(): string;
|
129 | readUTF8_Length16LE(): string;
|
130 | readUTF8_Length32LE(): string;
|
131 | readUTF8_Length64LE(): string;
|
132 | readUTF8_NULL_terminated(): string;
|
133 | readData(length: number): Buffer;
|
134 | readData_Length8(): Buffer;
|
135 | readData_Length16LE(): Buffer;
|
136 | readData_Length32LE(): Buffer;
|
137 | readData_Length64LE(): Buffer;
|
138 | readData_terminated(): Buffer;
|
139 | readSecondsSince2001_01_01(): number;
|
140 | readUUID(): string;
|
141 | }
|
142 | /**
|
143 | * @group HomeKit Data Streams (HDS)
|
144 | */
|
145 | export declare class DataStreamWriter {
|
146 | private static readonly chunkSize;
|
147 | private data;
|
148 | private writerIndex;
|
149 | private writtenData;
|
150 | constructor();
|
151 | length(): number;
|
152 | getData(): Buffer;
|
153 | private ensureLength;
|
154 | private compressDataIfPossible;
|
155 | writeTag(tag: DataFormatTags): void;
|
156 | writeTrue(): void;
|
157 | writeFalse(): void;
|
158 | writeNumber(number: number): void;
|
159 | writeInt8(int8: Int8): void;
|
160 | writeInt16LE(int16: Int16): void;
|
161 | writeInt32LE(int32: Int32): void;
|
162 | writeInt64LE(int64: Int64): void;
|
163 | writeFloat32LE(float32: Float32): void;
|
164 | writeFloat64LE(float64: Float64): void;
|
165 | private writeLength8;
|
166 | private writeLength16LE;
|
167 | private writeLength32LE;
|
168 | private writeLength64LE;
|
169 | writeUTF8(utf8: string): void;
|
170 | private _writeUTF8;
|
171 | private writeUTF8_Length8;
|
172 | private writeUTF8_Length16LE;
|
173 | private writeUTF8_Length32LE;
|
174 | private writeUTF8_Length64LE;
|
175 | private writeUTF8_NULL_terminated;
|
176 | writeData(data: Buffer): void;
|
177 | private _writeData;
|
178 | private writeData_Length8;
|
179 | private writeData_Length16LE;
|
180 | private writeData_Length32LE;
|
181 | private writeData_Length64LE;
|
182 | private writeData_terminated;
|
183 | writeSecondsSince2001_01_01(seconds: SecondsSince2001): void;
|
184 | writeUUID(uuid_string: string): void;
|
185 | }
|
186 | //# sourceMappingURL=DataStreamParser.d.ts.map |
\ | No newline at end of file |