moqtail 0.12.0 → 0.13.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.
@@ -1,2758 +0,0 @@
1
- /**
2
- * Copyright 2025 The MOQtail Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- /**
18
- * @public
19
- * Represents a key-value pair for MOQT protocol parameters.
20
- *
21
- * - If `typeValue` is **even**, the value is a varint (`bigint`).
22
- * - If `typeValue` is **odd**, the value is a binary blob (`Uint8Array`) with a maximum length of 65535 bytes.
23
- *
24
- * Use {@link KeyValuePair.tryNewVarInt} for varint pairs and {@link KeyValuePair.tryNewBytes} for blob pairs.
25
- */
26
- declare class KeyValuePair {
27
- /**
28
- * The key/type identifier for this pair.
29
- * - Even: value is a varint.
30
- * - Odd: value is a blob.
31
- */
32
- readonly typeValue: bigint;
33
- /**
34
- * The value for this pair.
35
- * - If `typeValue` is even: a varint (`bigint`).
36
- * - If `typeValue` is odd: a binary blob (`Uint8Array`).
37
- */
38
- readonly value: bigint | Uint8Array;
39
- /**
40
- * Constructs a new KeyValuePair.
41
- * @param typeValue - The key/type identifier.
42
- * @param value - The value (varint or blob).
43
- * @internal Use static factory methods instead.
44
- */
45
- private constructor();
46
- /**
47
- * Creates a new varint KeyValuePair.
48
- * @param typeValue - Must be even.
49
- * @param value - The varint value.
50
- * @returns A KeyValuePair with varint value.
51
- * @throws KeyValueFormattingError if typeValue is not even.
52
- */
53
- static tryNewVarInt(typeValue: bigint | number, value: bigint | number): KeyValuePair;
54
- /**
55
- * Creates a new blob KeyValuePair.
56
- * @param typeValue - Must be odd.
57
- * @param value - The binary blob value.
58
- * @returns A KeyValuePair with blob value.
59
- * @throws KeyValueFormattingError if typeValue is not odd.
60
- * @throws LengthExceedsMaxError if value length exceeds 65535 bytes.
61
- */
62
- static tryNewBytes(typeValue: bigint | number, value: Uint8Array): KeyValuePair;
63
- /**
64
- * Serializes this key-value pair to a frozen byte buffer.
65
- * Equivalent to {@link KeyValuePair.serializeDelta} with `prevType = 0n`.
66
- * @returns The serialized buffer.
67
- */
68
- serialize(): FrozenByteBuffer;
69
- /**
70
- * Serializes this pair's wire form, encoding the Type as a delta from
71
- * `prevType` (the type of the previous KVP in the same list, or 0n if this
72
- * is the first entry).
73
- * @param prevType - The type of the previous KVP in the same list.
74
- * @throws ProtocolViolationError if this pair's type is less than prevType
75
- * (Delta Type is an unsigned varint, so the list must be sorted ascending).
76
- */
77
- serializeDelta(prevType: bigint): FrozenByteBuffer;
78
- /**
79
- * Deserializes a KeyValuePair from a buffer.
80
- * Equivalent to {@link KeyValuePair.deserializeDelta} with `prevType = 0n`.
81
- * @param buf - The buffer to read from.
82
- * @returns The deserialized KeyValuePair.
83
- * @throws LengthExceedsMaxError if blob length exceeds 65535 bytes.
84
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
85
- */
86
- static deserialize(buf: BaseByteBuffer): KeyValuePair;
87
- /**
88
- * Deserializes a wire-form KVP whose Type field is a delta from `prevType`
89
- * (the type of the previous KVP in the same list, or 0n if this is the
90
- * first entry).
91
- * @param buf - The buffer to read from.
92
- * @param prevType - The type of the previous KVP in the same list.
93
- * @throws ProtocolViolationError if prevType + delta exceeds 2^64 - 1.
94
- */
95
- static deserializeDelta(buf: BaseByteBuffer, prevType: bigint): KeyValuePair;
96
- /**
97
- * Checks if this pair is equal to another.
98
- * @param other - The other KeyValuePair.
99
- * @returns True if both type and value are equal.
100
- */
101
- equals(other: KeyValuePair): boolean;
102
- }
103
- /**
104
- * Delta-encodes and serializes a list of Key-Value-Pairs to wire bytes.
105
- * The list is sorted by ascending type first, since Delta Type is an
106
- * unsigned varint and cannot represent a type decrease.
107
- */
108
- declare function serializeKvpList(items: KeyValuePair[]): FrozenByteBuffer;
109
- /**
110
- * Reads exactly `count` delta-encoded Key-Value-Pairs from `buf`.
111
- */
112
- declare function deserializeKvpList(buf: BaseByteBuffer, count: number | bigint): KeyValuePair[];
113
- /**
114
- * Reads delta-encoded Key-Value-Pairs from `buf` until it is exhausted.
115
- */
116
- declare function deserializeKvpListUntilEmpty(buf: BaseByteBuffer): KeyValuePair[];
117
- /**
118
- * Checks if the KeyValuePair is a varint pair (even typeValue).
119
- * @param pair - The KeyValuePair to check.
120
- * @returns True if value is a varint.
121
- */
122
- declare function isVarInt(pair: KeyValuePair): pair is KeyValuePair & {
123
- value: bigint;
124
- };
125
- /**
126
- * Checks if the KeyValuePair is a blob pair (odd typeValue).
127
- * @param pair - The KeyValuePair to check.
128
- * @returns True if value is a Uint8Array.
129
- */
130
- declare function isBytes(pair: KeyValuePair): pair is KeyValuePair & {
131
- value: Uint8Array;
132
- };
133
-
134
- /**
135
- * Copyright 2025 The MOQtail Authors
136
- *
137
- * Licensed under the Apache License, Version 2.0 (the "License");
138
- * you may not use this file except in compliance with the License.
139
- * You may obtain a copy of the License at
140
- *
141
- * http://www.apache.org/licenses/LICENSE-2.0
142
- *
143
- * Unless required by applicable law or agreed to in writing, software
144
- * distributed under the License is distributed on an "AS IS" BASIS,
145
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146
- * See the License for the specific language governing permissions and
147
- * limitations under the License.
148
- */
149
-
150
- /**
151
- * @public
152
- * Represents a position in a MOQT track, consisting of a group and object index.
153
- *
154
- * Used for specifying start/end positions in subscription and fetch requests.
155
- * - `group`: The group index (e.g. segment, GOP, or logical group).
156
- * - `object`: The object index within the group (e.g. frame, chunk).
157
- */
158
- declare class Location {
159
- /**
160
- * The group index for this location.
161
- */
162
- readonly group: bigint;
163
- /**
164
- * The object index within the group for this location.
165
- */
166
- readonly object: bigint;
167
- /**
168
- * Constructs a new Location.
169
- * @param group - The group index (number or bigint).
170
- * @param object - The object index (number or bigint).
171
- */
172
- constructor(group: bigint | number, object: bigint | number);
173
- /**
174
- * Serializes this Location to a FrozenByteBuffer.
175
- * @returns The serialized buffer.
176
- * @throws CastingError if group or object is negative.
177
- * @throws VarIntOverflowError if group or object exceeds varint encoding limits.
178
- */
179
- serialize(): FrozenByteBuffer;
180
- /**
181
- * Deserializes a Location from a buffer.
182
- * @param buf - The buffer to read from.
183
- * @returns The deserialized Location.
184
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
185
- */
186
- static deserialize(buf: BaseByteBuffer): Location;
187
- /**
188
- * Checks if this Location is equal to another.
189
- * @param other - The other Location to compare.
190
- * @returns True if both group and object are equal.
191
- */
192
- equals(other: Location): boolean;
193
- /**
194
- * Compares this Location to another for ordering.
195
- * @param other - The other Location to compare.
196
- * @returns -1 if this \< other, 1 if this \> other, 0 if equal.
197
- */
198
- compare(other: Location): number;
199
- }
200
-
201
- /**
202
- * Copyright 2025 The MOQtail Authors
203
- *
204
- * Licensed under the Apache License, Version 2.0 (the "License");
205
- * you may not use this file except in compliance with the License.
206
- * You may obtain a copy of the License at
207
- *
208
- * http://www.apache.org/licenses/LICENSE-2.0
209
- *
210
- * Unless required by applicable law or agreed to in writing, software
211
- * distributed under the License is distributed on an "AS IS" BASIS,
212
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
213
- * See the License for the specific language governing permissions and
214
- * limitations under the License.
215
- */
216
-
217
- /**
218
- * @public
219
- * Represents a single field in a Tuple, storing a value as a UTF-8 encoded byte array.
220
- *
221
- * Used for path segments or protocol fields in MOQT.
222
- */
223
- declare class TupleField {
224
- readonly value: Uint8Array;
225
- /**
226
- * The raw value of the field as a byte array.
227
- */
228
- constructor(value: Uint8Array);
229
- /**
230
- * Creates a TupleField from a UTF-8 string.
231
- * @param str - The string to encode.
232
- * @returns A new TupleField containing the encoded value.
233
- */
234
- static fromUtf8(str: string): TupleField;
235
- /**
236
- * Decodes the field value to a UTF-8 string.
237
- * @returns The decoded string.
238
- */
239
- toUtf8(): string;
240
- /**
241
- * Serializes this field to a length-prefixed byte array.
242
- * @returns The serialized bytes.
243
- */
244
- serialize(): Uint8Array;
245
- /**
246
- * Deserializes a TupleField from a buffer.
247
- * @param buf - The buffer to read from.
248
- * @returns The deserialized TupleField.
249
- * @throws CastingError if the length cannot be safely cast to number.
250
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
251
- */
252
- static deserialize(buf: BaseByteBuffer): TupleField;
253
- }
254
- /**
255
- * @public
256
- * Represents a sequence of TupleFields, typically used for hierarchical paths or protocol tuples in MOQT.
257
- */
258
- declare class Tuple {
259
- readonly fields: TupleField[];
260
- /**
261
- * The ordered list of fields in this tuple.
262
- */
263
- constructor(fields?: TupleField[]);
264
- /**
265
- * Creates a Tuple from a path string, splitting on '/'.
266
- * @param path - The path string (e.g. '/foo/bar').
267
- * @returns A Tuple with each segment as a field.
268
- */
269
- static fromUtf8Path(path: string): Tuple;
270
- /**
271
- * Converts the tuple to a path string, joining fields with '/'.
272
- * @returns The path string (e.g. '/foo/bar').
273
- */
274
- toUtf8Path(): string;
275
- /**
276
- * Adds a field to the tuple.
277
- * @param field - The TupleField to add.
278
- */
279
- add(field: TupleField): void;
280
- /**
281
- * Gets the field at the specified index.
282
- * @param index - The field index.
283
- * @returns The TupleField at the index.
284
- * @throws Error if no field exists at the index.
285
- */
286
- get(index: number): TupleField;
287
- /**
288
- * Sets the field at the specified index.
289
- * @param index - The field index.
290
- * @param field - The TupleField to set.
291
- */
292
- set(index: number, field: TupleField): void;
293
- /**
294
- * Clears all fields from the tuple.
295
- */
296
- clear(): void;
297
- /**
298
- * Serializes the tuple to a FrozenByteBuffer.
299
- * @returns The serialized buffer.
300
- */
301
- serialize(): FrozenByteBuffer;
302
- /**
303
- * Deserializes a Tuple from a buffer.
304
- * @param buf - The buffer to read from.
305
- * @returns The deserialized Tuple.
306
- * @throws CastingError if the count cannot be safely cast to number.
307
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
308
- */
309
- static deserialize(buf: BaseByteBuffer): Tuple;
310
- /**
311
- * Checks if this tuple is equal to another.
312
- * @param other - The other Tuple to compare.
313
- * @returns True if all fields are equal.
314
- */
315
- equals(other: Tuple): boolean;
316
- }
317
-
318
- /**
319
- * Copyright 2025 The MOQtail Authors
320
- *
321
- * Licensed under the Apache License, Version 2.0 (the "License");
322
- * you may not use this file except in compliance with the License.
323
- * You may obtain a copy of the License at
324
- *
325
- * http://www.apache.org/licenses/LICENSE-2.0
326
- *
327
- * Unless required by applicable law or agreed to in writing, software
328
- * distributed under the License is distributed on an "AS IS" BASIS,
329
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
330
- * See the License for the specific language governing permissions and
331
- * limitations under the License.
332
- */
333
-
334
- /**
335
- * The maximum allowed length (in bytes) for a ReasonPhrase.
336
- * @public
337
- */
338
- declare const MAX_REASON_PHRASE_LEN = 1024;
339
- /**
340
- * Represents a protocol ReasonPhrase, a short UTF-8 string used for error or status reporting.
341
- * Enforces a maximum byte length and validates encoding.
342
- *
343
- * @public
344
- */
345
- declare class ReasonPhrase {
346
- #private;
347
- /**
348
- * Constructs a ReasonPhrase, validating UTF-8 encoding and length.
349
- *
350
- * @param phrase - The string to use as the reason phrase.
351
- * @throws {@link InvalidUTF8Error} if encoding fails.
352
- * @throws {@link LengthExceedsMaxError} if the encoded phrase exceeds {@link MAX_REASON_PHRASE_LEN} bytes.
353
- * @public
354
- */
355
- constructor(phrase: string);
356
- /**
357
- * Returns the phrase string.
358
- * @public
359
- */
360
- get phrase(): string;
361
- /**
362
- * Serializes the ReasonPhrase into a {@link FrozenByteBuffer} containing:
363
- * varint(length_of_phrase_bytes) || phrase_bytes
364
- *
365
- * @returns The serialized buffer.
366
- * @public
367
- */
368
- serialize(): FrozenByteBuffer;
369
- /**
370
- * Deserializes a ReasonPhrase from the given buffer.
371
- * Reads varint(length) || utf8‑bytes.
372
- *
373
- * @param buf - The buffer to read from.
374
- * @returns The deserialized ReasonPhrase.
375
- * @throws :{@link CastingError} if the length cannot be safely cast to a number.
376
- * @throws :{@link LengthExceedsMaxError} if the length exceeds {@link MAX_REASON_PHRASE_LEN}.
377
- * @throws :{@link NotEnoughBytesError} if the buffer does not contain enough bytes.
378
- * @throws :{@link InvalidUTF8Error} if decoding fails.
379
- * @public
380
- */
381
- static deserialize(buf: BaseByteBuffer): ReasonPhrase;
382
- }
383
-
384
- /**
385
- * Copyright 2025 The MOQtail Authors
386
- *
387
- * Licensed under the Apache License, Version 2.0 (the "License");
388
- * you may not use this file except in compliance with the License.
389
- * You may obtain a copy of the License at
390
- *
391
- * http://www.apache.org/licenses/LICENSE-2.0
392
- *
393
- * Unless required by applicable law or agreed to in writing, software
394
- * distributed under the License is distributed on an "AS IS" BASIS,
395
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
396
- * See the License for the specific language governing permissions and
397
- * limitations under the License.
398
- */
399
- /**
400
- * @public
401
- * Object datagram types for MOQT objects (Draft-16).
402
- *
403
- * Type bit layout (form 0b00X0XXXX):
404
- * - Bit 0 (0x01): EXTENSIONS - Extensions field present
405
- * - Bit 1 (0x02): END_OF_GROUP - Last object in group
406
- * - Bit 2 (0x04): ZERO_OBJECT_ID - Object ID omitted (assumed 0)
407
- * - Bit 3 (0x08): DEFAULT_PRIORITY - Publisher Priority omitted (inherited)
408
- * - Bit 5 (0x20): STATUS - Object Status replaces Object Payload
409
- *
410
- * Invalid combinations:
411
- * - STATUS (0x20) + END_OF_GROUP (0x02) together is a PROTOCOL_VIOLATION
412
- * - Types outside the form 0b00X0XXXX are invalid
413
- */
414
- declare enum ObjectDatagramType {
415
- Type0x00 = 0,
416
- Type0x01 = 1,
417
- Type0x02 = 2,
418
- Type0x03 = 3,
419
- Type0x04 = 4,
420
- Type0x05 = 5,
421
- Type0x06 = 6,
422
- Type0x07 = 7,
423
- Type0x08 = 8,
424
- Type0x09 = 9,
425
- Type0x0A = 10,
426
- Type0x0B = 11,
427
- Type0x0C = 12,
428
- Type0x0D = 13,
429
- Type0x0E = 14,
430
- Type0x0F = 15,
431
- Type0x20 = 32,
432
- Type0x21 = 33,
433
- Type0x24 = 36,
434
- Type0x25 = 37,
435
- Type0x28 = 40,
436
- Type0x29 = 41,
437
- Type0x2C = 44,
438
- Type0x2D = 45
439
- }
440
- /**
441
- * @public
442
- * Namespace for ObjectDatagramType utilities.
443
- */
444
- declare namespace ObjectDatagramType {
445
- /**
446
- * Converts a number or bigint to ObjectDatagramType.
447
- * Validates using bitmask: must match form 0b00X0XXXX,
448
- * and STATUS + END_OF_GROUP cannot both be set.
449
- * @param value - The value to convert.
450
- * @returns The corresponding ObjectDatagramType.
451
- * @throws Error if the value is not valid.
452
- */
453
- function tryFrom(value: number | bigint): ObjectDatagramType;
454
- /**
455
- * Returns true if the type has extensions (bit 0 set).
456
- * @param t - The ObjectDatagramType.
457
- */
458
- function hasExtensions(t: ObjectDatagramType): boolean;
459
- /**
460
- * Returns true if the type indicates End of Group (bit 1 set).
461
- * @param t - The ObjectDatagramType.
462
- */
463
- function isEndOfGroup(t: ObjectDatagramType): boolean;
464
- /**
465
- * Returns true if Object ID is absent (bit 2 set).
466
- * When true, Object ID is omitted and assumed to be 0.
467
- * @param t - The ObjectDatagramType.
468
- */
469
- function isZeroObjectId(t: ObjectDatagramType): boolean;
470
- /**
471
- * Returns true if Publisher Priority is omitted (bit 3 set).
472
- * When true, the priority is inherited from the control message.
473
- * @param t - The ObjectDatagramType.
474
- */
475
- function hasDefaultPriority(t: ObjectDatagramType): boolean;
476
- /**
477
- * Returns true if the datagram carries Object Status instead of payload (bit 5 set).
478
- * @param t - The ObjectDatagramType.
479
- */
480
- function isStatus(t: ObjectDatagramType): boolean;
481
- /**
482
- * Determines the appropriate type for given properties.
483
- * @param hasExtensions - Whether extensions are present.
484
- * @param endOfGroup - Whether this is the last object in the group.
485
- * @param objectIdIsZero - Whether the objectId is 0.
486
- * @param defaultPriority - Whether publisher priority is inherited (omitted).
487
- * @param isStatus - Whether the datagram carries status instead of payload.
488
- * @throws Error if STATUS and END_OF_GROUP are both true (PROTOCOL_VIOLATION).
489
- */
490
- function fromProperties(hasExtensions: boolean, endOfGroup: boolean, objectIdIsZero: boolean, defaultPriority: boolean, isStatus: boolean): ObjectDatagramType;
491
- }
492
- /**
493
- * @public
494
- * Fetch header types for MOQT fetch requests.
495
- */
496
- declare enum FetchHeaderType {
497
- Type0x05 = 5
498
- }
499
- /**
500
- * Namespace for FetchHeaderType utilities.
501
- */
502
- declare namespace FetchHeaderType {
503
- /**
504
- * Converts a number or bigint to FetchHeaderType.
505
- * @param value - The value to convert.
506
- * @returns The corresponding FetchHeaderType.
507
- * @throws Error if the value is not valid.
508
- */
509
- function tryFrom(value: number | bigint): FetchHeaderType;
510
- }
511
- /**
512
- * @public
513
- * Subgroup header types for MOQT subgroups.
514
- *
515
- * Type bit layout (0b00X1XXXX):
516
- * - Bit 0 (0x01): EXTENSIONS - Extensions present in all objects
517
- * - Bits 1-2 (0x06): SUBGROUP_ID_MODE - How subgroup ID is encoded (0b00=zero, 0b01=firstObjId, 0b10=explicit, 0b11=invalid)
518
- * - Bit 3 (0x08): END_OF_GROUP - This subgroup contains the final object in the group
519
- * - Bit 4 (0x10): Always set (distinguishes subgroup from other header types)
520
- * - Bit 5 (0x20): DEFAULT_PRIORITY - Publisher priority field omitted, inherited from subscription
521
- *
522
- * Valid ranges: 0x10-0x15, 0x18-0x1D (bit 5=0), 0x30-0x35, 0x38-0x3D (bit 5=1)
523
- * Invalid: 0x16, 0x17, 0x1E, 0x1F, 0x36, 0x37, 0x3E, 0x3F (SUBGROUP_ID_MODE=0b11)
524
- */
525
- declare enum SubgroupHeaderType {
526
- Type0x10 = 16,
527
- Type0x11 = 17,
528
- Type0x12 = 18,
529
- Type0x13 = 19,
530
- Type0x14 = 20,
531
- Type0x15 = 21,
532
- Type0x18 = 24,
533
- Type0x19 = 25,
534
- Type0x1A = 26,
535
- Type0x1B = 27,
536
- Type0x1C = 28,
537
- Type0x1D = 29,
538
- Type0x30 = 48,
539
- Type0x31 = 49,
540
- Type0x32 = 50,
541
- Type0x33 = 51,
542
- Type0x34 = 52,
543
- Type0x35 = 53,
544
- Type0x38 = 56,
545
- Type0x39 = 57,
546
- Type0x3A = 58,
547
- Type0x3B = 59,
548
- Type0x3C = 60,
549
- Type0x3D = 61
550
- }
551
- /**
552
- * Namespace for SubgroupHeaderType utilities and bit constants.
553
- */
554
- declare namespace SubgroupHeaderType {
555
- /** Extensions present in all objects (bit 0) */
556
- const EXTENSIONS = 1;
557
- /** Mask for SUBGROUP_ID_MODE (bits 1-2) */
558
- const SUBGROUP_ID_MODE_MASK = 6;
559
- /** This subgroup contains the final object in the group (bit 3) */
560
- const END_OF_GROUP = 8;
561
- /** Required bit that must always be set (bit 4) */
562
- const REQUIRED_BIT = 16;
563
- /** Publisher priority field omitted, inherited from subscription (bit 5) */
564
- const DEFAULT_PRIORITY = 32;
565
- function hasExtensions(t: SubgroupHeaderType): boolean;
566
- function hasExplicitSubgroupId(t: SubgroupHeaderType): boolean;
567
- function isSubgroupIdZero(t: SubgroupHeaderType): boolean;
568
- function isSubgroupIdFirstObjectId(t: SubgroupHeaderType): boolean;
569
- function containsEndOfGroup(t: SubgroupHeaderType): boolean;
570
- function hasDefaultPriority(t: SubgroupHeaderType): boolean;
571
- /**
572
- * Converts a number or bigint to SubgroupHeaderType.
573
- * Validates bit 4 must be set, SUBGROUP_ID_MODE must not be 0b11.
574
- */
575
- function tryFrom(value: number | bigint): SubgroupHeaderType;
576
- /**
577
- * Determines the appropriate type for given properties.
578
- * @param subgroupIdMode - SUBGROUP_ID_MODE (0=zero, 1=firstObjId, 2=explicit).
579
- */
580
- function fromProperties(hasExtensions: boolean, subgroupIdMode: 0 | 1 | 2, containsEndOfGroup: boolean, hasDefaultPriority?: boolean): SubgroupHeaderType;
581
- }
582
- /**
583
- * @public
584
- * Publisher's preferred object delivery mechanism for a track.
585
- * - `Subgroup`: Use ordered subgroups (reliable).
586
- * - `Datagram`: Use unreliable datagrams when feasible.
587
- *
588
- * The preference is advisory: the relay/transport layer MAY override based on negotiated capabilities.
589
- */
590
- declare enum ObjectForwardingPreference {
591
- Subgroup = "Subgroup",
592
- Datagram = "Datagram"
593
- }
594
- /**
595
- * Namespace for ObjectForwardingPreference utilities.
596
- */
597
- declare namespace ObjectForwardingPreference {
598
- /**
599
- * Converts a number, bigint, or string to ObjectForwardingPreference.
600
- * @param value - The value to convert.
601
- * @returns The corresponding ObjectForwardingPreference.
602
- * @throws Error if the value is not valid.
603
- */
604
- function tryFrom(value: number | bigint | string): ObjectForwardingPreference;
605
- }
606
- /**
607
- * @public
608
- * Object status codes for MOQT objects.
609
- * - `Normal`: Object exists and is available.
610
- * - `EndOfGroup`: End of group marker.
611
- * - `EndOfTrack`: End of track marker.
612
- */
613
- declare enum ObjectStatus {
614
- Normal = 0,
615
- EndOfGroup = 3,
616
- EndOfTrack = 4
617
- }
618
- /**
619
- * Namespace for ObjectStatus utilities.
620
- */
621
- declare namespace ObjectStatus {
622
- /**
623
- * Converts a number or bigint to ObjectStatus.
624
- * @param value - The value to convert.
625
- * @returns The corresponding ObjectStatus.
626
- * @throws Error if the value is not valid.
627
- */
628
- function tryFrom(value: number | bigint): ObjectStatus;
629
- }
630
-
631
- /**
632
- * Copyright 2026 The MOQtail Authors
633
- *
634
- * Licensed under the Apache License, Version 2.0 (the "License");
635
- * you may not use this file except in compliance with the License.
636
- * You may obtain a copy of the License at
637
- *
638
- * http://www.apache.org/licenses/LICENSE-2.0
639
- *
640
- * Unless required by applicable law or agreed to in writing, software
641
- * distributed under the License is distributed on an "AS IS" BASIS,
642
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
643
- * See the License for the specific language governing permissions and
644
- * limitations under the License.
645
- */
646
-
647
- /**
648
- * Represents a unified OBJECT_DATAGRAM message (Draft-16).
649
- *
650
- * Type bit layout (form 0b00X0XXXX):
651
- * - Bit 0 (0x01): EXTENSIONS
652
- * - Bit 1 (0x02): END_OF_GROUP
653
- * - Bit 2 (0x04): ZERO_OBJECT_ID
654
- * - Bit 3 (0x08): DEFAULT_PRIORITY
655
- * - Bit 5 (0x20): STATUS
656
- */
657
- declare class Datagram {
658
- readonly type: ObjectDatagramType;
659
- readonly publisherPriority: number | null;
660
- readonly extensionHeaders: KeyValuePair[] | null;
661
- readonly payload: Uint8Array | null;
662
- readonly objectStatus: ObjectStatus | null;
663
- readonly endOfGroup: boolean;
664
- readonly trackAlias: bigint;
665
- readonly location: Location;
666
- private constructor();
667
- get groupId(): bigint;
668
- get objectId(): bigint;
669
- /**
670
- * Create a new Datagram with payload content.
671
- * The type is automatically determined based on the properties.
672
- */
673
- static newPayload(trackAlias: bigint, groupId: bigint, objectId: bigint, publisherPriority: number | null, extensionHeaders: KeyValuePair[] | null, payload: Uint8Array, endOfGroup?: boolean): Datagram;
674
- /**
675
- * Create a new Datagram with Object Status (no payload).
676
- * endOfGroup is always false since STATUS + END_OF_GROUP is invalid.
677
- */
678
- static newStatus(trackAlias: bigint, groupId: bigint, objectId: bigint, publisherPriority: number | null, extensionHeaders: KeyValuePair[] | null, objectStatus: ObjectStatus): Datagram;
679
- serialize(): FrozenByteBuffer;
680
- static deserialize(buf: BaseByteBuffer): Datagram;
681
- }
682
-
683
- /**
684
- * Copyright 2025 The MOQtail Authors
685
- *
686
- * Licensed under the Apache License, Version 2.0 (the "License");
687
- * you may not use this file except in compliance with the License.
688
- * You may obtain a copy of the License at
689
- *
690
- * http://www.apache.org/licenses/LICENSE-2.0
691
- *
692
- * Unless required by applicable law or agreed to in writing, software
693
- * distributed under the License is distributed on an "AS IS" BASIS,
694
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
695
- * See the License for the specific language governing permissions and
696
- * limitations under the License.
697
- */
698
-
699
- declare class FetchHeader {
700
- readonly type: FetchHeaderType;
701
- readonly requestId: bigint;
702
- constructor(type: FetchHeaderType, requestId: bigint | number);
703
- serialize(): FrozenByteBuffer;
704
- static deserialize(buf: BaseByteBuffer): FetchHeader;
705
- }
706
-
707
- /**
708
- * Copyright 2025 The MOQtail Authors
709
- *
710
- * Licensed under the Apache License, Version 2.0 (the "License");
711
- * you may not use this file except in compliance with the License.
712
- * You may obtain a copy of the License at
713
- *
714
- * http://www.apache.org/licenses/LICENSE-2.0
715
- *
716
- * Unless required by applicable law or agreed to in writing, software
717
- * distributed under the License is distributed on an "AS IS" BASIS,
718
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
719
- * See the License for the specific language governing permissions and
720
- * limitations under the License.
721
- */
722
-
723
- /**
724
- * Prior-object state threaded across successive Fetch Objects on the same stream.
725
- */
726
- type FetchObjectContext = {
727
- groupId: bigint;
728
- subgroupId: bigint;
729
- objectId: bigint;
730
- publisherPriority: number;
731
- };
732
- /**
733
- * Kind discriminator for End-of-Range markers (§10.4.4.2).
734
- */
735
- declare enum EndOfRangeKind {
736
- NonExistent = 140,
737
- Unknown = 268
738
- }
739
- /**
740
- * Payload-bearing fetch object (§10.4.4, non-End-of-Range form).
741
- *
742
- * Draft-16 FETCH objects carry no Object Status field; a zero-length payload
743
- * signals a zero-length Normal object.
744
- */
745
- declare class FetchObject {
746
- readonly kind: 'object' | 'end_of_range';
747
- readonly publisherPriority: number;
748
- readonly forwardingPreference: ObjectForwardingPreference;
749
- readonly extensionHeaders: KeyValuePair[] | null;
750
- readonly payload: Uint8Array | null;
751
- readonly endOfRange: EndOfRangeKind | null;
752
- readonly location: Location;
753
- readonly subgroupId: bigint;
754
- private constructor();
755
- get groupId(): bigint;
756
- get objectId(): bigint;
757
- /**
758
- * Context to thread into the next call on this stream.
759
- * Returns null for EndOfRange markers — they MUST NOT update prior state.
760
- */
761
- toContext(): FetchObjectContext | null;
762
- static newObject(groupId: bigint | number, subgroupId: bigint | number, objectId: bigint | number, publisherPriority: number, forwardingPreference: ObjectForwardingPreference, extensionHeaders: KeyValuePair[] | null, payload: Uint8Array): FetchObject;
763
- static newEndOfRange(kind: EndOfRangeKind, groupId: bigint | number, objectId: bigint | number): FetchObject;
764
- serialize(prev?: FetchObjectContext): FrozenByteBuffer;
765
- static deserialize(buf: BaseByteBuffer, prev?: FetchObjectContext): FetchObject;
766
- }
767
-
768
- /**
769
- * Copyright 2025 The MOQtail Authors
770
- *
771
- * Licensed under the Apache License, Version 2.0 (the "License");
772
- * you may not use this file except in compliance with the License.
773
- * You may obtain a copy of the License at
774
- *
775
- * http://www.apache.org/licenses/LICENSE-2.0
776
- *
777
- * Unless required by applicable law or agreed to in writing, software
778
- * distributed under the License is distributed on an "AS IS" BASIS,
779
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
780
- * See the License for the specific language governing permissions and
781
- * limitations under the License.
782
- */
783
-
784
- declare const MAX_NAMESPACE_TUPLE_COUNT = 32;
785
- declare const MAX_FULL_TRACK_NAME_LENGTH = 4096;
786
- /**
787
- * Fully-qualified track identifier = hierarchical namespace (tuple) + leaf name bytes.
788
- *
789
- * Constraints enforced (throws {@link TrackNameError}):
790
- * - Namespace tuple field count: 1 .. {@link MAX_NAMESPACE_TUPLE_COUNT} (must not be empty).
791
- * - Total serialized length (namespace tuple + raw name bytes) less than or equals {@link MAX_FULL_TRACK_NAME_LENGTH} bytes.
792
- *
793
- * Namespace input may be:
794
- * - `string` path with segments separated by `/` (converted via {@link Tuple.fromUtf8Path}). Empty segments are preserved
795
- * except leading/trailing slashes are treated as empty fields and will be rejected by the length check if result is 0.
796
- * - Existing {@link Tuple} instance.
797
- *
798
- * Name input may be:
799
- * - UTF-8 string (encoded)
800
- * - Raw `Uint8Array` (used directly)
801
- *
802
- * Instances are created via {@link FullTrackName.tryNew} (validates) or {@link FullTrackName.deserialize}.
803
- * Use {@link FullTrackName.serialize} for wire encoding and {@link FullTrackName.toString} for a human friendly
804
- * diagnostic format: `namespace/segments:hexname` (name rendered as lowercase hex, no 0x prefix).
805
- *
806
- * The string form is intended for logs/debug only; do not parse it for protocol operations.
807
- */
808
- declare class FullTrackName {
809
- readonly namespace: Tuple;
810
- readonly name: Uint8Array;
811
- private constructor();
812
- /**
813
- * Human-readable representation: `\<namespace path joined by '/'\>:\<name as lowercase hex\>`.
814
- * If the underlying {@link Tuple} exposes `toUtf8Path`, it's used; otherwise the raw fields are joined.
815
- * This is lossy only in the sense that name bytes are hex encoded; round-tripping requires serialization.
816
- */
817
- toString(): string;
818
- /**
819
- * Construct a validated full track name.
820
- *
821
- * Validation steps:
822
- * 1. Convert namespace string -\> {@link Tuple} (split on '/') if needed.
823
- * 2. Reject if namespace tuple field count is 0 or \> {@link MAX_NAMESPACE_TUPLE_COUNT}.
824
- * 3. Encode name string to UTF-8 if needed.
825
- * 4. Reject if total serialized length (namespace tuple + name bytes) \> {@link MAX_FULL_TRACK_NAME_LENGTH}.
826
- *
827
- * @throws :{@link TrackNameError} on any constraint violation.
828
- * @example
829
- * ```ts
830
- * const full = FullTrackName.tryNew('media/video', 'keyframe')
831
- * console.log(full.toString()) // media/video:6b65796672616d65
832
- * ```
833
- */
834
- static tryNew(namespace: string | Tuple, name: string | Uint8Array): FullTrackName;
835
- /**
836
- * Serialize to a frozen buffer: tuple (namespace) followed by length‑prefixed name bytes.
837
- * Consumers needing raw bytes should call `.toUint8Array()` on the returned {@link FrozenByteBuffer}.
838
- */
839
- serialize(): FrozenByteBuffer;
840
- /**
841
- * Parse a serialized full track name. Performs the same validations as {@link FullTrackName.tryNew}.
842
- * The provided buffer's read cursor advances accordingly.
843
- * @throws :{@link TrackNameError} if constraints are violated.
844
- */
845
- static deserialize(buf: BaseByteBuffer): FullTrackName;
846
- }
847
-
848
- /**
849
- * Copyright 2025 The MOQtail Authors
850
- *
851
- * Licensed under the Apache License, Version 2.0 (the "License");
852
- * you may not use this file except in compliance with the License.
853
- * You may obtain a copy of the License at
854
- *
855
- * http://www.apache.org/licenses/LICENSE-2.0
856
- *
857
- * Unless required by applicable law or agreed to in writing, software
858
- * distributed under the License is distributed on an "AS IS" BASIS,
859
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
860
- * See the License for the specific language governing permissions and
861
- * limitations under the License.
862
- */
863
-
864
- declare class SubgroupObject {
865
- readonly extensionHeaders: KeyValuePair[] | null;
866
- readonly objectStatus: ObjectStatus | null;
867
- readonly payload: Uint8Array | null;
868
- readonly objectId: bigint;
869
- private constructor();
870
- static newWithStatus(objectId: bigint | number, extensionHeaders: KeyValuePair[] | null, objectStatus: ObjectStatus): SubgroupObject;
871
- static newWithPayload(objectId: bigint | number, extensionHeaders: KeyValuePair[] | null, payload: Uint8Array): SubgroupObject;
872
- serialize(previousObjectId: bigint | undefined): FrozenByteBuffer;
873
- static deserialize(buf: BaseByteBuffer, hasExtensions: boolean, previousObjectId: bigint | undefined): SubgroupObject;
874
- }
875
-
876
- /**
877
- * Copyright 2025 The MOQtail Authors
878
- *
879
- * Licensed under the Apache License, Version 2.0 (the "License");
880
- * you may not use this file except in compliance with the License.
881
- * You may obtain a copy of the License at
882
- *
883
- * http://www.apache.org/licenses/LICENSE-2.0
884
- *
885
- * Unless required by applicable law or agreed to in writing, software
886
- * distributed under the License is distributed on an "AS IS" BASIS,
887
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
888
- * See the License for the specific language governing permissions and
889
- * limitations under the License.
890
- */
891
-
892
- declare class MoqtObject {
893
- readonly fullTrackName: FullTrackName;
894
- readonly publisherPriority: number;
895
- readonly objectForwardingPreference: ObjectForwardingPreference;
896
- readonly objectStatus: ObjectStatus;
897
- readonly extensionHeaders: KeyValuePair[] | null;
898
- readonly payload: Uint8Array | null;
899
- readonly location: Location;
900
- readonly subgroupId: bigint | null;
901
- private constructor();
902
- get groupId(): bigint;
903
- get objectId(): bigint;
904
- getSubgroupHeaderType(containsEnd: boolean, useDefaultPriority?: boolean): SubgroupHeaderType;
905
- isDatagram(): boolean;
906
- isSubgroup(): boolean;
907
- isEndOfGroup(): boolean;
908
- isEndOfTrack(): boolean;
909
- hasPayload(): boolean;
910
- hasStatus(): boolean;
911
- static newWithPayload(fullTrackName: FullTrackName, location: Location, publisherPriority: number, objectForwardingPreference: ObjectForwardingPreference, subgroupId: bigint | number | null, extensionHeaders: KeyValuePair[] | null, payload: Uint8Array): MoqtObject;
912
- static newWithStatus(fullTrackName: FullTrackName, location: Location, publisherPriority: number, objectForwardingPreference: ObjectForwardingPreference, subgroupId: bigint | number | null, extensionHeaders: KeyValuePair[] | null, objectStatus: ObjectStatus): MoqtObject;
913
- /**
914
- * Create a MoqtObject from a Datagram (Draft-16).
915
- * @param datagram - The received Datagram.
916
- * @param fullTrackName - The resolved full track name.
917
- * @param defaultPriority - The default publisher priority from the control message (used when DEFAULT_PRIORITY bit is set).
918
- */
919
- static fromDatagram(datagram: Datagram, fullTrackName: FullTrackName, defaultPriority?: number): MoqtObject;
920
- /**
921
- * Returns the endOfGroup flag from the source Datagram.
922
- * This is separate from ObjectStatus.EndOfGroup - the flag indicates
923
- * this is the last object in the group even with Normal status.
924
- */
925
- static isDatagramEndOfGroup(datagram: Datagram): boolean;
926
- static fromFetchObject(fetchObject: FetchObject, fullTrackName: FullTrackName): MoqtObject;
927
- static fromSubgroupObject(subgroupObject: SubgroupObject, groupId: bigint | number, publisherPriority: number | undefined, subgroupId: bigint | number | null, fullTrackName: FullTrackName): MoqtObject;
928
- /**
929
- * Convert to Datagram for wire transmission (Draft-16).
930
- * Automatically creates a payload or status Datagram based on the object's state.
931
- * @param trackAlias - The track alias to use.
932
- * @param endOfGroup - Whether this is the last object in the group (only for payload datagrams).
933
- * @param defaultPriority - If provided and matches this object's priority, the DEFAULT_PRIORITY bit is set.
934
- */
935
- tryIntoDatagram(trackAlias: bigint | number, endOfGroup?: boolean, defaultPriority?: number): Datagram;
936
- tryIntoFetchObject(): FetchObject;
937
- tryIntoSubgroupObject(): SubgroupObject;
938
- }
939
-
940
- /**
941
- * Copyright 2025 The MOQtail Authors
942
- *
943
- * Licensed under the Apache License, Version 2.0 (the "License");
944
- * you may not use this file except in compliance with the License.
945
- * You may obtain a copy of the License at
946
- *
947
- * http://www.apache.org/licenses/LICENSE-2.0
948
- *
949
- * Unless required by applicable law or agreed to in writing, software
950
- * distributed under the License is distributed on an "AS IS" BASIS,
951
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
952
- * See the License for the specific language governing permissions and
953
- * limitations under the License.
954
- */
955
-
956
- declare class SubgroupHeader {
957
- readonly type: SubgroupHeaderType;
958
- readonly publisherPriority: number | undefined;
959
- readonly subgroupId: bigint | undefined;
960
- readonly trackAlias: bigint;
961
- readonly groupId: bigint;
962
- constructor(type: SubgroupHeaderType, trackAlias: bigint | number, groupId: bigint | number, subgroupId: bigint | number | undefined, publisherPriority: number | undefined);
963
- serialize(): FrozenByteBuffer;
964
- static deserialize(buf: BaseByteBuffer): SubgroupHeader;
965
- }
966
-
967
- /**
968
- * Copyright 2025 The MOQtail Authors
969
- *
970
- * Licensed under the Apache License, Version 2.0 (the "License");
971
- * you may not use this file except in compliance with the License.
972
- * You may obtain a copy of the License at
973
- *
974
- * http://www.apache.org/licenses/LICENSE-2.0
975
- *
976
- * Unless required by applicable law or agreed to in writing, software
977
- * distributed under the License is distributed on an "AS IS" BASIS,
978
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
979
- * See the License for the specific language governing permissions and
980
- * limitations under the License.
981
- */
982
-
983
- /**
984
- * A bidirectional map between requestId (bigint) and full track names.
985
- * Used to efficiently look up either by requestId or by name, enforcing uniqueness.
986
- *
987
- * @public
988
- */
989
- declare class RequestIdMap {
990
- private requestIdToName;
991
- private nameToRequestId;
992
- /**
993
- * @public
994
- * Adds a mapping between a requestId and a full track name.
995
- *
996
- * @param requestId - The requestId to associate.
997
- * @param name - The full track name to associate.
998
- * @throws :{@link RequestIdError} if the requestId or name is already mapped to a different value.
999
- */
1000
- addMapping(requestId: bigint, name: FullTrackName): void;
1001
- /**
1002
- * @public
1003
- * Gets the full track name for a given requestId.
1004
- *
1005
- * @param requestId - The requestId to look up.
1006
- * @returns The associated full track name.
1007
- * @throws :{@link RequestIdError} if the requestId does not exist.
1008
- */
1009
- getNameByRequestId(requestId: bigint): FullTrackName;
1010
- /**
1011
- * @public
1012
- * Gets the requestId for a given full track name.
1013
- *
1014
- * @param name - The full track name to look up.
1015
- * @returns The associated requestId.
1016
- * @throws :{@link RequestIdError} if the name does not exist.
1017
- */
1018
- getRequestIdByName(name: FullTrackName): bigint;
1019
- /**
1020
- * @public
1021
- * Removes a mapping by requestId.
1022
- *
1023
- * @param requestId - The requestId to remove.
1024
- * @returns The removed full track name, or undefined if not found.
1025
- */
1026
- removeMappingByRequestId(requestId: bigint): FullTrackName | undefined;
1027
- /**
1028
- * @public
1029
- * Removes a mapping by full track name.
1030
- *
1031
- * @param name - The full track name to remove.
1032
- * @returns The removed requestId, or undefined if not found.
1033
- */
1034
- removeMappingByName(name: FullTrackName): bigint | undefined;
1035
- /**
1036
- * @public
1037
- * Checks if the map contains a given requestId.
1038
- *
1039
- * @param requestId - The requestId to check.
1040
- * @returns True if the requestId exists, false otherwise.
1041
- */
1042
- containsRequestId(requestId: bigint): boolean;
1043
- /**
1044
- * @public
1045
- * Checks if the map contains a given full track name.
1046
- *
1047
- * @param name - The full track name to check.
1048
- * @returns True if the name exists, false otherwise.
1049
- */
1050
- containsName(name: FullTrackName): boolean;
1051
- }
1052
-
1053
- /**
1054
- * Copyright 2025 The MOQtail Authors
1055
- *
1056
- * Licensed under the Apache License, Version 2.0 (the "License");
1057
- * you may not use this file except in compliance with the License.
1058
- * You may obtain a copy of the License at
1059
- *
1060
- * http://www.apache.org/licenses/LICENSE-2.0
1061
- *
1062
- * Unless required by applicable law or agreed to in writing, software
1063
- * distributed under the License is distributed on an "AS IS" BASIS,
1064
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1065
- * See the License for the specific language governing permissions and
1066
- * limitations under the License.
1067
- */
1068
-
1069
- type Header = FetchHeader | SubgroupHeader;
1070
- declare namespace Header {
1071
- function newFetch(...args: ConstructorParameters<typeof FetchHeader>): Header;
1072
- function newSubgroup(...args: ConstructorParameters<typeof SubgroupHeader>): Header;
1073
- function isFetch(header: Header): header is FetchHeader;
1074
- function isSubgroup(header: Header): header is SubgroupHeader;
1075
- function serialize(header: Header): FrozenByteBuffer;
1076
- function deserialize(buf: BaseByteBuffer): Header;
1077
- }
1078
-
1079
- /**
1080
- * Copyright 2025 The MOQtail Authors
1081
- *
1082
- * Licensed under the Apache License, Version 2.0 (the "License");
1083
- * you may not use this file except in compliance with the License.
1084
- * You may obtain a copy of the License at
1085
- *
1086
- * http://www.apache.org/licenses/LICENSE-2.0
1087
- *
1088
- * Unless required by applicable law or agreed to in writing, software
1089
- * distributed under the License is distributed on an "AS IS" BASIS,
1090
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1091
- * See the License for the specific language governing permissions and
1092
- * limitations under the License.
1093
- */
1094
-
1095
- declare abstract class BaseByteBuffer {
1096
- protected buf: Uint8Array;
1097
- protected view: DataView;
1098
- protected _offset: number;
1099
- protected _checkpoint: number;
1100
- constructor(buf: Uint8Array);
1101
- get offset(): number;
1102
- abstract get length(): number;
1103
- get remaining(): number;
1104
- /**
1105
- * Save current read position for potential rollback
1106
- */
1107
- checkpoint(): void;
1108
- /**
1109
- * Restore read position to last checkpoint
1110
- */
1111
- restore(): void;
1112
- toUint8Array(): Uint8Array;
1113
- getU8(): number;
1114
- getU16(): number;
1115
- getVI(): bigint;
1116
- getNumberVI(): number;
1117
- getBytes(len: number): Uint8Array;
1118
- getLengthPrefixedBytes(): Uint8Array;
1119
- getKeyValuePair(): KeyValuePair;
1120
- getReasonPhrase(): ReasonPhrase;
1121
- getLocation(): Location;
1122
- getTuple(): Tuple;
1123
- getFullTrackName(): FullTrackName;
1124
- }
1125
- declare class ByteBuffer extends BaseByteBuffer {
1126
- private _length;
1127
- constructor(initialSize?: number);
1128
- get length(): number;
1129
- /**
1130
- * Clear all data and reset all positions
1131
- */
1132
- clear(): void;
1133
- /**
1134
- * Drop all data before current offset and reset positions
1135
- * This is the key method for memory management - removes processed data
1136
- */
1137
- commit(): void;
1138
- private ensureCapacity;
1139
- putU8(v: number): void;
1140
- putU16(v: number): void;
1141
- /**
1142
- * Write a variable-length integer (QUIC-style varint)
1143
- * Encoding:
1144
- * - 2 MSB = 00: 1 byte (6 bits) for values 0-63
1145
- * - 2 MSB = 01: 2 bytes (14 bits) for values 0-16383
1146
- * - 2 MSB = 10: 4 bytes (30 bits) for values 0-1073741823
1147
- * - 2 MSB = 11: 8 bytes (62 bits) for values 0-4611686018427387903
1148
- */
1149
- putVI(v: bigint | number): void;
1150
- putBytes(src: Uint8Array): void;
1151
- putLengthPrefixedBytes(src: Uint8Array): void;
1152
- putKeyValuePair(pair: KeyValuePair): void;
1153
- putReasonPhrase(reason: ReasonPhrase): void;
1154
- toUint8Array(): Uint8Array;
1155
- freeze(): FrozenByteBuffer;
1156
- putLocation(loc: Location): void;
1157
- putTuple(tuple: Tuple): void;
1158
- putFullTrackName(fullTrackName: FullTrackName): void;
1159
- }
1160
- declare class FrozenByteBuffer extends BaseByteBuffer {
1161
- constructor(buf: Uint8Array);
1162
- get length(): number;
1163
- }
1164
-
1165
- /**
1166
- * Copyright 2025 The MOQtail Authors
1167
- *
1168
- * Licensed under the Apache License, Version 2.0 (the "License");
1169
- * you may not use this file except in compliance with the License.
1170
- * You may obtain a copy of the License at
1171
- *
1172
- * http://www.apache.org/licenses/LICENSE-2.0
1173
- *
1174
- * Unless required by applicable law or agreed to in writing, software
1175
- * distributed under the License is distributed on an "AS IS" BASIS,
1176
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1177
- * See the License for the specific language governing permissions and
1178
- * limitations under the License.
1179
- */
1180
- /**
1181
- * Protocol string array exchanged in wt-available-protocols header
1182
- */
1183
- declare const SUPPORTED_VERSIONS: string[];
1184
- /**
1185
- * @public
1186
- * Control message types for MOQT protocol.
1187
- * Each value corresponds to a specific control frame.
1188
- */
1189
- declare enum ControlMessageType {
1190
- ReservedSetupV00 = 1,
1191
- ReservedClientSetupV10 = 64,
1192
- ReservedServerSetupV10 = 65,
1193
- ClientSetup = 32,
1194
- ServerSetup = 33,
1195
- GoAway = 16,
1196
- MaxRequestId = 21,
1197
- RequestsBlocked = 26,
1198
- Subscribe = 3,
1199
- SubscribeOk = 4,
1200
- RequestError = 5,
1201
- Unsubscribe = 10,
1202
- RequestUpdate = 2,
1203
- PublishDone = 11,
1204
- Fetch = 22,
1205
- FetchOk = 24,
1206
- FetchCancel = 23,
1207
- TrackStatus = 13,
1208
- PublishNamespace = 6,
1209
- RequestOk = 7,
1210
- Namespace = 8,
1211
- PublishNamespaceDone = 9,
1212
- NamespaceDone = 14,
1213
- PublishNamespaceCancel = 12,
1214
- SubscribeNamespace = 17,
1215
- UnsubscribeNamespace = 20,
1216
- Publish = 29,
1217
- PublishOk = 30,
1218
- Switch = 34
1219
- }
1220
- /**
1221
- * Converts a bigint value to a ControlMessageType enum.
1222
- * @param v - The bigint value.
1223
- * @returns The corresponding ControlMessageType.
1224
- * @throws Error if the value is not a valid control message type.
1225
- */
1226
- declare function controlMessageTypeFromBigInt(v: bigint): ControlMessageType;
1227
- /**
1228
- * @public
1229
- * Error codes for PublishNamespace control messages.
1230
- */
1231
- /**
1232
- * @public
1233
- * Subscribe options for SUBSCRIBE_NAMESPACE requests.
1234
- */
1235
- declare enum NamespaceSubscribeOptions {
1236
- PublishOnly = 0,
1237
- NamespaceOnly = 1,
1238
- Both = 2
1239
- }
1240
- /**
1241
- * @public
1242
- * Filter types for subscription requests.
1243
- */
1244
- declare enum FilterType {
1245
- NextGroupStart = 1,
1246
- LatestObject = 2,
1247
- AbsoluteStart = 3,
1248
- AbsoluteRange = 4
1249
- }
1250
- /**
1251
- * Converts a bigint value to a FilterType enum.
1252
- * @param v - The bigint value.
1253
- * @returns The corresponding FilterType.
1254
- * @throws Error if the value is not a valid filter type.
1255
- */
1256
- declare function filterTypeFromBigInt(v: bigint): FilterType;
1257
- /**
1258
- * @public
1259
- * Fetch request types for MOQT protocol.
1260
- */
1261
- declare enum FetchType {
1262
- Standalone = 1,
1263
- Relative = 2,
1264
- Absolute = 3
1265
- }
1266
- /**
1267
- * Converts a bigint value to a FetchType enum.
1268
- * @param v - The bigint value.
1269
- * @returns The corresponding FetchType.
1270
- * @throws CastingError if the value is not a valid fetch type.
1271
- */
1272
- declare function fetchTypeFromBigInt(v: bigint): FetchType;
1273
- /**
1274
- * @public
1275
- * Group ordering options for object delivery.
1276
- */
1277
- declare enum GroupOrder {
1278
- Original = 0,
1279
- Ascending = 1,
1280
- Descending = 2
1281
- }
1282
- /**
1283
- * Converts a number value to a GroupOrder enum.
1284
- * @param v - The number value.
1285
- * @returns The corresponding GroupOrder.
1286
- * @throws CastingError if the value is not a valid group order.
1287
- */
1288
- declare function groupOrderFromNumber(v: number): GroupOrder;
1289
- /**
1290
- * @public
1291
- * Status codes for track status responses.
1292
- */
1293
- declare enum TrackStatusCode {
1294
- InProgress = 0,
1295
- DoesNotExist = 1,
1296
- NotYetBegun = 2,
1297
- Finished = 3,
1298
- RelayUnavailable = 4
1299
- }
1300
- /**
1301
- * Converts a bigint value to a TrackStatusCode enum.
1302
- * @param v - The bigint value.
1303
- * @returns The corresponding TrackStatusCode.
1304
- * @throws Error if the value is not a valid track status code.
1305
- */
1306
- declare function trackStatusCodeFromBigInt(v: bigint): TrackStatusCode;
1307
- /**
1308
- * @public
1309
- * Status codes for PublishDone control messages.
1310
- */
1311
- declare enum PublishDoneStatusCode {
1312
- InternalError = 0,
1313
- Unauthorized = 1,
1314
- TrackEnded = 2,
1315
- SubscriptionEnded = 3,
1316
- GoingAway = 4,
1317
- Expired = 5,
1318
- TooFarBehind = 6,
1319
- UpdateFailed = 8,
1320
- MalformedTrack = 18
1321
- }
1322
- /**
1323
- * Converts a bigint value to a PublishDoneStatusCode enum.
1324
- * @param v - The bigint value.
1325
- * @returns The corresponding PublishDoneStatusCode.
1326
- * @throws Error if the value is not a valid subscribe done status code.
1327
- */
1328
- declare function publishDoneStatusCodeFromBigInt(v: bigint): PublishDoneStatusCode;
1329
- /**
1330
- * @public
1331
- * Unified error codes for REQUEST_ERROR control messages.
1332
- */
1333
- declare enum RequestErrorCode {
1334
- InternalError = 0,
1335
- Unauthorized = 1,
1336
- Timeout = 2,
1337
- NotSupported = 3,
1338
- MalformedAuthToken = 4,
1339
- ExpiredAuthToken = 5,
1340
- DoesNotExist = 16,
1341
- InvalidRange = 17,
1342
- MalformedTrack = 18,
1343
- DuplicateSubscription = 25,
1344
- Uninterested = 32,
1345
- PrefixOverlap = 48,
1346
- InvalidJoiningRequestId = 50
1347
- }
1348
- /**
1349
- * Converts a bigint value to a RequestErrorCode enum.
1350
- * @param v - The bigint value.
1351
- * @returns The corresponding RequestErrorCode.
1352
- * @throws CastingError if the value is not a valid request error code.
1353
- */
1354
- declare function requestErrorCodeFromBigInt(v: bigint): RequestErrorCode;
1355
-
1356
- /**
1357
- * Copyright 2026 The MOQtail Authors
1358
- *
1359
- * Licensed under the Apache License, Version 2.0 (the "License");
1360
- * you may not use this file except in compliance with the License.
1361
- * You may obtain a copy of the License at
1362
- *
1363
- * http://www.apache.org/licenses/LICENSE-2.0
1364
- *
1365
- * Unless required by applicable law or agreed to in writing, software
1366
- * distributed under the License is distributed on an "AS IS" BASIS,
1367
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1368
- * See the License for the specific language governing permissions and
1369
- * limitations under the License.
1370
- */
1371
- declare enum SetupParameterType {
1372
- Path = 1,
1373
- MaxRequestId = 2,
1374
- AuthorizationToken = 3,
1375
- MaxAuthTokenCacheSize = 4
1376
- }
1377
- declare function setupParameterTypeFromNumber(value: number): SetupParameterType;
1378
- declare enum MessageParameterType {
1379
- DeliveryTimeout = 2,
1380
- AuthorizationToken = 3,
1381
- Expires = 8,
1382
- LargestObject = 9,
1383
- Forward = 16,
1384
- SubscriberPriority = 32,
1385
- SubscriptionFilter = 33,
1386
- GroupOrder = 34,
1387
- NewGroupRequest = 50
1388
- }
1389
- declare function messageParameterTypeFromNumber(value: bigint | number): MessageParameterType;
1390
- declare enum TokenAliasType {
1391
- Delete = 0,
1392
- Register = 1,
1393
- UseAlias = 2,
1394
- UseValue = 3
1395
- }
1396
- declare function tokenAliasTypeFromNumber(value: number): TokenAliasType;
1397
-
1398
- /**
1399
- * Copyright 2025 The MOQtail Authors
1400
- *
1401
- * Licensed under the Apache License, Version 2.0 (the "License");
1402
- * you may not use this file except in compliance with the License.
1403
- * You may obtain a copy of the License at
1404
- *
1405
- * http://www.apache.org/licenses/LICENSE-2.0
1406
- *
1407
- * Unless required by applicable law or agreed to in writing, software
1408
- * distributed under the License is distributed on an "AS IS" BASIS,
1409
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1410
- * See the License for the specific language governing permissions and
1411
- * limitations under the License.
1412
- */
1413
-
1414
- interface Parameter {
1415
- toKeyValuePair(): KeyValuePair;
1416
- }
1417
-
1418
- /**
1419
- * Copyright 2026 The MOQtail Authors
1420
- *
1421
- * Licensed under the Apache License, Version 2.0 (the "License");
1422
- * you may not use this file except in compliance with the License.
1423
- * You may obtain a copy of the License at
1424
- *
1425
- * http://www.apache.org/licenses/LICENSE-2.0
1426
- *
1427
- * Unless required by applicable law or agreed to in writing, software
1428
- * distributed under the License is distributed on an "AS IS" BASIS,
1429
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1430
- * See the License for the specific language governing permissions and
1431
- * limitations under the License.
1432
- */
1433
-
1434
- type AuthTokenVariant = {
1435
- aliasType: TokenAliasType.Delete;
1436
- tokenAlias: bigint;
1437
- } | {
1438
- aliasType: TokenAliasType.Register;
1439
- tokenAlias: bigint;
1440
- tokenType: bigint;
1441
- tokenValue: Uint8Array;
1442
- } | {
1443
- aliasType: TokenAliasType.UseAlias;
1444
- tokenAlias: bigint;
1445
- } | {
1446
- aliasType: TokenAliasType.UseValue;
1447
- tokenType: bigint;
1448
- tokenValue: Uint8Array;
1449
- };
1450
- declare class AuthorizationToken implements Parameter {
1451
- readonly variant: AuthTokenVariant;
1452
- static readonly TYPE = MessageParameterType.AuthorizationToken;
1453
- private constructor();
1454
- static newDelete(tokenAlias: bigint | number): AuthorizationToken;
1455
- static newRegister(tokenAlias: bigint | number, tokenType: bigint | number, tokenValue: Uint8Array): AuthorizationToken;
1456
- static newUseAlias(tokenAlias: bigint | number): AuthorizationToken;
1457
- static newUseValue(tokenType: bigint | number, tokenValue: Uint8Array): AuthorizationToken;
1458
- toKeyValuePair(): KeyValuePair;
1459
- static fromKeyValuePair(pair: KeyValuePair): AuthorizationToken | undefined;
1460
- }
1461
-
1462
- /**
1463
- * Copyright 2026 The MOQtail Authors
1464
- *
1465
- * Licensed under the Apache License, Version 2.0 (the "License");
1466
- * you may not use this file except in compliance with the License.
1467
- * You may obtain a copy of the License at
1468
- *
1469
- * http://www.apache.org/licenses/LICENSE-2.0
1470
- *
1471
- * Unless required by applicable law or agreed to in writing, software
1472
- * distributed under the License is distributed on an "AS IS" BASIS,
1473
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1474
- * See the License for the specific language governing permissions and
1475
- * limitations under the License.
1476
- */
1477
-
1478
- /**
1479
- * Duration in milliseconds the relay SHOULD continue to attempt forwarding Objects.
1480
- * Value MUST be greater than 0; a value of 0 is a PROTOCOL_VIOLATION.
1481
- * This parameter is subscription-specific and SHOULD NOT be forwarded upstream
1482
- * by a relay serving multiple subscriptions for the same track.
1483
- */
1484
- declare class DeliveryTimeout implements Parameter {
1485
- readonly timeout: bigint;
1486
- static readonly TYPE = MessageParameterType.DeliveryTimeout;
1487
- constructor(timeout: bigint);
1488
- toKeyValuePair(): KeyValuePair;
1489
- static fromKeyValuePair(pair: KeyValuePair): DeliveryTimeout | undefined;
1490
- }
1491
-
1492
- /**
1493
- * Copyright 2026 The MOQtail Authors
1494
- *
1495
- * Licensed under the Apache License, Version 2.0 (the "License");
1496
- * you may not use this file except in compliance with the License.
1497
- * You may obtain a copy of the License at
1498
- *
1499
- * http://www.apache.org/licenses/LICENSE-2.0
1500
- *
1501
- * Unless required by applicable law or agreed to in writing, software
1502
- * distributed under the License is distributed on an "AS IS" BASIS,
1503
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1504
- * See the License for the specific language governing permissions and
1505
- * limitations under the License.
1506
- */
1507
-
1508
- /**
1509
- * Time in milliseconds after which the sender will terminate the subscription.
1510
- * A value of 0 means the subscription does not expire or expires at an unknown time.
1511
- * The receiver can extend the subscription by sending a REQUEST_UPDATE.
1512
- */
1513
- declare class Expires implements Parameter {
1514
- readonly expires: bigint;
1515
- static readonly TYPE = MessageParameterType.Expires;
1516
- constructor(expires: bigint);
1517
- toKeyValuePair(): KeyValuePair;
1518
- static fromKeyValuePair(pair: KeyValuePair): Expires | undefined;
1519
- }
1520
-
1521
- /**
1522
- * Copyright 2026 The MOQtail Authors
1523
- *
1524
- * Licensed under the Apache License, Version 2.0 (the "License");
1525
- * you may not use this file except in compliance with the License.
1526
- * You may obtain a copy of the License at
1527
- *
1528
- * http://www.apache.org/licenses/LICENSE-2.0
1529
- *
1530
- * Unless required by applicable law or agreed to in writing, software
1531
- * distributed under the License is distributed on an "AS IS" BASIS,
1532
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1533
- * See the License for the specific language governing permissions and
1534
- * limitations under the License.
1535
- */
1536
-
1537
- /**
1538
- * Forwarding state for affected subscriptions.
1539
- * Allowed wire values: 0 (don't forward) or 1 (forward).
1540
- * Any other value is a PROTOCOL_VIOLATION.
1541
- * Default (when omitted) is 1 (forward).
1542
- */
1543
- declare class Forward implements Parameter {
1544
- readonly forward: boolean;
1545
- static readonly TYPE = MessageParameterType.Forward;
1546
- constructor(forward: boolean);
1547
- toKeyValuePair(): KeyValuePair;
1548
- static fromKeyValuePair(pair: KeyValuePair): Forward | undefined;
1549
- }
1550
-
1551
- /**
1552
- * Copyright 2026 The MOQtail Authors
1553
- *
1554
- * Licensed under the Apache License, Version 2.0 (the "License");
1555
- * you may not use this file except in compliance with the License.
1556
- * You may obtain a copy of the License at
1557
- *
1558
- * http://www.apache.org/licenses/LICENSE-2.0
1559
- *
1560
- * Unless required by applicable law or agreed to in writing, software
1561
- * distributed under the License is distributed on an "AS IS" BASIS,
1562
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1563
- * See the License for the specific language governing permissions and
1564
- * limitations under the License.
1565
- */
1566
-
1567
- /**
1568
- * How to prioritize Objects from different groups (Ascending=0x1 or Descending=0x2).
1569
- * Values outside this range are a PROTOCOL_VIOLATION (Original/0x0 is not a valid wire value).
1570
- * If omitted from SUBSCRIBE, the publisher's track preference is used.
1571
- * If omitted from FETCH, Ascending (0x1) is used.
1572
- */
1573
- declare class GroupOrderParam implements Parameter {
1574
- readonly order: GroupOrder.Ascending | GroupOrder.Descending;
1575
- static readonly TYPE = MessageParameterType.GroupOrder;
1576
- constructor(order: GroupOrder.Ascending | GroupOrder.Descending);
1577
- toKeyValuePair(): KeyValuePair;
1578
- static fromKeyValuePair(pair: KeyValuePair): GroupOrderParam | undefined;
1579
- }
1580
-
1581
- /**
1582
- * Copyright 2026 The MOQtail Authors
1583
- *
1584
- * Licensed under the Apache License, Version 2.0 (the "License");
1585
- * you may not use this file except in compliance with the License.
1586
- * You may obtain a copy of the License at
1587
- *
1588
- * http://www.apache.org/licenses/LICENSE-2.0
1589
- *
1590
- * Unless required by applicable law or agreed to in writing, software
1591
- * distributed under the License is distributed on an "AS IS" BASIS,
1592
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1593
- * See the License for the specific language governing permissions and
1594
- * limitations under the License.
1595
- */
1596
-
1597
- /**
1598
- * The largest Location in the Track observed by the sending endpoint.
1599
- * If omitted from a message, the sending endpoint has not published or
1600
- * received any Objects in the Track.
1601
- */
1602
- declare class LargestObject implements Parameter {
1603
- readonly location: Location;
1604
- static readonly TYPE = MessageParameterType.LargestObject;
1605
- constructor(location: Location);
1606
- toKeyValuePair(): KeyValuePair;
1607
- static fromKeyValuePair(pair: KeyValuePair): LargestObject | undefined;
1608
- }
1609
-
1610
- /**
1611
- * Copyright 2026 The MOQtail Authors
1612
- *
1613
- * Licensed under the Apache License, Version 2.0 (the "License");
1614
- * you may not use this file except in compliance with the License.
1615
- * You may obtain a copy of the License at
1616
- *
1617
- * http://www.apache.org/licenses/LICENSE-2.0
1618
- *
1619
- * Unless required by applicable law or agreed to in writing, software
1620
- * distributed under the License is distributed on an "AS IS" BASIS,
1621
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1622
- * See the License for the specific language governing permissions and
1623
- * limitations under the License.
1624
- */
1625
-
1626
- /**
1627
- * The largest Group ID in the Track known by the subscriber, plus 1.
1628
- * A value of 0 indicates the subscriber has no Group information for the Track.
1629
- * Only valid for tracks with the DYNAMIC_GROUPS extension (value 1).
1630
- */
1631
- declare class NewGroupRequest implements Parameter {
1632
- readonly group: bigint;
1633
- static readonly TYPE = MessageParameterType.NewGroupRequest;
1634
- constructor(group: bigint);
1635
- toKeyValuePair(): KeyValuePair;
1636
- static fromKeyValuePair(pair: KeyValuePair): NewGroupRequest | undefined;
1637
- }
1638
-
1639
- /**
1640
- * Copyright 2026 The MOQtail Authors
1641
- *
1642
- * Licensed under the Apache License, Version 2.0 (the "License");
1643
- * you may not use this file except in compliance with the License.
1644
- * You may obtain a copy of the License at
1645
- *
1646
- * http://www.apache.org/licenses/LICENSE-2.0
1647
- *
1648
- * Unless required by applicable law or agreed to in writing, software
1649
- * distributed under the License is distributed on an "AS IS" BASIS,
1650
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1651
- * See the License for the specific language governing permissions and
1652
- * limitations under the License.
1653
- */
1654
-
1655
- /**
1656
- * Priority of a subscription relative to others in the same session.
1657
- * Lower numbers have higher priority. Range: 0-255.
1658
- * Values outside this range are a PROTOCOL_VIOLATION.
1659
- * Default (when omitted from SUBSCRIBE, PUBLISH_OK, or FETCH) is 128.
1660
- */
1661
- declare class SubscriberPriority implements Parameter {
1662
- readonly priority: number;
1663
- static readonly TYPE = MessageParameterType.SubscriberPriority;
1664
- constructor(priority: number);
1665
- toKeyValuePair(): KeyValuePair;
1666
- static fromKeyValuePair(pair: KeyValuePair): SubscriberPriority | undefined;
1667
- }
1668
-
1669
- /**
1670
- * Copyright 2026 The MOQtail Authors
1671
- *
1672
- * Licensed under the Apache License, Version 2.0 (the "License");
1673
- * you may not use this file except in compliance with the License.
1674
- * You may obtain a copy of the License at
1675
- *
1676
- * http://www.apache.org/licenses/LICENSE-2.0
1677
- *
1678
- * Unless required by applicable law or agreed to in writing, software
1679
- * distributed under the License is distributed on an "AS IS" BASIS,
1680
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1681
- * See the License for the specific language governing permissions and
1682
- * limitations under the License.
1683
- */
1684
-
1685
- /**
1686
- * Length-prefixed Subscription Filter specifying what objects the subscriber wants.
1687
- * If omitted from SUBSCRIBE or PUBLISH_OK, the subscription is unfiltered (LatestObject).
1688
- * If omitted from REQUEST_UPDATE, the value is unchanged.
1689
- */
1690
- declare class SubscriptionFilter implements Parameter {
1691
- readonly filterType: FilterType;
1692
- readonly startLocation?: Location | undefined;
1693
- readonly endGroup?: bigint | undefined;
1694
- static readonly TYPE = MessageParameterType.SubscriptionFilter;
1695
- constructor(filterType: FilterType, startLocation?: Location | undefined, endGroup?: bigint | undefined);
1696
- toKeyValuePair(): KeyValuePair;
1697
- static fromKeyValuePair(pair: KeyValuePair): SubscriptionFilter | undefined;
1698
- }
1699
-
1700
- /**
1701
- * Copyright 2026 The MOQtail Authors
1702
- *
1703
- * Licensed under the Apache License, Version 2.0 (the "License");
1704
- * you may not use this file except in compliance with the License.
1705
- * You may obtain a copy of the License at
1706
- *
1707
- * http://www.apache.org/licenses/LICENSE-2.0
1708
- *
1709
- * Unless required by applicable law or agreed to in writing, software
1710
- * distributed under the License is distributed on an "AS IS" BASIS,
1711
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1712
- * See the License for the specific language governing permissions and
1713
- * limitations under the License.
1714
- */
1715
-
1716
- type MessageParameter = DeliveryTimeout | AuthorizationToken | Expires | LargestObject | Forward | SubscriberPriority | GroupOrderParam | SubscriptionFilter | NewGroupRequest;
1717
- declare namespace MessageParameter {
1718
- /**
1719
- * Parses a single KeyValuePair into a MessageParameter.
1720
- * Returns undefined for unrecognized parameter types (be forgiving).
1721
- * Still throws ProtocolViolationError for known types with invalid values.
1722
- */
1723
- function fromKeyValuePair(pair: KeyValuePair): MessageParameter | undefined;
1724
- function toKeyValuePair(param: MessageParameter): KeyValuePair;
1725
- function isDeliveryTimeout(param: MessageParameter): param is DeliveryTimeout;
1726
- function isAuthorizationToken(param: MessageParameter): param is AuthorizationToken;
1727
- function isExpires(param: MessageParameter): param is Expires;
1728
- function isLargestObject(param: MessageParameter): param is LargestObject;
1729
- function isForward(param: MessageParameter): param is Forward;
1730
- function isSubscriberPriority(param: MessageParameter): param is SubscriberPriority;
1731
- function isGroupOrderParam(param: MessageParameter): param is GroupOrderParam;
1732
- function isSubscriptionFilter(param: MessageParameter): param is SubscriptionFilter;
1733
- function isNewGroupRequest(param: MessageParameter): param is NewGroupRequest;
1734
- }
1735
- /**
1736
- * Builder for constructing a list of MessageParameters.
1737
- * Mirrors the SetupParameters builder pattern.
1738
- */
1739
- declare class MessageParameters {
1740
- private params;
1741
- add(param: MessageParameter): this;
1742
- addDeliveryTimeout(timeout: bigint | number): this;
1743
- addAuthorizationToken(token: AuthorizationToken): this;
1744
- addExpires(expires: bigint | number): this;
1745
- addForward(forward: boolean): this;
1746
- addSubscriberPriority(priority: number): this;
1747
- addGroupOrder(order: GroupOrderParam['order']): this;
1748
- addSubscriptionFilter(filter: SubscriptionFilter): this;
1749
- addNewGroupRequest(group: bigint | number): this;
1750
- build(): MessageParameter[];
1751
- /**
1752
- * Parses an array of KeyValuePairs into a list of MessageParameters.
1753
- * Unrecognized parameter types are silently skipped.
1754
- * Known parameter types with invalid values still throw ProtocolViolationError.
1755
- */
1756
- static fromKeyValuePairs(pairs: KeyValuePair[]): MessageParameter[];
1757
- }
1758
- /**
1759
- * Applies a set of parameter updates to an existing parameter list.
1760
- * For each update, replaces the matching parameter (by wire type value) or appends it.
1761
- * Per spec: "If omitted from REQUEST_UPDATE/SUBSCRIBE_UPDATE, the value is unchanged."
1762
- */
1763
- declare function applyMessageParameterUpdate(current: MessageParameter[], updates: MessageParameter[]): void;
1764
-
1765
- /**
1766
- * Copyright 2025 The MOQtail Authors
1767
- *
1768
- * Licensed under the Apache License, Version 2.0 (the "License");
1769
- * you may not use this file except in compliance with the License.
1770
- * You may obtain a copy of the License at
1771
- *
1772
- * http://www.apache.org/licenses/LICENSE-2.0
1773
- *
1774
- * Unless required by applicable law or agreed to in writing, software
1775
- * distributed under the License is distributed on an "AS IS" BASIS,
1776
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1777
- * See the License for the specific language governing permissions and
1778
- * limitations under the License.
1779
- */
1780
-
1781
- /**
1782
- * Represents a protocol PublishNamespace message, used to announce a track and its parameters.
1783
- *
1784
- * @public
1785
- */
1786
- declare class PublishNamespace {
1787
- readonly requestId: bigint;
1788
- readonly trackNamespace: Tuple;
1789
- readonly parameters: MessageParameter[];
1790
- /**
1791
- * @public
1792
- * Constructs a PublishNamespace message.
1793
- *
1794
- * @param requestId - The request ID for this publish namespace message.
1795
- * @param trackNamespace - The track namespace as a Tuple.
1796
- * @param parameters - The list of strongly-typed message parameters for the track.
1797
- */
1798
- constructor(requestId: bigint, trackNamespace: Tuple, parameters: MessageParameter[]);
1799
- /**
1800
- * @public
1801
- * Gets the message type for this PublishNamespace message.
1802
- *
1803
- * @returns The ControlMessageType.PublishNamespace value.
1804
- */
1805
- getType(): ControlMessageType;
1806
- /**
1807
- * @public
1808
- * Serializes the PublishNamespace message into a {@link FrozenByteBuffer}.
1809
- *
1810
- * @returns The serialized buffer.
1811
- * @throws :{@link LengthExceedsMaxError} If the payload exceeds 65535 bytes.
1812
- */
1813
- serialize(): FrozenByteBuffer;
1814
- /**
1815
- * @public
1816
- * Parses a PublishNamespace message from the given buffer.
1817
- *
1818
- * @param buf - The buffer to parse from.
1819
- * @returns The parsed PublishNamespace message.
1820
- * @throws :{@link NotEnoughBytesError} If the buffer does not contain enough bytes.
1821
- */
1822
- static parsePayload(buf: BaseByteBuffer): PublishNamespace;
1823
- }
1824
-
1825
- /**
1826
- * Copyright 2025 The MOQtail Authors
1827
- *
1828
- * Licensed under the Apache License, Version 2.0 (the "License");
1829
- * you may not use this file except in compliance with the License.
1830
- * You may obtain a copy of the License at
1831
- *
1832
- * http://www.apache.org/licenses/LICENSE-2.0
1833
- *
1834
- * Unless required by applicable law or agreed to in writing, software
1835
- * distributed under the License is distributed on an "AS IS" BASIS,
1836
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1837
- * See the License for the specific language governing permissions and
1838
- * limitations under the License.
1839
- */
1840
-
1841
- declare class PublishNamespaceCancel {
1842
- readonly requestId: bigint;
1843
- readonly errorCode: RequestErrorCode;
1844
- readonly reasonPhrase: ReasonPhrase;
1845
- constructor(requestId: bigint, errorCode: RequestErrorCode, reasonPhrase: ReasonPhrase);
1846
- getType(): ControlMessageType;
1847
- serialize(): FrozenByteBuffer;
1848
- static parsePayload(buf: BaseByteBuffer): PublishNamespaceCancel;
1849
- }
1850
-
1851
- /**
1852
- * Copyright 2025 The MOQtail Authors
1853
- *
1854
- * Licensed under the Apache License, Version 2.0 (the "License");
1855
- * you may not use this file except in compliance with the License.
1856
- * You may obtain a copy of the License at
1857
- *
1858
- * http://www.apache.org/licenses/LICENSE-2.0
1859
- *
1860
- * Unless required by applicable law or agreed to in writing, software
1861
- * distributed under the License is distributed on an "AS IS" BASIS,
1862
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1863
- * See the License for the specific language governing permissions and
1864
- * limitations under the License.
1865
- */
1866
-
1867
- /**
1868
- * @public
1869
- * Represents a NAMESPACE message sent on a SUBSCRIBE_NAMESPACE bi-stream.
1870
- * Carries the namespace suffix (fields after the subscriber's prefix).
1871
- */
1872
- declare class Namespace {
1873
- readonly trackNamespaceSuffix: Tuple;
1874
- constructor(trackNamespaceSuffix: Tuple);
1875
- getType(): ControlMessageType;
1876
- serialize(): FrozenByteBuffer;
1877
- static parsePayload(buf: BaseByteBuffer): Namespace;
1878
- }
1879
-
1880
- /**
1881
- * Copyright 2025 The MOQtail Authors
1882
- *
1883
- * Licensed under the Apache License, Version 2.0 (the "License");
1884
- * you may not use this file except in compliance with the License.
1885
- * You may obtain a copy of the License at
1886
- *
1887
- * http://www.apache.org/licenses/LICENSE-2.0
1888
- *
1889
- * Unless required by applicable law or agreed to in writing, software
1890
- * distributed under the License is distributed on an "AS IS" BASIS,
1891
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1892
- * See the License for the specific language governing permissions and
1893
- * limitations under the License.
1894
- */
1895
-
1896
- /**
1897
- * @public
1898
- * Represents a NAMESPACE_DONE message sent on a SUBSCRIBE_NAMESPACE bi-stream.
1899
- * Signals that a previously announced namespace suffix is no longer available.
1900
- */
1901
- declare class NamespaceDone {
1902
- readonly trackNamespaceSuffix: Tuple;
1903
- constructor(trackNamespaceSuffix: Tuple);
1904
- getType(): ControlMessageType;
1905
- serialize(): FrozenByteBuffer;
1906
- static parsePayload(buf: BaseByteBuffer): NamespaceDone;
1907
- }
1908
-
1909
- /**
1910
- * Copyright 2025 The MOQtail Authors
1911
- *
1912
- * Licensed under the Apache License, Version 2.0 (the "License");
1913
- * you may not use this file except in compliance with the License.
1914
- * You may obtain a copy of the License at
1915
- *
1916
- * http://www.apache.org/licenses/LICENSE-2.0
1917
- *
1918
- * Unless required by applicable law or agreed to in writing, software
1919
- * distributed under the License is distributed on an "AS IS" BASIS,
1920
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1921
- * See the License for the specific language governing permissions and
1922
- * limitations under the License.
1923
- */
1924
-
1925
- declare class ClientSetup {
1926
- readonly setupParameters: KeyValuePair[];
1927
- constructor(setupParameters: KeyValuePair[]);
1928
- getType(): ControlMessageType;
1929
- serialize(): FrozenByteBuffer;
1930
- static parsePayload(buf: BaseByteBuffer): ClientSetup;
1931
- }
1932
-
1933
- /**
1934
- * Copyright 2025 The MOQtail Authors
1935
- *
1936
- * Licensed under the Apache License, Version 2.0 (the "License");
1937
- * you may not use this file except in compliance with the License.
1938
- * You may obtain a copy of the License at
1939
- *
1940
- * http://www.apache.org/licenses/LICENSE-2.0
1941
- *
1942
- * Unless required by applicable law or agreed to in writing, software
1943
- * distributed under the License is distributed on an "AS IS" BASIS,
1944
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1945
- * See the License for the specific language governing permissions and
1946
- * limitations under the License.
1947
- */
1948
-
1949
- declare class Fetch {
1950
- readonly requestId: bigint;
1951
- readonly typeAndProps: {
1952
- readonly type: FetchType.Standalone;
1953
- readonly props: {
1954
- fullTrackName: FullTrackName;
1955
- startLocation: Location;
1956
- endLocation: Location;
1957
- };
1958
- } | {
1959
- readonly type: FetchType.Relative;
1960
- readonly props: {
1961
- joiningRequestId: bigint;
1962
- joiningStart: bigint;
1963
- };
1964
- } | {
1965
- readonly type: FetchType.Absolute;
1966
- readonly props: {
1967
- joiningRequestId: bigint;
1968
- joiningStart: bigint;
1969
- };
1970
- };
1971
- readonly parameters: MessageParameter[];
1972
- constructor(requestId: bigint, typeAndProps: {
1973
- readonly type: FetchType.Standalone;
1974
- readonly props: {
1975
- fullTrackName: FullTrackName;
1976
- startLocation: Location;
1977
- endLocation: Location;
1978
- };
1979
- } | {
1980
- readonly type: FetchType.Relative;
1981
- readonly props: {
1982
- joiningRequestId: bigint;
1983
- joiningStart: bigint;
1984
- };
1985
- } | {
1986
- readonly type: FetchType.Absolute;
1987
- readonly props: {
1988
- joiningRequestId: bigint;
1989
- joiningStart: bigint;
1990
- };
1991
- }, parameters: MessageParameter[]);
1992
- getType(): ControlMessageType;
1993
- serialize(): FrozenByteBuffer;
1994
- static parsePayload(buf: BaseByteBuffer): Fetch;
1995
- }
1996
-
1997
- /**
1998
- * Copyright 2025 The MOQtail Authors
1999
- *
2000
- * Licensed under the Apache License, Version 2.0 (the "License");
2001
- * you may not use this file except in compliance with the License.
2002
- * You may obtain a copy of the License at
2003
- *
2004
- * http://www.apache.org/licenses/LICENSE-2.0
2005
- *
2006
- * Unless required by applicable law or agreed to in writing, software
2007
- * distributed under the License is distributed on an "AS IS" BASIS,
2008
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2009
- * See the License for the specific language governing permissions and
2010
- * limitations under the License.
2011
- */
2012
-
2013
- declare class FetchCancel {
2014
- readonly requestId: bigint;
2015
- constructor(requestId: bigint | number);
2016
- getType(): ControlMessageType;
2017
- serialize(): FrozenByteBuffer;
2018
- static parsePayload(buf: BaseByteBuffer): FetchCancel;
2019
- }
2020
-
2021
- /**
2022
- * Copyright 2025 The MOQtail Authors
2023
- *
2024
- * Licensed under the Apache License, Version 2.0 (the "License");
2025
- * you may not use this file except in compliance with the License.
2026
- * You may obtain a copy of the License at
2027
- *
2028
- * http://www.apache.org/licenses/LICENSE-2.0
2029
- *
2030
- * Unless required by applicable law or agreed to in writing, software
2031
- * distributed under the License is distributed on an "AS IS" BASIS,
2032
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2033
- * See the License for the specific language governing permissions and
2034
- * limitations under the License.
2035
- */
2036
- declare enum LOCHeaderExtensionId {
2037
- CaptureTimestamp = 2,
2038
- VideoFrameMarking = 4,
2039
- AudioLevel = 6,
2040
- VideoConfig = 13
2041
- }
2042
- declare enum TrackExtensionType {
2043
- DeliveryTimeout = 2,
2044
- MaxCacheDuration = 4,
2045
- ImmutableExtensions = 11,
2046
- DefaultPublisherPriority = 14,
2047
- DefaultPublisherGroupOrder = 34,
2048
- DynamicGroups = 48,
2049
- PriorGroupIdGap = 60,
2050
- PriorObjectIdGap = 62
2051
- }
2052
- declare function locHeaderExtensionIdFromNumber(value: number): LOCHeaderExtensionId;
2053
-
2054
- /**
2055
- * Copyright 2026 The MOQtail Authors
2056
- *
2057
- * Licensed under the Apache License, Version 2.0 (the "License");
2058
- * you may not use this file except in compliance with the License.
2059
- * You may obtain a copy of the License at
2060
- *
2061
- * http://www.apache.org/licenses/LICENSE-2.0
2062
- *
2063
- * Unless required by applicable law or agreed to in writing, software
2064
- * distributed under the License is distributed on an "AS IS" BASIS,
2065
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2066
- * See the License for the specific language governing permissions and
2067
- * limitations under the License.
2068
- */
2069
-
2070
- declare class DeliveryTimeoutExtension {
2071
- readonly timeoutMs: bigint;
2072
- static readonly TYPE = TrackExtensionType.DeliveryTimeout;
2073
- constructor(timeoutMs: bigint);
2074
- toKeyValuePair(): KeyValuePair;
2075
- static fromKeyValuePair(pair: KeyValuePair): DeliveryTimeoutExtension | undefined;
2076
- }
2077
- declare class MaxCacheDurationExtension {
2078
- readonly durationMs: bigint;
2079
- static readonly TYPE = TrackExtensionType.MaxCacheDuration;
2080
- constructor(durationMs: bigint);
2081
- toKeyValuePair(): KeyValuePair;
2082
- static fromKeyValuePair(pair: KeyValuePair): MaxCacheDurationExtension | undefined;
2083
- }
2084
- declare class ImmutableExtensionsExtension {
2085
- readonly extensions: KeyValuePair[];
2086
- static readonly TYPE = TrackExtensionType.ImmutableExtensions;
2087
- constructor(extensions: KeyValuePair[]);
2088
- toKeyValuePair(): KeyValuePair;
2089
- static fromKeyValuePair(pair: KeyValuePair): ImmutableExtensionsExtension | undefined;
2090
- }
2091
- declare class DefaultPublisherPriorityExtension {
2092
- readonly priority: number;
2093
- static readonly TYPE = TrackExtensionType.DefaultPublisherPriority;
2094
- constructor(priority: number);
2095
- toKeyValuePair(): KeyValuePair;
2096
- static fromKeyValuePair(pair: KeyValuePair): DefaultPublisherPriorityExtension | undefined;
2097
- }
2098
- declare class DefaultPublisherGroupOrderExtension {
2099
- readonly order: GroupOrder;
2100
- static readonly TYPE = TrackExtensionType.DefaultPublisherGroupOrder;
2101
- constructor(order: GroupOrder);
2102
- toKeyValuePair(): KeyValuePair;
2103
- static fromKeyValuePair(pair: KeyValuePair): DefaultPublisherGroupOrderExtension | undefined;
2104
- }
2105
- declare class DynamicGroupsExtension {
2106
- readonly enabled: boolean;
2107
- static readonly TYPE = TrackExtensionType.DynamicGroups;
2108
- constructor(enabled: boolean);
2109
- toKeyValuePair(): KeyValuePair;
2110
- static fromKeyValuePair(pair: KeyValuePair): DynamicGroupsExtension | undefined;
2111
- }
2112
- declare class UnknownTrackExtension {
2113
- readonly kvp: KeyValuePair;
2114
- constructor(kvp: KeyValuePair);
2115
- toKeyValuePair(): KeyValuePair;
2116
- }
2117
- type TrackExtension = DeliveryTimeoutExtension | MaxCacheDurationExtension | ImmutableExtensionsExtension | DefaultPublisherPriorityExtension | DefaultPublisherGroupOrderExtension | DynamicGroupsExtension | UnknownTrackExtension;
2118
- declare namespace TrackExtension {
2119
- function fromKeyValuePair(pair: KeyValuePair): TrackExtension;
2120
- function toKeyValuePair(ext: TrackExtension): KeyValuePair;
2121
- function deserializeAll(buf: BaseByteBuffer): TrackExtension[];
2122
- function serializeInto(exts: TrackExtension[], payload: ByteBuffer): void;
2123
- function isDeliveryTimeout(ext: TrackExtension): ext is DeliveryTimeoutExtension;
2124
- function isMaxCacheDuration(ext: TrackExtension): ext is MaxCacheDurationExtension;
2125
- function isImmutableExtensions(ext: TrackExtension): ext is ImmutableExtensionsExtension;
2126
- function isDefaultPublisherPriority(ext: TrackExtension): ext is DefaultPublisherPriorityExtension;
2127
- function isDefaultPublisherGroupOrder(ext: TrackExtension): ext is DefaultPublisherGroupOrderExtension;
2128
- function isDynamicGroups(ext: TrackExtension): ext is DynamicGroupsExtension;
2129
- function isUnknown(ext: TrackExtension): ext is UnknownTrackExtension;
2130
- }
2131
-
2132
- /**
2133
- * Copyright 2025 The MOQtail Authors
2134
- *
2135
- * Licensed under the Apache License, Version 2.0 (the "License");
2136
- * you may not use this file except in compliance with the License.
2137
- * You may obtain a copy of the License at
2138
- *
2139
- * http://www.apache.org/licenses/LICENSE-2.0
2140
- *
2141
- * Unless required by applicable law or agreed to in writing, software
2142
- * distributed under the License is distributed on an "AS IS" BASIS,
2143
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2144
- * See the License for the specific language governing permissions and
2145
- * limitations under the License.
2146
- */
2147
-
2148
- declare class FetchOk {
2149
- readonly requestId: bigint;
2150
- readonly endOfTrack: boolean;
2151
- readonly endLocation: Location;
2152
- readonly parameters: MessageParameter[];
2153
- readonly trackExtensions: TrackExtension[];
2154
- constructor(requestId: bigint, endOfTrack: boolean, endLocation: Location, parameters: MessageParameter[], trackExtensions?: TrackExtension[]);
2155
- serialize(): FrozenByteBuffer;
2156
- static parsePayload(buf: BaseByteBuffer): FetchOk;
2157
- }
2158
-
2159
- /**
2160
- * Copyright 2025 The MOQtail Authors
2161
- *
2162
- * Licensed under the Apache License, Version 2.0 (the "License");
2163
- * you may not use this file except in compliance with the License.
2164
- * You may obtain a copy of the License at
2165
- *
2166
- * http://www.apache.org/licenses/LICENSE-2.0
2167
- *
2168
- * Unless required by applicable law or agreed to in writing, software
2169
- * distributed under the License is distributed on an "AS IS" BASIS,
2170
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2171
- * See the License for the specific language governing permissions and
2172
- * limitations under the License.
2173
- */
2174
-
2175
- declare class GoAway {
2176
- newSessionUri?: string | undefined;
2177
- constructor(newSessionUri?: string);
2178
- static getType(): ControlMessageType;
2179
- serialize(): FrozenByteBuffer;
2180
- static parsePayload(buf: BaseByteBuffer): GoAway;
2181
- }
2182
-
2183
- /**
2184
- * Copyright 2025 The MOQtail Authors
2185
- *
2186
- * Licensed under the Apache License, Version 2.0 (the "License");
2187
- * you may not use this file except in compliance with the License.
2188
- * You may obtain a copy of the License at
2189
- *
2190
- * http://www.apache.org/licenses/LICENSE-2.0
2191
- *
2192
- * Unless required by applicable law or agreed to in writing, software
2193
- * distributed under the License is distributed on an "AS IS" BASIS,
2194
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2195
- * See the License for the specific language governing permissions and
2196
- * limitations under the License.
2197
- */
2198
-
2199
- declare class MaxRequestId$1 {
2200
- readonly maxRequestId: bigint;
2201
- constructor(maxRequestId: bigint | number);
2202
- getType(): ControlMessageType;
2203
- serialize(): FrozenByteBuffer;
2204
- static parsePayload(buf: BaseByteBuffer): MaxRequestId$1;
2205
- }
2206
-
2207
- /**
2208
- * Copyright 2025 The MOQtail Authors
2209
- *
2210
- * Licensed under the Apache License, Version 2.0 (the "License");
2211
- * you may not use this file except in compliance with the License.
2212
- * You may obtain a copy of the License at
2213
- *
2214
- * http://www.apache.org/licenses/LICENSE-2.0
2215
- *
2216
- * Unless required by applicable law or agreed to in writing, software
2217
- * distributed under the License is distributed on an "AS IS" BASIS,
2218
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2219
- * See the License for the specific language governing permissions and
2220
- * limitations under the License.
2221
- */
2222
-
2223
- declare class ServerSetup {
2224
- readonly setupParameters: KeyValuePair[];
2225
- constructor(setupParameters: KeyValuePair[]);
2226
- getType(): ControlMessageType;
2227
- serialize(): FrozenByteBuffer;
2228
- static parsePayload(buf: BaseByteBuffer): ServerSetup;
2229
- }
2230
-
2231
- /**
2232
- * Copyright 2025 The MOQtail Authors
2233
- *
2234
- * Licensed under the Apache License, Version 2.0 (the "License");
2235
- * you may not use this file except in compliance with the License.
2236
- * You may obtain a copy of the License at
2237
- *
2238
- * http://www.apache.org/licenses/LICENSE-2.0
2239
- *
2240
- * Unless required by applicable law or agreed to in writing, software
2241
- * distributed under the License is distributed on an "AS IS" BASIS,
2242
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2243
- * See the License for the specific language governing permissions and
2244
- * limitations under the License.
2245
- */
2246
-
2247
- declare class Subscribe {
2248
- requestId: bigint;
2249
- fullTrackName: FullTrackName;
2250
- parameters: MessageParameter[];
2251
- private constructor();
2252
- static newNextGroupStart(requestId: bigint, fullTrackName: FullTrackName, parameters: MessageParameter[]): Subscribe;
2253
- static newLatestObject(requestId: bigint, fullTrackName: FullTrackName, parameters: MessageParameter[]): Subscribe;
2254
- static newAbsoluteStart(requestId: bigint, fullTrackName: FullTrackName, startLocation: Location, parameters: MessageParameter[]): Subscribe;
2255
- static newAbsoluteRange(requestId: bigint, fullTrackName: FullTrackName, startLocation: Location, endGroup: bigint, parameters: MessageParameter[]): Subscribe;
2256
- serialize(): FrozenByteBuffer;
2257
- static parsePayload(buf: BaseByteBuffer): Subscribe;
2258
- }
2259
-
2260
- /**
2261
- * Copyright 2025 The MOQtail Authors
2262
- *
2263
- * Licensed under the Apache License, Version 2.0 (the "License");
2264
- * you may not use this file except in compliance with the License.
2265
- * You may obtain a copy of the License at
2266
- *
2267
- * http://www.apache.org/licenses/LICENSE-2.0
2268
- *
2269
- * Unless required by applicable law or agreed to in writing, software
2270
- * distributed under the License is distributed on an "AS IS" BASIS,
2271
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2272
- * See the License for the specific language governing permissions and
2273
- * limitations under the License.
2274
- */
2275
-
2276
- declare class PublishDone {
2277
- readonly requestId: bigint;
2278
- readonly statusCode: PublishDoneStatusCode;
2279
- readonly streamCount: bigint;
2280
- readonly errorReason: ReasonPhrase;
2281
- constructor(requestId: bigint, statusCode: PublishDoneStatusCode, streamCount: bigint, errorReason: ReasonPhrase);
2282
- static new(requestId: bigint | number, statusCode: PublishDoneStatusCode, streamCount: bigint, errorReason: ReasonPhrase): PublishDone;
2283
- getType(): ControlMessageType;
2284
- serialize(): FrozenByteBuffer;
2285
- static parsePayload(buf: BaseByteBuffer): PublishDone;
2286
- }
2287
-
2288
- /**
2289
- * Copyright 2025 The MOQtail Authors
2290
- *
2291
- * Licensed under the Apache License, Version 2.0 (the "License");
2292
- * you may not use this file except in compliance with the License.
2293
- * You may obtain a copy of the License at
2294
- *
2295
- * http://www.apache.org/licenses/LICENSE-2.0
2296
- *
2297
- * Unless required by applicable law or agreed to in writing, software
2298
- * distributed under the License is distributed on an "AS IS" BASIS,
2299
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2300
- * See the License for the specific language governing permissions and
2301
- * limitations under the License.
2302
- */
2303
-
2304
- declare class Publish {
2305
- readonly requestId: bigint;
2306
- readonly fullTrackName: FullTrackName;
2307
- readonly trackAlias: bigint;
2308
- readonly parameters: MessageParameter[];
2309
- readonly trackExtensions: TrackExtension[];
2310
- constructor(requestId: bigint, fullTrackName: FullTrackName, trackAlias: bigint, parameters: MessageParameter[], trackExtensions?: TrackExtension[]);
2311
- getType(): ControlMessageType;
2312
- serialize(): FrozenByteBuffer;
2313
- static parsePayload(buf: BaseByteBuffer): Publish;
2314
- }
2315
-
2316
- /**
2317
- * Copyright 2025 The MOQtail Authors
2318
- *
2319
- * Licensed under the Apache License, Version 2.0 (the "License");
2320
- * you may not use this file except in compliance with the License.
2321
- * You may obtain a copy of the License at
2322
- *
2323
- * http://www.apache.org/licenses/LICENSE-2.0
2324
- *
2325
- * Unless required by applicable law or agreed to in writing, software
2326
- * distributed under the License is distributed on an "AS IS" BASIS,
2327
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2328
- * See the License for the specific language governing permissions and
2329
- * limitations under the License.
2330
- */
2331
-
2332
- declare class PublishOk {
2333
- readonly requestId: bigint;
2334
- readonly parameters: MessageParameter[];
2335
- constructor(requestId: bigint, parameters: MessageParameter[]);
2336
- getType(): ControlMessageType;
2337
- serialize(): FrozenByteBuffer;
2338
- static parsePayload(buf: BaseByteBuffer): PublishOk;
2339
- }
2340
-
2341
- /**
2342
- * Copyright 2025 The MOQtail Authors
2343
- *
2344
- * Licensed under the Apache License, Version 2.0 (the "License");
2345
- * you may not use this file except in compliance with the License.
2346
- * You may obtain a copy of the License at
2347
- *
2348
- * http://www.apache.org/licenses/LICENSE-2.0
2349
- *
2350
- * Unless required by applicable law or agreed to in writing, software
2351
- * distributed under the License is distributed on an "AS IS" BASIS,
2352
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2353
- * See the License for the specific language governing permissions and
2354
- * limitations under the License.
2355
- */
2356
-
2357
- declare class SubscribeOk {
2358
- requestId: bigint;
2359
- trackAlias: bigint;
2360
- parameters: MessageParameter[];
2361
- trackExtensions: TrackExtension[];
2362
- private constructor();
2363
- static create(requestId: bigint, trackAlias: bigint, parameters: MessageParameter[], trackExtensions?: TrackExtension[]): SubscribeOk;
2364
- serialize(): FrozenByteBuffer;
2365
- static parsePayload(buf: BaseByteBuffer): SubscribeOk;
2366
- }
2367
-
2368
- /**
2369
- * Copyright 2025 The MOQtail Authors
2370
- *
2371
- * Licensed under the Apache License, Version 2.0 (the "License");
2372
- * you may not use this file except in compliance with the License.
2373
- * You may obtain a copy of the License at
2374
- *
2375
- * http://www.apache.org/licenses/LICENSE-2.0
2376
- *
2377
- * Unless required by applicable law or agreed to in writing, software
2378
- * distributed under the License is distributed on an "AS IS" BASIS,
2379
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2380
- * See the License for the specific language governing permissions and
2381
- * limitations under the License.
2382
- */
2383
-
2384
- declare class RequestUpdate {
2385
- requestId: bigint;
2386
- existingRequestId: bigint;
2387
- parameters: MessageParameter[];
2388
- constructor(requestId: bigint, existingRequestId: bigint, parameters: MessageParameter[]);
2389
- getType(): ControlMessageType;
2390
- serialize(): FrozenByteBuffer;
2391
- static parsePayload(buf: BaseByteBuffer): RequestUpdate;
2392
- equals(other: RequestUpdate): boolean;
2393
- }
2394
-
2395
- /**
2396
- * Copyright 2025 The MOQtail Authors
2397
- *
2398
- * Licensed under the Apache License, Version 2.0 (the "License");
2399
- * you may not use this file except in compliance with the License.
2400
- * You may obtain a copy of the License at
2401
- *
2402
- * http://www.apache.org/licenses/LICENSE-2.0
2403
- *
2404
- * Unless required by applicable law or agreed to in writing, software
2405
- * distributed under the License is distributed on an "AS IS" BASIS,
2406
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2407
- * See the License for the specific language governing permissions and
2408
- * limitations under the License.
2409
- */
2410
-
2411
- declare class RequestsBlocked {
2412
- readonly maximumRequestId: bigint;
2413
- constructor(maximumRequestId: bigint | number);
2414
- getType(): ControlMessageType;
2415
- serialize(): FrozenByteBuffer;
2416
- static parsePayload(buf: BaseByteBuffer): RequestsBlocked;
2417
- }
2418
-
2419
- /**
2420
- * Copyright 2025 The MOQtail Authors
2421
- *
2422
- * Licensed under the Apache License, Version 2.0 (the "License");
2423
- * you may not use this file except in compliance with the License.
2424
- * You may obtain a copy of the License at
2425
- *
2426
- * http://www.apache.org/licenses/LICENSE-2.0
2427
- *
2428
- * Unless required by applicable law or agreed to in writing, software
2429
- * distributed under the License is distributed on an "AS IS" BASIS,
2430
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2431
- * See the License for the specific language governing permissions and
2432
- * limitations under the License.
2433
- */
2434
-
2435
- declare class TrackStatus {
2436
- requestId: bigint;
2437
- trackAlias: bigint;
2438
- fullTrackName: FullTrackName;
2439
- subscriberPriority: number;
2440
- groupOrder: GroupOrder;
2441
- forward: boolean;
2442
- filterType: FilterType;
2443
- startLocation: Location | undefined;
2444
- endGroup: bigint | undefined;
2445
- subscribeParameters: MessageParameter[];
2446
- private constructor();
2447
- static newNextGroupStart(requestId: bigint, trackAlias: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, subscribeParameters: MessageParameter[]): TrackStatus;
2448
- static newLatestObject(requestId: bigint, trackAlias: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, subscribeParameters: MessageParameter[]): TrackStatus;
2449
- static newAbsoluteStart(requestId: bigint, trackAlias: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, subscribeParameters: MessageParameter[]): TrackStatus;
2450
- static newAbsoluteRange(requestId: bigint, trackAlias: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, endGroup: bigint, subscribeParameters: MessageParameter[]): TrackStatus;
2451
- serialize(): FrozenByteBuffer;
2452
- static parsePayload(buf: BaseByteBuffer): TrackStatus;
2453
- }
2454
-
2455
- /**
2456
- * Copyright 2025 The MOQtail Authors
2457
- *
2458
- * Licensed under the Apache License, Version 2.0 (the "License");
2459
- * you may not use this file except in compliance with the License.
2460
- * You may obtain a copy of the License at
2461
- *
2462
- * http://www.apache.org/licenses/LICENSE-2.0
2463
- *
2464
- * Unless required by applicable law or agreed to in writing, software
2465
- * distributed under the License is distributed on an "AS IS" BASIS,
2466
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2467
- * See the License for the specific language governing permissions and
2468
- * limitations under the License.
2469
- */
2470
-
2471
- /**
2472
- * @public
2473
- * Represents a protocol PublishNamespaceDone message, used to unpublish a track namespace.
2474
- */
2475
- declare class PublishNamespaceDone {
2476
- readonly trackNamespace: Tuple;
2477
- /**
2478
- * Constructs a PublishNamespaceDone message.
2479
- * @param trackNamespace - The track namespace to unpublish.
2480
- */
2481
- constructor(trackNamespace: Tuple);
2482
- /**
2483
- * Gets the control message type for this PublishNamespaceDone message.
2484
- * @returns The ControlMessageType.PublishNamespaceDone enum value.
2485
- */
2486
- getType(): ControlMessageType;
2487
- /**
2488
- * Serializes the PublishNamespaceDone message to a frozen byte buffer.
2489
- * @returns The serialized message as a FrozenByteBuffer.
2490
- * @throws :{@link LengthExceedsMaxError} If the payload exceeds 65535 bytes.
2491
- */
2492
- serialize(): FrozenByteBuffer;
2493
- /**
2494
- * Parses a PublishNamespaceDone message payload from a buffer.
2495
- * @param buf - The buffer containing the payload.
2496
- * @returns The parsed PublishNamespaceDone message.
2497
- */
2498
- static parsePayload(buf: BaseByteBuffer): PublishNamespaceDone;
2499
- }
2500
-
2501
- /**
2502
- * Copyright 2025 The MOQtail Authors
2503
- *
2504
- * Licensed under the Apache License, Version 2.0 (the "License");
2505
- * you may not use this file except in compliance with the License.
2506
- * You may obtain a copy of the License at
2507
- *
2508
- * http://www.apache.org/licenses/LICENSE-2.0
2509
- *
2510
- * Unless required by applicable law or agreed to in writing, software
2511
- * distributed under the License is distributed on an "AS IS" BASIS,
2512
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2513
- * See the License for the specific language governing permissions and
2514
- * limitations under the License.
2515
- */
2516
-
2517
- declare class Unsubscribe {
2518
- readonly requestId: bigint;
2519
- constructor(requestId: bigint | number);
2520
- getType(): ControlMessageType;
2521
- serialize(): FrozenByteBuffer;
2522
- static parsePayload(buf: BaseByteBuffer): Unsubscribe;
2523
- }
2524
-
2525
- /**
2526
- * Copyright 2025 The MOQtail Authors
2527
- *
2528
- * Licensed under the Apache License, Version 2.0 (the "License");
2529
- * you may not use this file except in compliance with the License.
2530
- * You may obtain a copy of the License at
2531
- *
2532
- * http://www.apache.org/licenses/LICENSE-2.0
2533
- *
2534
- * Unless required by applicable law or agreed to in writing, software
2535
- * distributed under the License is distributed on an "AS IS" BASIS,
2536
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2537
- * See the License for the specific language governing permissions and
2538
- * limitations under the License.
2539
- */
2540
-
2541
- declare class SubscribeNamespace {
2542
- readonly requestId: bigint;
2543
- readonly trackNamespacePrefix: Tuple;
2544
- readonly subscribeOptions: NamespaceSubscribeOptions;
2545
- readonly parameters: MessageParameter[];
2546
- constructor(requestId: bigint, trackNamespacePrefix: Tuple, subscribeOptions: NamespaceSubscribeOptions, parameters: MessageParameter[]);
2547
- getType(): ControlMessageType;
2548
- serialize(): FrozenByteBuffer;
2549
- static parsePayload(buf: BaseByteBuffer): SubscribeNamespace;
2550
- }
2551
-
2552
- /**
2553
- * Copyright 2025 The MOQtail Authors
2554
- *
2555
- * Licensed under the Apache License, Version 2.0 (the "License");
2556
- * you may not use this file except in compliance with the License.
2557
- * You may obtain a copy of the License at
2558
- *
2559
- * http://www.apache.org/licenses/LICENSE-2.0
2560
- *
2561
- * Unless required by applicable law or agreed to in writing, software
2562
- * distributed under the License is distributed on an "AS IS" BASIS,
2563
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2564
- * See the License for the specific language governing permissions and
2565
- * limitations under the License.
2566
- */
2567
-
2568
- declare class UnsubscribeNamespace {
2569
- readonly trackNamespacePrefix: Tuple;
2570
- constructor(trackNamespacePrefix: Tuple);
2571
- getType(): ControlMessageType;
2572
- serialize(): FrozenByteBuffer;
2573
- static parsePayload(buf: BaseByteBuffer): UnsubscribeNamespace;
2574
- }
2575
-
2576
- /**
2577
- * Copyright 2026 The MOQtail Authors
2578
- *
2579
- * Licensed under the Apache License, Version 2.0 (the "License");
2580
- * you may not use this file except in compliance with the License.
2581
- * You may obtain a copy of the License at
2582
- *
2583
- * http://www.apache.org/licenses/LICENSE-2.0
2584
- *
2585
- * Unless required by applicable law or agreed to in writing, software
2586
- * distributed under the License is distributed on an "AS IS" BASIS,
2587
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2588
- * See the License for the specific language governing permissions and
2589
- * limitations under the License.
2590
- */
2591
-
2592
- declare class RequestOk {
2593
- readonly requestId: bigint;
2594
- readonly parameters: MessageParameter[];
2595
- constructor(requestId: bigint | number, parameters?: MessageParameter[]);
2596
- getType(): ControlMessageType;
2597
- serialize(): FrozenByteBuffer;
2598
- static parsePayload(buf: BaseByteBuffer): RequestOk;
2599
- }
2600
-
2601
- /**
2602
- * Copyright 2025 The MOQtail Authors
2603
- *
2604
- * Licensed under the Apache License, Version 2.0 (the "License");
2605
- * you may not use this file except in compliance with the License.
2606
- * You may obtain a copy of the License at
2607
- *
2608
- * http://www.apache.org/licenses/LICENSE-2.0
2609
- *
2610
- * Unless required by applicable law or agreed to in writing, software
2611
- * distributed under the License is distributed on an "AS IS" BASIS,
2612
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2613
- * See the License for the specific language governing permissions and
2614
- * limitations under the License.
2615
- */
2616
-
2617
- declare class RequestError {
2618
- readonly requestId: bigint;
2619
- readonly errorCode: RequestErrorCode;
2620
- readonly retryInterval: bigint;
2621
- readonly reasonPhrase: ReasonPhrase;
2622
- constructor(requestId: bigint, errorCode: RequestErrorCode, retryInterval: bigint, reasonPhrase: ReasonPhrase);
2623
- getType(): ControlMessageType;
2624
- serialize(): FrozenByteBuffer;
2625
- static parsePayload(buf: BaseByteBuffer): RequestError;
2626
- }
2627
-
2628
- /**
2629
- * Copyright 2025 The MOQtail Authors
2630
- *
2631
- * Licensed under the Apache License, Version 2.0 (the "License");
2632
- * you may not use this file except in compliance with the License.
2633
- * You may obtain a copy of the License at
2634
- *
2635
- * http://www.apache.org/licenses/LICENSE-2.0
2636
- *
2637
- * Unless required by applicable law or agreed to in writing, software
2638
- * distributed under the License is distributed on an "AS IS" BASIS,
2639
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2640
- * See the License for the specific language governing permissions and
2641
- * limitations under the License.
2642
- */
2643
-
2644
- type ControlMessage = Publish | PublishOk | PublishDone | PublishNamespace | PublishNamespaceCancel | Namespace | NamespaceDone | ClientSetup | Fetch | FetchCancel | FetchOk | GoAway | MaxRequestId$1 | ServerSetup | Subscribe | RequestError | SubscribeOk | RequestUpdate | RequestsBlocked | TrackStatus | PublishNamespaceDone | Unsubscribe | SubscribeNamespace | UnsubscribeNamespace | RequestOk;
2645
- declare namespace ControlMessage {
2646
- function deserialize(buf: FrozenByteBuffer): ControlMessage;
2647
- function serialize(msg: ControlMessage): FrozenByteBuffer;
2648
- }
2649
-
2650
- /**
2651
- * Copyright 2025 The MOQtail Authors
2652
- *
2653
- * Licensed under the Apache License, Version 2.0 (the "License");
2654
- * you may not use this file except in compliance with the License.
2655
- * You may obtain a copy of the License at
2656
- *
2657
- * http://www.apache.org/licenses/LICENSE-2.0
2658
- *
2659
- * Unless required by applicable law or agreed to in writing, software
2660
- * distributed under the License is distributed on an "AS IS" BASIS,
2661
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2662
- * See the License for the specific language governing permissions and
2663
- * limitations under the License.
2664
- */
2665
-
2666
- declare class MaxRequestId implements Parameter {
2667
- readonly maxId: bigint;
2668
- static readonly TYPE = SetupParameterType.MaxRequestId;
2669
- constructor(maxId: bigint);
2670
- toKeyValuePair(): KeyValuePair;
2671
- static fromKeyValuePair(pair: KeyValuePair): MaxRequestId | undefined;
2672
- }
2673
-
2674
- /**
2675
- * Copyright 2025 The MOQtail Authors
2676
- *
2677
- * Licensed under the Apache License, Version 2.0 (the "License");
2678
- * you may not use this file except in compliance with the License.
2679
- * You may obtain a copy of the License at
2680
- *
2681
- * http://www.apache.org/licenses/LICENSE-2.0
2682
- *
2683
- * Unless required by applicable law or agreed to in writing, software
2684
- * distributed under the License is distributed on an "AS IS" BASIS,
2685
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2686
- * See the License for the specific language governing permissions and
2687
- * limitations under the License.
2688
- */
2689
-
2690
- declare class Path implements Parameter {
2691
- readonly moqtPath: string;
2692
- static readonly TYPE = SetupParameterType.Path;
2693
- constructor(moqtPath: string);
2694
- toKeyValuePair(): KeyValuePair;
2695
- static fromKeyValuePair(pair: KeyValuePair): Path | undefined;
2696
- }
2697
-
2698
- /**
2699
- * Copyright 2025 The MOQtail Authors
2700
- *
2701
- * Licensed under the Apache License, Version 2.0 (the "License");
2702
- * you may not use this file except in compliance with the License.
2703
- * You may obtain a copy of the License at
2704
- *
2705
- * http://www.apache.org/licenses/LICENSE-2.0
2706
- *
2707
- * Unless required by applicable law or agreed to in writing, software
2708
- * distributed under the License is distributed on an "AS IS" BASIS,
2709
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2710
- * See the License for the specific language governing permissions and
2711
- * limitations under the License.
2712
- */
2713
-
2714
- declare class MaxAuthTokenCacheSize implements Parameter {
2715
- readonly maxSize: bigint;
2716
- static readonly TYPE = SetupParameterType.MaxAuthTokenCacheSize;
2717
- constructor(maxSize: bigint);
2718
- toKeyValuePair(): KeyValuePair;
2719
- static fromKeyValuePair(pair: KeyValuePair): MaxAuthTokenCacheSize | undefined;
2720
- }
2721
-
2722
- /**
2723
- * Copyright 2025 The MOQtail Authors
2724
- *
2725
- * Licensed under the Apache License, Version 2.0 (the "License");
2726
- * you may not use this file except in compliance with the License.
2727
- * You may obtain a copy of the License at
2728
- *
2729
- * http://www.apache.org/licenses/LICENSE-2.0
2730
- *
2731
- * Unless required by applicable law or agreed to in writing, software
2732
- * distributed under the License is distributed on an "AS IS" BASIS,
2733
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2734
- * See the License for the specific language governing permissions and
2735
- * limitations under the License.
2736
- */
2737
-
2738
- type SetupParameter = Path | MaxRequestId | MaxAuthTokenCacheSize | AuthorizationToken;
2739
- declare namespace SetupParameter {
2740
- function fromKeyValuePair(pair: KeyValuePair): SetupParameter | undefined;
2741
- function toKeyValuePair(param: SetupParameter): KeyValuePair;
2742
- function isPath(param: SetupParameter): param is Path;
2743
- function isMaxRequestId(param: SetupParameter): param is MaxRequestId;
2744
- function isMaxAuthTokenCacheSize(param: SetupParameter): param is MaxAuthTokenCacheSize;
2745
- function isAuthorizationToken(param: SetupParameter): param is AuthorizationToken;
2746
- }
2747
- declare class SetupParameters {
2748
- private kvps;
2749
- addMaxAuthTokenCacheSize(maxSize: bigint | number): this;
2750
- addMaxRequestId(maxId: bigint | number): this;
2751
- addPath(moqtPath: string): this;
2752
- addAuthorizationToken(auth: AuthorizationToken): this;
2753
- addRaw(pair: KeyValuePair): this;
2754
- build(): KeyValuePair[];
2755
- static fromKeyValuePairs(kvps: KeyValuePair[]): SetupParameter[];
2756
- }
2757
-
2758
- export { ObjectStatus as $, type AuthTokenVariant as A, BaseByteBuffer as B, ClientSetup as C, Datagram as D, EndOfRangeKind as E, Fetch as F, GoAway as G, Header as H, ImmutableExtensionsExtension as I, MAX_REASON_PHRASE_LEN as J, KeyValuePair as K, LOCHeaderExtensionId as L, MAX_FULL_TRACK_NAME_LENGTH as M, MaxAuthTokenCacheSize as N, MaxCacheDurationExtension as O, MaxRequestId$1 as P, MaxRequestId as Q, MessageParameter as R, MessageParameterType as S, MessageParameters as T, MoqtObject as U, Namespace as V, NamespaceDone as W, NamespaceSubscribeOptions as X, NewGroupRequest as Y, ObjectDatagramType as Z, ObjectForwardingPreference as _, AuthorizationToken as a, type Parameter as a0, Path as a1, Publish as a2, PublishDone as a3, PublishDoneStatusCode as a4, PublishNamespace as a5, PublishNamespaceCancel as a6, PublishNamespaceDone as a7, PublishOk as a8, ReasonPhrase as a9, UnknownTrackExtension as aA, Unsubscribe as aB, UnsubscribeNamespace as aC, applyMessageParameterUpdate as aD, controlMessageTypeFromBigInt as aE, deserializeKvpList as aF, deserializeKvpListUntilEmpty as aG, fetchTypeFromBigInt as aH, filterTypeFromBigInt as aI, groupOrderFromNumber as aJ, isBytes as aK, isVarInt as aL, locHeaderExtensionIdFromNumber as aM, messageParameterTypeFromNumber as aN, publishDoneStatusCodeFromBigInt as aO, requestErrorCodeFromBigInt as aP, serializeKvpList as aQ, setupParameterTypeFromNumber as aR, tokenAliasTypeFromNumber as aS, trackStatusCodeFromBigInt as aT, RequestError as aa, RequestErrorCode as ab, RequestIdMap as ac, RequestOk as ad, RequestUpdate as ae, RequestsBlocked as af, SUPPORTED_VERSIONS as ag, ServerSetup as ah, SetupParameter as ai, SetupParameterType as aj, SetupParameters as ak, SubgroupHeader as al, SubgroupHeaderType as am, SubgroupObject as an, Subscribe as ao, SubscribeNamespace as ap, SubscribeOk as aq, SubscriberPriority as ar, SubscriptionFilter as as, TokenAliasType as at, TrackExtension as au, TrackExtensionType as av, TrackStatus as aw, TrackStatusCode as ax, Tuple as ay, TupleField as az, ByteBuffer as b, ControlMessage as c, ControlMessageType as d, DefaultPublisherGroupOrderExtension as e, DefaultPublisherPriorityExtension as f, DeliveryTimeout as g, DeliveryTimeoutExtension as h, DynamicGroupsExtension as i, Expires as j, FetchCancel as k, FetchHeader as l, FetchHeaderType as m, FetchObject as n, type FetchObjectContext as o, FetchOk as p, FetchType as q, FilterType as r, Forward as s, FrozenByteBuffer as t, FullTrackName as u, GroupOrder as v, GroupOrderParam as w, LargestObject as x, Location as y, MAX_NAMESPACE_TUPLE_COUNT as z };