moqtail 0.15.0 → 0.17.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.
Files changed (43) hide show
  1. package/README.md +153 -473
  2. package/dist/client-CjdF7_cL.d.cts +1928 -0
  3. package/dist/{client-BviQ20Lc.cjs → client-FnSNJocV.cjs} +1102 -1192
  4. package/dist/client-I8mDg-Ls.d.mts +1928 -0
  5. package/dist/{client-zi0lmuIL.mjs → client-MXn-lkAA.mjs} +940 -1018
  6. package/dist/client.cjs +202 -7
  7. package/dist/client.d.cts +23 -1944
  8. package/dist/client.d.mts +23 -1944
  9. package/dist/client.mjs +195 -2
  10. package/dist/emitter-UbeRcbuf.mjs +109 -0
  11. package/dist/{logger-c2NoQqtx.cjs → emitter-qNJYD3yQ.cjs} +61 -2
  12. package/dist/{index-BY6e1obL.d.cts → index-BaZgHZ8D.d.mts} +124 -324
  13. package/dist/index-Bn8VlVoN.d.cts +2261 -0
  14. package/dist/index-Ch5QUygw.d.mts +2261 -0
  15. package/dist/index.cjs +18 -14
  16. package/dist/index.d.cts +20 -4
  17. package/dist/index.d.mts +20 -4
  18. package/dist/index.mjs +5 -4
  19. package/dist/logger-B8IYkljn.d.cts +64 -0
  20. package/dist/logger-B8IYkljn.d.mts +64 -0
  21. package/dist/model.cjs +380 -572
  22. package/dist/model.d.cts +2901 -2
  23. package/dist/model.d.mts +17 -2
  24. package/dist/model.mjs +380 -572
  25. package/dist/player/component.cjs +364 -0
  26. package/dist/player/component.d.cts +59 -0
  27. package/dist/player/component.d.mts +59 -0
  28. package/dist/player/component.mjs +362 -0
  29. package/dist/player-C6y-qpHz.cjs +8488 -0
  30. package/dist/player-DfJB6vBH.mjs +8293 -0
  31. package/dist/player.cjs +31 -0
  32. package/dist/player.d.cts +17 -0
  33. package/dist/player.d.mts +17 -0
  34. package/dist/player.mjs +1 -0
  35. package/dist/util.cjs +9 -10
  36. package/dist/util.d.cts +20 -13
  37. package/dist/util.d.mts +20 -13
  38. package/dist/util.mjs +4 -6
  39. package/package.json +46 -5
  40. package/dist/index-BY6e1obL.d.mts +0 -3087
  41. package/dist/logger-ByDB8lYF.mjs +0 -56
  42. package/dist/logger-dEoueCj7.d.cts +0 -35
  43. package/dist/logger-dEoueCj7.d.mts +0 -35
@@ -1,3087 +0,0 @@
1
- //#region src/model/common/pair.d.ts
2
- /**
3
- * @public
4
- * Represents a key-value pair for MOQT protocol parameters.
5
- *
6
- * - If `typeValue` is **even**, the value is a varint (`bigint`).
7
- * - If `typeValue` is **odd**, the value is a binary blob (`Uint8Array`) with a maximum length of 65535 bytes.
8
- *
9
- * Use {@link KeyValuePair.tryNewVarInt} for varint pairs and {@link KeyValuePair.tryNewBytes} for blob pairs.
10
- * A Type whose own namespace fixes the value encoding overrides the parity rule; see
11
- * {@link KeyValuePair.newBytes}.
12
- */
13
- declare class KeyValuePair {
14
- /**
15
- * The key/type identifier for this pair.
16
- * - Even: value is a varint.
17
- * - Odd: value is a blob.
18
- */
19
- readonly typeValue: bigint;
20
- /**
21
- * The value for this pair.
22
- * - If `typeValue` is even: a varint (`bigint`).
23
- * - If `typeValue` is odd: a binary blob (`Uint8Array`).
24
- */
25
- readonly value: bigint | Uint8Array;
26
- /**
27
- * Constructs a new KeyValuePair.
28
- * @param typeValue - The key/type identifier.
29
- * @param value - The value (varint or blob).
30
- * @internal Use static factory methods instead.
31
- */
32
- private constructor();
33
- /**
34
- * Creates a new varint KeyValuePair.
35
- * @param typeValue - Must be even.
36
- * @param value - The varint value.
37
- * @returns A KeyValuePair with varint value.
38
- * @throws KeyValueFormattingError if typeValue is not even.
39
- */
40
- static tryNewVarInt(typeValue: bigint | number, value: bigint | number): KeyValuePair;
41
- /**
42
- * Creates a varint KeyValuePair for a Type whose namespace defines a numeric value
43
- * regardless of parity. Prefer {@link KeyValuePair.tryNewVarInt}.
44
- * @param typeValue - The key/type identifier; parity is not checked.
45
- * @param value - The varint value.
46
- */
47
- static newVarInt(typeValue: bigint | number, value: bigint | number): KeyValuePair;
48
- /**
49
- * Creates a new blob KeyValuePair.
50
- * @param typeValue - Must be odd.
51
- * @param value - The binary blob value.
52
- * @returns A KeyValuePair with blob value.
53
- * @throws KeyValueFormattingError if typeValue is not odd.
54
- * @throws LengthExceedsMaxError if value length exceeds 65535 bytes.
55
- */
56
- static tryNewBytes(typeValue: bigint | number, value: Uint8Array): KeyValuePair;
57
- /**
58
- * Creates a blob KeyValuePair for a Type whose namespace defines a byte-string
59
- * value regardless of parity. Prefer {@link KeyValuePair.tryNewBytes}.
60
- * @param typeValue - The key/type identifier; parity is not checked.
61
- * @param value - The binary blob value.
62
- * @throws LengthExceedsMaxError if value length exceeds 65535 bytes.
63
- */
64
- static newBytes(typeValue: bigint | number, value: Uint8Array): KeyValuePair;
65
- /**
66
- * Serializes this key-value pair to a frozen byte buffer.
67
- * Equivalent to {@link KeyValuePair.serializeDelta} with `prevType = 0n`.
68
- * @returns The serialized buffer.
69
- */
70
- serialize(): FrozenByteBuffer;
71
- /**
72
- * Serializes this pair's wire form, encoding the Type as a delta from
73
- * `prevType` (the type of the previous KVP in the same list, or 0n if this
74
- * is the first entry).
75
- * @param prevType - The type of the previous KVP in the same list.
76
- * @throws ProtocolViolationError if this pair's type is less than prevType
77
- * (Delta Type is an unsigned varint, so the list must be sorted ascending).
78
- */
79
- serializeDelta(prevType: bigint): FrozenByteBuffer;
80
- /**
81
- * Deserializes a KeyValuePair from a buffer.
82
- * Equivalent to {@link KeyValuePair.deserializeDelta} with `prevType = 0n`.
83
- * @param buf - The buffer to read from.
84
- * @returns The deserialized KeyValuePair.
85
- * @throws LengthExceedsMaxError if blob length exceeds 65535 bytes.
86
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
87
- */
88
- static deserialize(buf: BaseByteBuffer): KeyValuePair;
89
- /**
90
- * Deserializes a wire-form KVP whose Type field is a delta from `prevType`
91
- * (the type of the previous KVP in the same list, or 0n if this is the
92
- * first entry).
93
- * @param buf - The buffer to read from.
94
- * @param prevType - The type of the previous KVP in the same list.
95
- * @throws ProtocolViolationError if prevType + delta exceeds 2^64 - 1.
96
- */
97
- static deserializeDelta(buf: BaseByteBuffer, prevType: bigint): KeyValuePair;
98
- /**
99
- * Reads a value whose Type has already been decoded, applying the parity
100
- * rule. Callers in a type namespace where a Type uses a different encoding
101
- * read that value themselves and do not call this.
102
- * @param buf - The buffer to read from.
103
- * @param typeValue - The already-decoded Type.
104
- */
105
- static deserializeValue(buf: BaseByteBuffer, typeValue: bigint): KeyValuePair;
106
- /**
107
- * Reads a length-prefixed byte-string Value, independent of Type parity.
108
- * @param buf - The buffer to read from.
109
- * @param typeValue - The already-decoded Type.
110
- * @throws LengthExceedsMaxError if the length exceeds 65535 bytes.
111
- */
112
- static deserializeBytesValue(buf: BaseByteBuffer, typeValue: bigint): KeyValuePair;
113
- /**
114
- * Checks if this pair is equal to another.
115
- * @param other - The other KeyValuePair.
116
- * @returns True if both type and value are equal.
117
- */
118
- equals(other: KeyValuePair): boolean;
119
- }
120
- /**
121
- * Delta-encodes and serializes a list of Key-Value-Pairs to wire bytes.
122
- * The list is sorted by ascending type first, since Delta Type is an
123
- * unsigned varint and cannot represent a type decrease.
124
- */
125
- declare function serializeKvpList(items: KeyValuePair[]): FrozenByteBuffer;
126
- /**
127
- * Reads exactly `count` delta-encoded Key-Value-Pairs from `buf`.
128
- */
129
- declare function deserializeKvpList(buf: BaseByteBuffer, count: number | bigint): KeyValuePair[];
130
- /**
131
- * Reads delta-encoded Key-Value-Pairs from `buf` until it is exhausted.
132
- */
133
- declare function deserializeKvpListUntilEmpty(buf: BaseByteBuffer): KeyValuePair[];
134
- /**
135
- * Checks if the KeyValuePair carries a varint value.
136
- * @param pair - The KeyValuePair to check.
137
- * @returns True if value is a varint.
138
- */
139
- declare function isVarInt(pair: KeyValuePair): pair is KeyValuePair & {
140
- value: bigint;
141
- };
142
- /**
143
- * Checks if the KeyValuePair carries a blob value.
144
- * @param pair - The KeyValuePair to check.
145
- * @returns True if value is a Uint8Array.
146
- */
147
- declare function isBytes(pair: KeyValuePair): pair is KeyValuePair & {
148
- value: Uint8Array;
149
- };
150
- //#endregion
151
- //#region src/model/common/location.d.ts
152
- /**
153
- * @public
154
- * Represents a position in a MOQT track, consisting of a group and object index.
155
- *
156
- * Used for specifying start/end positions in subscription and fetch requests.
157
- * - `group`: The group index (e.g. segment, GOP, or logical group).
158
- * - `object`: The object index within the group (e.g. frame, chunk).
159
- */
160
- declare class Location {
161
- /**
162
- * The group index for this location.
163
- */
164
- readonly group: bigint;
165
- /**
166
- * The object index within the group for this location.
167
- */
168
- readonly object: bigint;
169
- /**
170
- * Constructs a new Location.
171
- * @param group - The group index (number or bigint).
172
- * @param object - The object index (number or bigint).
173
- */
174
- constructor(group: bigint | number, object: bigint | number);
175
- /**
176
- * Serializes this Location to a FrozenByteBuffer.
177
- * @returns The serialized buffer.
178
- * @throws CastingError if group or object is negative.
179
- * @throws VarIntOverflowError if group or object exceeds varint encoding limits.
180
- */
181
- serialize(): FrozenByteBuffer;
182
- /**
183
- * Deserializes a Location from a buffer.
184
- * @param buf - The buffer to read from.
185
- * @returns The deserialized Location.
186
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
187
- */
188
- static deserialize(buf: BaseByteBuffer): Location;
189
- /**
190
- * Checks if this Location is equal to another.
191
- * @param other - The other Location to compare.
192
- * @returns True if both group and object are equal.
193
- */
194
- equals(other: Location): boolean;
195
- /**
196
- * Compares this Location to another for ordering.
197
- * @param other - The other Location to compare.
198
- * @returns -1 if this \< other, 1 if this \> other, 0 if equal.
199
- */
200
- compare(other: Location): number;
201
- }
202
- //#endregion
203
- //#region src/model/common/tuple.d.ts
204
- /**
205
- * @public
206
- * Represents a single field in a Tuple, storing a value as a UTF-8 encoded byte array.
207
- *
208
- * Used for path segments or protocol fields in MOQT.
209
- */
210
- declare class TupleField {
211
- readonly value: Uint8Array;
212
- /**
213
- * The raw value of the field as a byte array.
214
- */
215
- constructor(value: Uint8Array);
216
- /**
217
- * Creates a TupleField from a UTF-8 string.
218
- * @param str - The string to encode.
219
- * @returns A new TupleField containing the encoded value.
220
- */
221
- static fromUtf8(str: string): TupleField;
222
- /**
223
- * Decodes the field value to a UTF-8 string.
224
- * @returns The decoded string.
225
- */
226
- toUtf8(): string;
227
- /**
228
- * Serializes this field to a length-prefixed byte array.
229
- * @returns The serialized bytes.
230
- */
231
- serialize(): Uint8Array;
232
- /**
233
- * Deserializes a TupleField from a buffer.
234
- * @param buf - The buffer to read from.
235
- * @returns The deserialized TupleField.
236
- * @throws CastingError if the length cannot be safely cast to number.
237
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
238
- */
239
- static deserialize(buf: BaseByteBuffer): TupleField;
240
- }
241
- /**
242
- * @public
243
- * Represents a sequence of TupleFields, typically used for hierarchical paths or protocol tuples in MOQT.
244
- */
245
- declare class Tuple {
246
- readonly fields: TupleField[];
247
- /**
248
- * The ordered list of fields in this tuple.
249
- */
250
- constructor(fields?: TupleField[]);
251
- /**
252
- * Creates a Tuple from a path string, splitting on '/'.
253
- * @param path - The path string (e.g. '/foo/bar').
254
- * @returns A Tuple with each segment as a field.
255
- */
256
- static fromUtf8Path(path: string): Tuple;
257
- /**
258
- * Converts the tuple to a path string, joining fields with '/'.
259
- * @returns The path string (e.g. '/foo/bar').
260
- */
261
- toUtf8Path(): string;
262
- /**
263
- * Adds a field to the tuple.
264
- * @param field - The TupleField to add.
265
- */
266
- add(field: TupleField): void;
267
- /**
268
- * Gets the field at the specified index.
269
- * @param index - The field index.
270
- * @returns The TupleField at the index.
271
- * @throws Error if no field exists at the index.
272
- */
273
- get(index: number): TupleField;
274
- /**
275
- * Sets the field at the specified index.
276
- * @param index - The field index.
277
- * @param field - The TupleField to set.
278
- */
279
- set(index: number, field: TupleField): void;
280
- /**
281
- * Clears all fields from the tuple.
282
- */
283
- clear(): void;
284
- /**
285
- * Serializes the tuple to a FrozenByteBuffer.
286
- * @returns The serialized buffer.
287
- */
288
- serialize(): FrozenByteBuffer;
289
- /**
290
- * Deserializes a Tuple from a buffer.
291
- * @param buf - The buffer to read from.
292
- * @returns The deserialized Tuple.
293
- * @throws CastingError if the count cannot be safely cast to number.
294
- * @throws NotEnoughBytesError if buffer does not contain enough bytes.
295
- */
296
- static deserialize(buf: BaseByteBuffer): Tuple;
297
- /**
298
- * Checks if this tuple is equal to another.
299
- * @param other - The other Tuple to compare.
300
- * @returns True if all fields are equal.
301
- */
302
- equals(other: Tuple): boolean;
303
- }
304
- //#endregion
305
- //#region src/model/common/reason_phrase.d.ts
306
- /**
307
- * The maximum allowed length (in bytes) for a ReasonPhrase.
308
- * @public
309
- */
310
- declare const MAX_REASON_PHRASE_LEN = 1024;
311
- /**
312
- * Represents a protocol ReasonPhrase, a short UTF-8 string used for error or status reporting.
313
- * Enforces a maximum byte length and validates encoding.
314
- *
315
- * @public
316
- */
317
- declare class ReasonPhrase {
318
- #private;
319
- /**
320
- * Constructs a ReasonPhrase, validating UTF-8 encoding and length.
321
- *
322
- * @param phrase - The string to use as the reason phrase.
323
- * @throws {@link InvalidUTF8Error} if encoding fails.
324
- * @throws {@link LengthExceedsMaxError} if the encoded phrase exceeds {@link MAX_REASON_PHRASE_LEN} bytes.
325
- * @public
326
- */
327
- constructor(phrase: string);
328
- /**
329
- * Returns the phrase string.
330
- * @public
331
- */
332
- get phrase(): string;
333
- /**
334
- * Serializes the ReasonPhrase into a {@link FrozenByteBuffer} containing:
335
- * varint(length_of_phrase_bytes) || phrase_bytes
336
- *
337
- * @returns The serialized buffer.
338
- * @public
339
- */
340
- serialize(): FrozenByteBuffer;
341
- /**
342
- * Deserializes a ReasonPhrase from the given buffer.
343
- * Reads varint(length) || utf8‑bytes.
344
- *
345
- * @param buf - The buffer to read from.
346
- * @returns The deserialized ReasonPhrase.
347
- * @throws :{@link CastingError} if the length cannot be safely cast to a number.
348
- * @throws :{@link LengthExceedsMaxError} if the length exceeds {@link MAX_REASON_PHRASE_LEN}.
349
- * @throws :{@link NotEnoughBytesError} if the buffer does not contain enough bytes.
350
- * @throws :{@link InvalidUTF8Error} if decoding fails.
351
- * @public
352
- */
353
- static deserialize(buf: BaseByteBuffer): ReasonPhrase;
354
- }
355
- //#endregion
356
- //#region src/model/data/constant.d.ts
357
- /**
358
- * Copyright 2025 The MOQtail Authors
359
- *
360
- * Licensed under the Apache License, Version 2.0 (the "License");
361
- * you may not use this file except in compliance with the License.
362
- * You may obtain a copy of the License at
363
- *
364
- * http://www.apache.org/licenses/LICENSE-2.0
365
- *
366
- * Unless required by applicable law or agreed to in writing, software
367
- * distributed under the License is distributed on an "AS IS" BASIS,
368
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
369
- * See the License for the specific language governing permissions and
370
- * limitations under the License.
371
- */
372
- /**
373
- * @public
374
- * Object datagram types for MOQT objects.
375
- *
376
- * Type bit layout (form 0b00X0XXXX):
377
- * - Bit 0 (0x01): PROPERTIES - Properties field present
378
- * - Bit 1 (0x02): END_OF_GROUP - Last object in group
379
- * - Bit 2 (0x04): ZERO_OBJECT_ID - Object ID omitted (assumed 0)
380
- * - Bit 3 (0x08): DEFAULT_PRIORITY - Publisher Priority omitted (inherited)
381
- * - Bit 5 (0x20): STATUS - Object Status replaces Object Payload
382
- *
383
- * Invalid combinations:
384
- * - STATUS (0x20) + END_OF_GROUP (0x02) together is a PROTOCOL_VIOLATION
385
- * - Types outside the form 0b00X0XXXX are invalid
386
- */
387
- declare enum ObjectDatagramType {
388
- Type0x00 = 0,
389
- Type0x01 = 1,
390
- Type0x02 = 2,
391
- Type0x03 = 3,
392
- Type0x04 = 4,
393
- Type0x05 = 5,
394
- Type0x06 = 6,
395
- Type0x07 = 7,
396
- Type0x08 = 8,
397
- Type0x09 = 9,
398
- Type0x0A = 10,
399
- Type0x0B = 11,
400
- Type0x0C = 12,
401
- Type0x0D = 13,
402
- Type0x0E = 14,
403
- Type0x0F = 15,
404
- Type0x20 = 32,
405
- Type0x21 = 33,
406
- Type0x24 = 36,
407
- Type0x25 = 37,
408
- Type0x28 = 40,
409
- Type0x29 = 41,
410
- Type0x2C = 44,
411
- Type0x2D = 45
412
- }
413
- /**
414
- * @public
415
- * Namespace for ObjectDatagramType utilities.
416
- */
417
- declare namespace ObjectDatagramType {
418
- /** Properties field present (bit 0). */
419
- const PROPERTIES = 1;
420
- /** Last object in the group (bit 1). */
421
- const END_OF_GROUP = 2;
422
- /** Object ID omitted, taken as 0 (bit 2). */
423
- const ZERO_OBJECT_ID = 4;
424
- /** Publisher Priority omitted, taken from the subscription (bit 3). */
425
- const DEFAULT_PRIORITY = 8;
426
- /** Carries an object status rather than a payload (bit 5). */
427
- const STATUS = 32;
428
- /** Mask for bits that must be zero: bits 4, 6, 7 (form `0b00X0XXXX`). */
429
- const INVALID_BITS_MASK = 208;
430
- /**
431
- * Converts a number or bigint to ObjectDatagramType.
432
- * Validates using bitmask: must match form 0b00X0XXXX,
433
- * and STATUS + END_OF_GROUP cannot both be set.
434
- * @param value - The value to convert.
435
- * @returns The corresponding ObjectDatagramType.
436
- * @throws Error if the value is not valid.
437
- */
438
- function tryFrom(value: number | bigint): ObjectDatagramType;
439
- /**
440
- * Returns true if the type has properties (bit 0 set).
441
- * @param t - The ObjectDatagramType.
442
- */
443
- function hasProperties(t: ObjectDatagramType): boolean;
444
- /**
445
- * Returns true if the type indicates End of Group (bit 1 set).
446
- * @param t - The ObjectDatagramType.
447
- */
448
- function isEndOfGroup(t: ObjectDatagramType): boolean;
449
- /**
450
- * Returns true if Object ID is absent (bit 2 set).
451
- * When true, Object ID is omitted and assumed to be 0.
452
- * @param t - The ObjectDatagramType.
453
- */
454
- function isZeroObjectId(t: ObjectDatagramType): boolean;
455
- /**
456
- * Returns true if Publisher Priority is omitted (bit 3 set).
457
- * When true, the priority is inherited from the control message.
458
- * @param t - The ObjectDatagramType.
459
- */
460
- function hasDefaultPriority(t: ObjectDatagramType): boolean;
461
- /**
462
- * Returns true if the datagram carries Object Status instead of payload (bit 5 set).
463
- * @param t - The ObjectDatagramType.
464
- */
465
- function isStatus(t: ObjectDatagramType): boolean;
466
- /**
467
- * Determines the appropriate type for given properties.
468
- * @param hasProperties - Whether properties are present.
469
- * @param endOfGroup - Whether this is the last object in the group.
470
- * @param objectIdIsZero - Whether the objectId is 0.
471
- * @param defaultPriority - Whether publisher priority is inherited (omitted).
472
- * @param isStatus - Whether the datagram carries status instead of payload.
473
- * @throws Error if STATUS and END_OF_GROUP are both true (PROTOCOL_VIOLATION).
474
- */
475
- function fromProperties(hasProperties: boolean, endOfGroup: boolean, objectIdIsZero: boolean, defaultPriority: boolean, isStatus: boolean): ObjectDatagramType;
476
- }
477
- /**
478
- * @public
479
- * Fetch header types for MOQT fetch requests.
480
- */
481
- declare enum FetchHeaderType {
482
- Type0x05 = 5
483
- }
484
- /**
485
- * Namespace for FetchHeaderType utilities.
486
- */
487
- declare namespace FetchHeaderType {
488
- /**
489
- * Converts a number or bigint to FetchHeaderType.
490
- * @param value - The value to convert.
491
- * @returns The corresponding FetchHeaderType.
492
- * @throws Error if the value is not valid.
493
- */
494
- function tryFrom(value: number | bigint): FetchHeaderType;
495
- }
496
- /**
497
- * @public
498
- * Subgroup header types for MOQT subgroups.
499
- *
500
- * Type bit layout (0b0XX1XXXX):
501
- * - Bit 0 (0x01): PROPERTIES - Properties present in all objects
502
- * - Bits 1-2 (0x06): SUBGROUP_ID_MODE - How subgroup ID is encoded (0b00=zero, 0b01=firstObjId, 0b10=explicit, 0b11=invalid)
503
- * - Bit 3 (0x08): END_OF_GROUP - This subgroup contains the final object in the group
504
- * - Bit 4 (0x10): Always set (distinguishes subgroup from other header types)
505
- * - Bit 5 (0x20): DEFAULT_PRIORITY - Publisher priority field omitted, inherited from subscription
506
- * - Bit 6 (0x40): FIRST_OBJECT - The first object on this stream is the first the original
507
- * publisher published in the subgroup
508
- * - Bit 7 (0x80): Must be zero
509
- *
510
- * Valid ranges: 0x10-0x15, 0x18-0x1D, 0x30-0x35, 0x38-0x3D, 0x50-0x55, 0x58-0x5D, 0x70-0x75, 0x78-0x7D
511
- * Invalid: 0x16, 0x17, 0x1E, 0x1F, 0x36, 0x37, 0x3E, 0x3F, 0x56, 0x57, 0x5E, 0x5F, 0x76, 0x77, 0x7E,
512
- * 0x7F (SUBGROUP_ID_MODE=0b11)
513
- */
514
- declare enum SubgroupHeaderType {
515
- Type0x10 = 16,
516
- Type0x11 = 17,
517
- Type0x12 = 18,
518
- Type0x13 = 19,
519
- Type0x14 = 20,
520
- Type0x15 = 21,
521
- Type0x18 = 24,
522
- Type0x19 = 25,
523
- Type0x1A = 26,
524
- Type0x1B = 27,
525
- Type0x1C = 28,
526
- Type0x1D = 29,
527
- Type0x30 = 48,
528
- Type0x31 = 49,
529
- Type0x32 = 50,
530
- Type0x33 = 51,
531
- Type0x34 = 52,
532
- Type0x35 = 53,
533
- Type0x38 = 56,
534
- Type0x39 = 57,
535
- Type0x3A = 58,
536
- Type0x3B = 59,
537
- Type0x3C = 60,
538
- Type0x3D = 61,
539
- Type0x50 = 80,
540
- Type0x51 = 81,
541
- Type0x52 = 82,
542
- Type0x53 = 83,
543
- Type0x54 = 84,
544
- Type0x55 = 85,
545
- Type0x58 = 88,
546
- Type0x59 = 89,
547
- Type0x5A = 90,
548
- Type0x5B = 91,
549
- Type0x5C = 92,
550
- Type0x5D = 93,
551
- Type0x70 = 112,
552
- Type0x71 = 113,
553
- Type0x72 = 114,
554
- Type0x73 = 115,
555
- Type0x74 = 116,
556
- Type0x75 = 117,
557
- Type0x78 = 120,
558
- Type0x79 = 121,
559
- Type0x7A = 122,
560
- Type0x7B = 123,
561
- Type0x7C = 124,
562
- Type0x7D = 125
563
- }
564
- /**
565
- * Namespace for SubgroupHeaderType utilities and bit constants.
566
- */
567
- /**
568
- * @public
569
- * The Publisher Priority to assume where a header omits the field, having set its
570
- * DEFAULT_PRIORITY bit. A track may name its own with the DEFAULT_PUBLISHER_PRIORITY
571
- * track property; this is the value for one that does not. Priority runs from 0 (most
572
- * important) to 255, so a wrong default here is not a small error: 0 makes every such
573
- * object outrank all others.
574
- */
575
- declare const DEFAULT_PUBLISHER_PRIORITY = 128;
576
- declare namespace SubgroupHeaderType {
577
- /** Properties present in all objects (bit 0) */
578
- const PROPERTIES = 1;
579
- /** Mask for SUBGROUP_ID_MODE (bits 1-2) */
580
- const SUBGROUP_ID_MODE_MASK = 6;
581
- /** This subgroup contains the final object in the group (bit 3) */
582
- const END_OF_GROUP = 8;
583
- /** Required bit that must always be set (bit 4) */
584
- const REQUIRED_BIT = 16;
585
- /** Publisher priority field omitted, inherited from subscription (bit 5) */
586
- const DEFAULT_PRIORITY = 32;
587
- /** First object on this stream is the first published in the subgroup (bit 6) */
588
- const FIRST_OBJECT = 64;
589
- /** Mask for bits that must be zero: bit 7 only */
590
- const INVALID_BITS_MASK = 128;
591
- function hasProperties(t: SubgroupHeaderType): boolean;
592
- function hasExplicitSubgroupId(t: SubgroupHeaderType): boolean;
593
- function isSubgroupIdZero(t: SubgroupHeaderType): boolean;
594
- function isSubgroupIdFirstObjectId(t: SubgroupHeaderType): boolean;
595
- function containsEndOfGroup(t: SubgroupHeaderType): boolean;
596
- function hasDefaultPriority(t: SubgroupHeaderType): boolean;
597
- function isFirstObject(t: SubgroupHeaderType): boolean;
598
- /**
599
- * Converts a number or bigint to SubgroupHeaderType.
600
- * Validates bit 7 must be zero, bit 4 must be set, SUBGROUP_ID_MODE must not be 0b11.
601
- */
602
- function tryFrom(value: number | bigint): SubgroupHeaderType;
603
- /**
604
- * Determines the appropriate type for given properties.
605
- * @param subgroupIdMode - SUBGROUP_ID_MODE (0=zero, 1=firstObjId, 2=explicit).
606
- * @param firstObject - Whether the first object on the stream is the first the original
607
- * publisher published in the subgroup.
608
- */
609
- function fromProperties(hasProperties: boolean, subgroupIdMode: 0 | 1 | 2, containsEndOfGroup: boolean, hasDefaultPriority?: boolean, firstObject?: boolean): SubgroupHeaderType;
610
- }
611
- /**
612
- * @public
613
- * Publisher's preferred object delivery mechanism for a track.
614
- * - `Subgroup`: Use ordered subgroups (reliable).
615
- * - `Datagram`: Use unreliable datagrams when feasible.
616
- *
617
- * The preference is advisory: the relay/transport layer MAY override based on negotiated capabilities.
618
- */
619
- declare enum ObjectForwardingPreference {
620
- Subgroup = "Subgroup",
621
- Datagram = "Datagram"
622
- }
623
- /**
624
- * Namespace for ObjectForwardingPreference utilities.
625
- */
626
- declare namespace ObjectForwardingPreference {
627
- /**
628
- * Converts a number, bigint, or string to ObjectForwardingPreference.
629
- * @param value - The value to convert.
630
- * @returns The corresponding ObjectForwardingPreference.
631
- * @throws Error if the value is not valid.
632
- */
633
- function tryFrom(value: number | bigint | string): ObjectForwardingPreference;
634
- }
635
- /**
636
- * @public
637
- * Object status codes for MOQT objects.
638
- * - `Normal`: Object exists and is available.
639
- * - `EndOfGroup`: End of group marker.
640
- * - `EndOfTrack`: End of track marker.
641
- */
642
- declare enum ObjectStatus {
643
- Normal = 0,
644
- EndOfGroup = 3,
645
- EndOfTrack = 4
646
- }
647
- /**
648
- * Namespace for ObjectStatus utilities.
649
- */
650
- declare namespace ObjectStatus {
651
- /**
652
- * Converts a number or bigint to ObjectStatus.
653
- * @param value - The value to convert.
654
- * @returns The corresponding ObjectStatus.
655
- * @throws Error if the value is not valid.
656
- */
657
- function tryFrom(value: number | bigint): ObjectStatus;
658
- }
659
- //#endregion
660
- //#region src/model/data/datagram.d.ts
661
- /**
662
- * Represents a unified OBJECT_DATAGRAM message.
663
- *
664
- * Type bit layout (form 0b00X0XXXX):
665
- * - Bit 0 (0x01): PROPERTIES
666
- * - Bit 1 (0x02): END_OF_GROUP
667
- * - Bit 2 (0x04): ZERO_OBJECT_ID
668
- * - Bit 3 (0x08): DEFAULT_PRIORITY
669
- * - Bit 5 (0x20): STATUS
670
- */
671
- declare class Datagram {
672
- readonly type: ObjectDatagramType;
673
- readonly publisherPriority: number | null;
674
- readonly properties: KeyValuePair[] | null;
675
- readonly payload: Uint8Array | null;
676
- readonly objectStatus: ObjectStatus | null;
677
- readonly endOfGroup: boolean;
678
- readonly trackAlias: bigint;
679
- readonly location: Location;
680
- private constructor();
681
- get groupId(): bigint;
682
- get objectId(): bigint;
683
- /**
684
- * Create a new Datagram with payload content.
685
- * The type is automatically determined based on the properties.
686
- */
687
- static newPayload(trackAlias: bigint, groupId: bigint, objectId: bigint, publisherPriority: number | null, properties: KeyValuePair[] | null, payload: Uint8Array, endOfGroup?: boolean): Datagram;
688
- /**
689
- * Create a new Datagram with Object Status (no payload).
690
- * endOfGroup is always false since STATUS + END_OF_GROUP is invalid.
691
- */
692
- static newStatus(trackAlias: bigint, groupId: bigint, objectId: bigint, publisherPriority: number | null, properties: KeyValuePair[] | null, objectStatus: ObjectStatus): Datagram;
693
- serialize(): FrozenByteBuffer;
694
- static deserialize(buf: BaseByteBuffer): Datagram;
695
- }
696
- //#endregion
697
- //#region src/model/data/fetch_header.d.ts
698
- declare class FetchHeader {
699
- readonly type: FetchHeaderType;
700
- readonly requestId: bigint;
701
- constructor(type: FetchHeaderType, requestId: bigint | number);
702
- serialize(): FrozenByteBuffer;
703
- static deserialize(buf: BaseByteBuffer): FetchHeader;
704
- }
705
- //#endregion
706
- //#region src/model/control/constant.d.ts
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
- * Protocol string array exchanged in wt-available-protocols header
724
- */
725
- declare const SUPPORTED_VERSIONS: string[];
726
- /**
727
- * @public
728
- * Control message types.
729
- */
730
- declare enum ControlMessageType {
731
- ReservedSetupV00 = 1,
732
- // RESERVED; rejected by tryFrom
733
- ReservedClientSetupV10 = 64,
734
- // RESERVED; rejected by tryFrom
735
- ReservedServerSetupV10 = 65,
736
- // RESERVED; rejected by tryFrom
737
- ReservedClientSetupV16 = 32,
738
- // RESERVED; rejected by tryFrom
739
- ReservedServerSetupV16 = 33,
740
- // RESERVED; rejected by tryFrom
741
- Setup = 12032,
742
- // Control
743
- GoAway = 16,
744
- // Control, Request
745
- Subscribe = 3,
746
- // Request, First
747
- SubscribeOk = 4,
748
- // Request
749
- RequestError = 5,
750
- // Request
751
- RequestUpdate = 2,
752
- // Request
753
- PublishDone = 11,
754
- // Request
755
- Fetch = 22,
756
- // Request, First
757
- FetchOk = 24,
758
- // Request
759
- TrackStatus = 13,
760
- // Request, First
761
- PublishNamespace = 6,
762
- // Request, First
763
- RequestOk = 7,
764
- // Request
765
- Namespace = 8,
766
- // Request
767
- NamespaceDone = 14,
768
- // Request
769
- SubscribeNamespace = 80,
770
- // Request, First
771
- SubscribeTracks = 81,
772
- // Request, First
773
- Publish = 29,
774
- // Request, First
775
- PublishOk = 30,
776
- // Request; an alias of RequestOk (§10.5), not its own body
777
- PublishSkipped = 15
778
- }
779
- /**
780
- * Converts a bigint value to a ControlMessageType enum.
781
- * @param v - The bigint value.
782
- * @returns The corresponding ControlMessageType.
783
- * @throws InvalidEnumValue if the value is not a valid control message type.
784
- */
785
- declare namespace ControlMessageType {
786
- /**
787
- * True for the seven types marked `First` in Table 5: each one MUST be the first
788
- * message on a new bidirectional request stream, and no other type may open one.
789
- * Every remaining type travels on the control stream or on an already-open request
790
- * stream.
791
- */
792
- function isFirst(t: ControlMessageType): boolean;
793
- /**
794
- * True for the six request types §10.9 lets a REQUEST_UPDATE modify. TRACK_STATUS
795
- * opens a request stream but is not one of them, so an update on its stream is
796
- * refused with a REQUEST_ERROR.
797
- */
798
- function isUpdatable(t: ControlMessageType): boolean;
799
- /** Convert bigint discriminant to enum value or throw on invalid. */
800
- function tryFrom(v: bigint): ControlMessageType;
801
- }
802
- /**
803
- * @public
804
- * Which fields of a LOCATION_FILTER follow its type, and how they are read.
805
- */
806
- declare enum LocationFilterType {
807
- /** No filter: every Object passes. */
808
- None = 0,
809
- /** Starts StartGroup groups before the Next Group. */
810
- RelativeStart = 1,
811
- AbsoluteStart = 2,
812
- /** Ends with the last Object of the End Group. */
813
- AbsoluteStartGroupEnd = 3,
814
- /** Ends with End Object of the End Group. */
815
- AbsoluteRange = 4,
816
- /** Starts at the Object after the Largest Object. */
817
- NextObject = 5
818
- }
819
- /**
820
- * Converts a bigint value to a LocationFilterType enum.
821
- * @param v - The bigint value.
822
- * @returns The corresponding LocationFilterType.
823
- * @throws InvalidEnumValue if the value is not a valid Location Filter Type.
824
- */
825
- declare namespace LocationFilterType {
826
- function tryFrom(v: bigint): LocationFilterType;
827
- }
828
- /**
829
- * @public
830
- * Switch modes for subscription switching requests.
831
- */
832
- declare enum SwitchMode {
833
- Hard = 0,
834
- Soft = 1
835
- }
836
- /**
837
- * @public
838
- * Group ordering options for object delivery.
839
- */
840
- declare enum GroupOrder {
841
- Original = 0,
842
- Ascending = 1,
843
- Descending = 2
844
- }
845
- /**
846
- * Converts a number value to a GroupOrder enum.
847
- * @param v - The number value.
848
- * @returns The corresponding GroupOrder.
849
- * @throws InvalidEnumValue if the value is not a valid group order.
850
- */
851
- declare namespace GroupOrder {
852
- function tryFrom(v: number): GroupOrder;
853
- }
854
- /**
855
- * @public
856
- * Status codes for track status responses.
857
- */
858
- declare enum TrackStatusCode {
859
- InProgress = 0,
860
- DoesNotExist = 1,
861
- NotYetBegun = 2,
862
- Finished = 3,
863
- RelayUnavailable = 4
864
- }
865
- /**
866
- * Converts a bigint value to a TrackStatusCode enum.
867
- * @param v - The bigint value.
868
- * @returns The corresponding TrackStatusCode.
869
- * @throws InvalidEnumValue if the value is not a valid track status code.
870
- */
871
- declare namespace TrackStatusCode {
872
- function tryFrom(v: bigint): TrackStatusCode;
873
- }
874
- /**
875
- * @public
876
- * Status codes for PublishDone control messages.
877
- */
878
- declare enum PublishDoneStatusCode {
879
- InternalError = 0,
880
- Unauthorized = 1,
881
- TrackEnded = 2,
882
- GoingAway = 4,
883
- TooFarBehind = 5,
884
- Expired = 6,
885
- UpdateFailed = 8,
886
- ExcessiveLoad = 9,
887
- MalformedTrack = 18
888
- }
889
- /**
890
- * Converts a bigint value to a PublishDoneStatusCode enum.
891
- * @param v - The bigint value.
892
- * @returns The corresponding PublishDoneStatusCode.
893
- * @throws InvalidEnumValue if the value is not a valid subscribe done status code.
894
- */
895
- declare namespace PublishDoneStatusCode {
896
- function tryFrom(v: bigint): PublishDoneStatusCode;
897
- /**
898
- * Maps a received status code to a known variant, treating any unknown value
899
- * (including GREASE) as InternalError. An unknown code is never fatal.
900
- */
901
- function fromWire(v: bigint): PublishDoneStatusCode;
902
- }
903
- /**
904
- * @public
905
- * Unified error codes for REQUEST_ERROR control messages.
906
- *
907
- * A separate registry from {@link (StreamResetCode:enum)}, which disagrees with it on
908
- * the same names: `GOING_AWAY` is `0x6` here but `0x4` as a stream reset code.
909
- */
910
- declare enum RequestErrorCode {
911
- InternalError = 0,
912
- Unauthorized = 1,
913
- Timeout = 2,
914
- NotSupported = 3,
915
- MalformedAuthToken = 4,
916
- ExpiredAuthToken = 5,
917
- GoingAway = 6,
918
- ExcessiveLoad = 9,
919
- DoesNotExist = 16,
920
- InvalidRange = 17,
921
- MalformedTrack = 18,
922
- Uninterested = 32,
923
- PrefixOverlap = 48,
924
- NamespaceTooLarge = 49,
925
- InvalidSwitch = 50,
926
- UnsupportedExtension = 51,
927
- Redirect = 52,
928
- ConflictingFilters = 53,
929
- InvalidFilter = 54
930
- }
931
- /**
932
- * Converts a bigint value to a RequestErrorCode enum.
933
- * @param v - The bigint value.
934
- * @returns The corresponding RequestErrorCode.
935
- * @throws InvalidEnumValue if the value is not a valid request error code.
936
- */
937
- declare namespace RequestErrorCode {
938
- function tryFrom(v: bigint): RequestErrorCode;
939
- /**
940
- * Maps a received error code to a known variant, treating any unknown value
941
- * (including GREASE) as InternalError. An unknown error code is never fatal and
942
- * never closes the session.
943
- */
944
- function fromWire(v: bigint): RequestErrorCode;
945
- }
946
- //#endregion
947
- //#region src/model/data/fetch_object.d.ts
948
- /**
949
- * The prior Object a Fetch Object is encoded against: each one is written as
950
- * differences from it.
951
- */
952
- type FetchObjectContext = {
953
- groupId: bigint;
954
- /**
955
- * Null while the stream has carried only End of Range markers and no Object yet:
956
- * a marker sets the prior Group and Object IDs, but has no Subgroup ID.
957
- */
958
- subgroupId: bigint | null;
959
- objectId: bigint;
960
- /**
961
- * Null while the stream has carried only End of Range markers and no Object yet:
962
- * a marker has no priority.
963
- */
964
- publisherPriority: number | null;
965
- };
966
- /**
967
- * Kind discriminator for End-of-Range markers.
968
- */
969
- declare enum EndOfRangeKind {
970
- /** Serialization Flags = 0x8C: all objects in the range are known not to exist. */
971
- NonExistent = 140,
972
- /** Serialization Flags = 0x10C: the range is cache-unknown. */
973
- Unknown = 268,
974
- /**
975
- * Serialization Flags = 0x20C: the range timed out, e.g. a relay ran out of its
976
- * fill budget before it could retrieve it.
977
- */
978
- TimedOut = 524
979
- }
980
- /**
981
- * Payload-bearing fetch object (§11.5, non-End-of-Range form).
982
- *
983
- * FETCH objects carry no Object Status field; a zero-length payload
984
- * signals a zero-length Normal object.
985
- */
986
- declare class FetchObject {
987
- readonly kind: 'object' | 'end_of_range';
988
- readonly publisherPriority: number;
989
- readonly forwardingPreference: ObjectForwardingPreference;
990
- readonly properties: KeyValuePair[] | null;
991
- readonly payload: Uint8Array | null;
992
- readonly endOfRange: EndOfRangeKind | null;
993
- readonly location: Location;
994
- readonly subgroupId: bigint;
995
- private constructor();
996
- get groupId(): bigint;
997
- get objectId(): bigint;
998
- /**
999
- * What the entry after this one is encoded against, given what this one was
1000
- * encoded against (`prev`).
1001
- *
1002
- * After an Object, that is the Object itself. After an End of Range marker, it is
1003
- * the marker's Group and Object IDs, with the Subgroup ID and priority still those
1004
- * of the last Object before the marker, or none if no Object came before it.
1005
- */
1006
- nextContext(prev?: FetchObjectContext): FetchObjectContext;
1007
- static newObject(groupId: bigint | number, subgroupId: bigint | number, objectId: bigint | number, publisherPriority: number, forwardingPreference: ObjectForwardingPreference, properties: KeyValuePair[] | null, payload: Uint8Array): FetchObject;
1008
- static newEndOfRange(kind: EndOfRangeKind, groupId: bigint | number, objectId: bigint | number): FetchObject;
1009
- serialize(prev?: FetchObjectContext, groupOrder?: GroupOrder): FrozenByteBuffer;
1010
- static deserialize(buf: BaseByteBuffer, prev?: FetchObjectContext, groupOrder?: GroupOrder): FetchObject;
1011
- }
1012
- //#endregion
1013
- //#region src/model/data/full_track_name.d.ts
1014
- declare const MAX_NAMESPACE_TUPLE_COUNT = 32;
1015
- declare const MAX_FULL_TRACK_NAME_LENGTH = 4096;
1016
- /**
1017
- * Fully-qualified track identifier = hierarchical namespace (tuple) + leaf name bytes.
1018
- *
1019
- * Constraints enforced (throws {@link TrackNameError}):
1020
- * - Namespace tuple field count: 0 .. {@link MAX_NAMESPACE_TUPLE_COUNT} (an empty namespace is legal).
1021
- * - Total serialized length (namespace tuple + raw name bytes) less than or equals {@link MAX_FULL_TRACK_NAME_LENGTH} bytes.
1022
- *
1023
- * Namespace input may be:
1024
- * - `string` path with segments separated by `/` (converted via {@link Tuple.fromUtf8Path}). Empty segments are dropped,
1025
- * so `''` and `'/'` both yield a zero-element namespace.
1026
- * - Existing {@link Tuple} instance.
1027
- *
1028
- * Name input may be:
1029
- * - UTF-8 string (encoded)
1030
- * - Raw `Uint8Array` (used directly)
1031
- *
1032
- * Instances are created via {@link FullTrackName.tryNew} (validates) or {@link FullTrackName.deserialize}.
1033
- * Use {@link FullTrackName.serialize} for wire encoding and {@link FullTrackName.toString} for a human friendly
1034
- * diagnostic format: `namespace/segments:hexname` (name rendered as lowercase hex, no 0x prefix).
1035
- *
1036
- * The string form is intended for logs/debug only; do not parse it for protocol operations.
1037
- */
1038
- declare class FullTrackName {
1039
- readonly namespace: Tuple;
1040
- readonly name: Uint8Array;
1041
- private constructor();
1042
- /**
1043
- * Human-readable representation: `\<namespace path joined by '/'\>:\<name as lowercase hex\>`.
1044
- * If the underlying {@link Tuple} exposes `toUtf8Path`, it's used; otherwise the raw fields are joined.
1045
- * This is lossy only in the sense that name bytes are hex encoded; round-tripping requires serialization.
1046
- */
1047
- toString(): string;
1048
- /**
1049
- * Construct a validated full track name.
1050
- *
1051
- * Validation steps:
1052
- * 1. Convert namespace string -\> {@link Tuple} (split on '/') if needed.
1053
- * 2. Reject if namespace tuple field count is \> {@link MAX_NAMESPACE_TUPLE_COUNT}.
1054
- * 3. Encode name string to UTF-8 if needed.
1055
- * 4. Reject if total serialized length (namespace tuple + name bytes) \> {@link MAX_FULL_TRACK_NAME_LENGTH}.
1056
- *
1057
- * @throws :{@link TrackNameError} on any constraint violation.
1058
- * @example
1059
- * ```ts
1060
- * const full = FullTrackName.tryNew('media/video', 'keyframe')
1061
- * console.log(full.toString()) // media/video:6b65796672616d65
1062
- * ```
1063
- */
1064
- static tryNew(namespace: string | Tuple, name: string | Uint8Array): FullTrackName;
1065
- /**
1066
- * Serialize to a frozen buffer: tuple (namespace) followed by length‑prefixed name bytes.
1067
- * Consumers needing raw bytes should call `.toUint8Array()` on the returned {@link FrozenByteBuffer}.
1068
- */
1069
- serialize(): FrozenByteBuffer;
1070
- /**
1071
- * Parse a serialized full track name. Performs the same validations as {@link FullTrackName.tryNew}.
1072
- * The provided buffer's read cursor advances accordingly.
1073
- * @throws :{@link TrackNameError} if constraints are violated.
1074
- */
1075
- static deserialize(buf: BaseByteBuffer): FullTrackName;
1076
- }
1077
- //#endregion
1078
- //#region src/model/data/subgroup_object.d.ts
1079
- declare class SubgroupObject {
1080
- readonly properties: KeyValuePair[] | null;
1081
- readonly objectStatus: ObjectStatus | null;
1082
- readonly payload: Uint8Array | null;
1083
- readonly objectId: bigint;
1084
- private constructor();
1085
- static newWithStatus(objectId: bigint | number, properties: KeyValuePair[] | null, objectStatus: ObjectStatus): SubgroupObject;
1086
- static newWithPayload(objectId: bigint | number, properties: KeyValuePair[] | null, payload: Uint8Array): SubgroupObject;
1087
- serialize(previousObjectId: bigint | undefined): FrozenByteBuffer;
1088
- static deserialize(buf: BaseByteBuffer, hasProperties: boolean, previousObjectId: bigint | undefined): SubgroupObject;
1089
- }
1090
- //#endregion
1091
- //#region src/model/data/object.d.ts
1092
- declare class MoqtObject {
1093
- readonly fullTrackName: FullTrackName;
1094
- readonly publisherPriority: number;
1095
- readonly objectForwardingPreference: ObjectForwardingPreference;
1096
- readonly objectStatus: ObjectStatus;
1097
- readonly properties: KeyValuePair[] | null;
1098
- readonly payload: Uint8Array | null;
1099
- readonly location: Location;
1100
- readonly subgroupId: bigint | null;
1101
- private constructor();
1102
- get groupId(): bigint;
1103
- get objectId(): bigint;
1104
- getSubgroupHeaderType(containsEnd: boolean, useDefaultPriority?: boolean, firstObject?: boolean): SubgroupHeaderType;
1105
- isDatagram(): boolean;
1106
- isSubgroup(): boolean;
1107
- isEndOfGroup(): boolean;
1108
- isEndOfTrack(): boolean;
1109
- hasPayload(): boolean;
1110
- hasStatus(): boolean;
1111
- static newWithPayload(fullTrackName: FullTrackName, location: Location, publisherPriority: number, objectForwardingPreference: ObjectForwardingPreference, subgroupId: bigint | number | null, properties: KeyValuePair[] | null, payload: Uint8Array): MoqtObject;
1112
- static newWithStatus(fullTrackName: FullTrackName, location: Location, publisherPriority: number, objectForwardingPreference: ObjectForwardingPreference, subgroupId: bigint | number | null, properties: KeyValuePair[] | null, objectStatus: ObjectStatus): MoqtObject;
1113
- /**
1114
- * Create a MoqtObject from a Datagram.
1115
- * @param datagram - The received Datagram.
1116
- * @param fullTrackName - The resolved full track name.
1117
- * @param defaultPriority - The default publisher priority from the control message (used when DEFAULT_PRIORITY bit is set).
1118
- */
1119
- static fromDatagram(datagram: Datagram, fullTrackName: FullTrackName, defaultPriority?: number): MoqtObject;
1120
- /**
1121
- * Returns the endOfGroup flag from the source Datagram.
1122
- * This is separate from ObjectStatus.EndOfGroup - the flag indicates
1123
- * this is the last object in the group even with Normal status.
1124
- */
1125
- static isDatagramEndOfGroup(datagram: Datagram): boolean;
1126
- static fromFetchObject(fetchObject: FetchObject, fullTrackName: FullTrackName): MoqtObject;
1127
- static fromSubgroupObject(subgroupObject: SubgroupObject, groupId: bigint | number, publisherPriority: number | undefined, subgroupId: bigint | number | null, fullTrackName: FullTrackName): MoqtObject;
1128
- /**
1129
- * Convert to Datagram for wire transmission.
1130
- * Automatically creates a payload or status Datagram based on the object's state.
1131
- * @param trackAlias - The track alias to use.
1132
- * @param endOfGroup - Whether this is the last object in the group (only for payload datagrams).
1133
- * @param defaultPriority - If provided and matches this object's priority, the DEFAULT_PRIORITY bit is set.
1134
- */
1135
- tryIntoDatagram(trackAlias: bigint | number, endOfGroup?: boolean, defaultPriority?: number): Datagram;
1136
- tryIntoFetchObject(): FetchObject;
1137
- tryIntoSubgroupObject(): SubgroupObject;
1138
- }
1139
- //#endregion
1140
- //#region src/model/data/subgroup_header.d.ts
1141
- declare class SubgroupHeader {
1142
- readonly type: SubgroupHeaderType;
1143
- readonly publisherPriority: number | undefined;
1144
- /**
1145
- * Absent on the wire, and still unknown here, when the type says the Subgroup ID
1146
- * is the first Object ID: that object has not been read yet at header time.
1147
- * `resolveSubgroupId` fills it in, so consumers can read this rather than each
1148
- * deriving it again.
1149
- */
1150
- subgroupId: bigint | undefined;
1151
- readonly trackAlias: bigint;
1152
- readonly groupId: bigint;
1153
- constructor(type: SubgroupHeaderType, trackAlias: bigint | number, groupId: bigint | number, subgroupId: bigint | number | undefined, publisherPriority: number | undefined);
1154
- serialize(): FrozenByteBuffer;
1155
- static deserialize(buf: BaseByteBuffer): SubgroupHeader;
1156
- /**
1157
- * Name this subgroup from the first object read off its stream, for the header
1158
- * type that defers the Subgroup ID to it. Ignored for every other type, and for
1159
- * a header already named, so later objects on the stream cannot rename it.
1160
- */
1161
- resolveSubgroupId(firstObjectId: bigint): void;
1162
- }
1163
- //#endregion
1164
- //#region src/model/data/request_id.d.ts
1165
- /**
1166
- * A bidirectional map between requestId (bigint) and full track names.
1167
- * Used to efficiently look up either by requestId or by name, enforcing uniqueness.
1168
- *
1169
- * @public
1170
- */
1171
- declare class RequestIdMap {
1172
- private requestIdToName;
1173
- private nameToRequestId;
1174
- /**
1175
- * @public
1176
- * Adds a mapping between a requestId and a full track name.
1177
- *
1178
- * @param requestId - The requestId to associate.
1179
- * @param name - The full track name to associate.
1180
- * @throws :{@link RequestIdError} if the requestId or name is already mapped to a different value.
1181
- */
1182
- addMapping(requestId: bigint, name: FullTrackName): void;
1183
- /**
1184
- * @public
1185
- * Gets the full track name for a given requestId.
1186
- *
1187
- * @param requestId - The requestId to look up.
1188
- * @returns The associated full track name.
1189
- * @throws :{@link RequestIdError} if the requestId does not exist.
1190
- */
1191
- getNameByRequestId(requestId: bigint): FullTrackName;
1192
- /**
1193
- * @public
1194
- * Gets the requestId for a given full track name.
1195
- *
1196
- * @param name - The full track name to look up.
1197
- * @returns The associated requestId.
1198
- * @throws :{@link RequestIdError} if the name does not exist.
1199
- */
1200
- getRequestIdByName(name: FullTrackName): bigint;
1201
- /**
1202
- * @public
1203
- * Removes a mapping by requestId.
1204
- *
1205
- * @param requestId - The requestId to remove.
1206
- * @returns The removed full track name, or undefined if not found.
1207
- */
1208
- removeMappingByRequestId(requestId: bigint): FullTrackName | undefined;
1209
- /**
1210
- * @public
1211
- * Removes a mapping by full track name.
1212
- *
1213
- * @param name - The full track name to remove.
1214
- * @returns The removed requestId, or undefined if not found.
1215
- */
1216
- removeMappingByName(name: FullTrackName): bigint | undefined;
1217
- /**
1218
- * @public
1219
- * Checks if the map contains a given requestId.
1220
- *
1221
- * @param requestId - The requestId to check.
1222
- * @returns True if the requestId exists, false otherwise.
1223
- */
1224
- containsRequestId(requestId: bigint): boolean;
1225
- /**
1226
- * @public
1227
- * Checks if the map contains a given full track name.
1228
- *
1229
- * @param name - The full track name to check.
1230
- * @returns True if the name exists, false otherwise.
1231
- */
1232
- containsName(name: FullTrackName): boolean;
1233
- }
1234
- //#endregion
1235
- //#region src/model/data/header.d.ts
1236
- type Header = FetchHeader | SubgroupHeader;
1237
- declare namespace Header {
1238
- function newFetch(...args: ConstructorParameters<typeof FetchHeader>): Header;
1239
- function newSubgroup(...args: ConstructorParameters<typeof SubgroupHeader>): Header;
1240
- function isFetch(header: Header): header is FetchHeader;
1241
- function isSubgroup(header: Header): header is SubgroupHeader;
1242
- function serialize(header: Header): FrozenByteBuffer;
1243
- function deserialize(buf: BaseByteBuffer): Header;
1244
- }
1245
- //#endregion
1246
- //#region src/model/common/byte_buffer.d.ts
1247
- declare abstract class BaseByteBuffer {
1248
- protected buf: Uint8Array;
1249
- protected view: DataView;
1250
- protected _offset: number;
1251
- protected _checkpoint: number;
1252
- constructor(buf: Uint8Array);
1253
- get offset(): number;
1254
- abstract get length(): number;
1255
- get remaining(): number;
1256
- /**
1257
- * Save current read position for potential rollback
1258
- */
1259
- checkpoint(): void;
1260
- /**
1261
- * Restore read position to last checkpoint
1262
- */
1263
- restore(): void;
1264
- toUint8Array(): Uint8Array;
1265
- getU8(): number;
1266
- getU16(): number;
1267
- getVI(): bigint;
1268
- countLeadingOnes(byte: number): number;
1269
- firstByteValueBits(first: number, length: number): bigint;
1270
- getNumberVI(): number;
1271
- getBytes(len: number): Uint8Array;
1272
- getLengthPrefixedBytes(): Uint8Array;
1273
- getKeyValuePair(): KeyValuePair;
1274
- getReasonPhrase(): ReasonPhrase;
1275
- getLocation(): Location;
1276
- getTuple(): Tuple;
1277
- getFullTrackName(): FullTrackName;
1278
- }
1279
- declare class ByteBuffer extends BaseByteBuffer {
1280
- private _length;
1281
- constructor(initialSize?: number);
1282
- get length(): number;
1283
- /**
1284
- * Clear all data and reset all positions
1285
- */
1286
- clear(): void;
1287
- /**
1288
- * Drop all data before current offset and reset positions
1289
- * This is the key method for memory management - removes processed data
1290
- */
1291
- commit(): void;
1292
- private ensureCapacity;
1293
- putU8(v: number): void;
1294
- putU16(v: number): void;
1295
- /**
1296
- /**
1297
- * Encode a MOQT varint using the minimal length.
1298
- */
1299
- putVI(v: bigint | number): void;
1300
- putBytes(src: Uint8Array): void;
1301
- putLengthPrefixedBytes(src: Uint8Array): void;
1302
- putKeyValuePair(pair: KeyValuePair): void;
1303
- putReasonPhrase(reason: ReasonPhrase): void;
1304
- toUint8Array(): Uint8Array;
1305
- freeze(): FrozenByteBuffer;
1306
- putLocation(loc: Location): void;
1307
- putTuple(tuple: Tuple): void;
1308
- putFullTrackName(fullTrackName: FullTrackName): void;
1309
- }
1310
- declare class FrozenByteBuffer extends BaseByteBuffer {
1311
- constructor(buf: Uint8Array);
1312
- get length(): number;
1313
- }
1314
- //#endregion
1315
- //#region src/model/control/publish_skipped.d.ts
1316
- /**
1317
- * @public
1318
- * PUBLISH_SKIPPED (0xF): a publisher tells the peer it cannot send the PUBLISH that
1319
- * would start a subscription to a track under a SUBSCRIBE_TRACKS namespace.
1320
- *
1321
- * Sent on the SUBSCRIBE_TRACKS response stream, so only the namespace suffix after that
1322
- * subscription's prefix is carried.
1323
- */
1324
- declare class PublishSkipped {
1325
- readonly trackNamespaceSuffix: Tuple;
1326
- readonly trackName: Uint8Array;
1327
- constructor(trackNamespaceSuffix: Tuple, trackName: Uint8Array);
1328
- getType(): ControlMessageType;
1329
- serialize(): FrozenByteBuffer;
1330
- static parsePayload(buf: BaseByteBuffer): PublishSkipped;
1331
- }
1332
- //#endregion
1333
- //#region src/model/parameter/constant.d.ts
1334
- /**
1335
- * Copyright 2026 The MOQtail Authors
1336
- *
1337
- * Licensed under the Apache License, Version 2.0 (the "License");
1338
- * you may not use this file except in compliance with the License.
1339
- * You may obtain a copy of the License at
1340
- *
1341
- * http://www.apache.org/licenses/LICENSE-2.0
1342
- *
1343
- * Unless required by applicable law or agreed to in writing, software
1344
- * distributed under the License is distributed on an "AS IS" BASIS,
1345
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1346
- * See the License for the specific language governing permissions and
1347
- * limitations under the License.
1348
- */
1349
- declare enum SetupOptionType {
1350
- Path = 1,
1351
- AuthorizationToken = 3,
1352
- MaxAuthTokenCacheSize = 4,
1353
- /** Raw-QUIC only. Client-only; MUST NOT be sent over WebTransport. */
1354
- Authority = 5,
1355
- MaxFilterRanges = 6,
1356
- MoqtImplementation = 7,
1357
- MaxRequestUpdates = 8,
1358
- /**
1359
- * PROVISIONAL: sender-side track switching is not an adopted extension, so this
1360
- * codepoint is absent from the registry the conformance fixture tracks. It sits in the
1361
- * 0x07-0x7F range of this space, which that registry leaves free.
1362
- */
1363
- SstsAlgorithms = 9
1364
- }
1365
- declare function setupOptionTypeFromNumber(value: number): SetupOptionType;
1366
- declare enum MessageParameterType {
1367
- ObjectDeliveryTimeout = 2,
1368
- AuthorizationToken = 3,
1369
- RendezvousTimeout = 4,
1370
- SubgroupDeliveryTimeout = 6,
1371
- Expires = 8,
1372
- LargestObject = 9,
1373
- FillTimeout = 10,
1374
- Forward = 16,
1375
- SubscriberPriority = 32,
1376
- LocationFilter = 33,
1377
- GroupOrder = 34,
1378
- FillParameters = 35,
1379
- SwitchFrom = 36,
1380
- SubgroupFilter = 37,
1381
- ObjectIdFilter = 38,
1382
- PriorityFilter = 39,
1383
- ObjectPropertyFilter = 40,
1384
- TrackPropertyFilter = 41,
1385
- NewGroupRequest = 50,
1386
- /**
1387
- * Registered codepoint with no typed parameter yet: its consumer is REQUEST_UPDATE for
1388
- * SUBSCRIBE_TRACKS (TS-11), and the value is a Track Namespace tuple rather than the
1389
- * varint its even Type implies.
1390
- */
1391
- TrackNamespacePrefix = 52,
1392
- IncludeProperties = 53,
1393
- /**
1394
- * PROVISIONAL: sender-side track switching is not an adopted extension, so this
1395
- * codepoint is absent from the registry the conformance fixture tracks; see its
1396
- * `local_extensions`.
1397
- */
1398
- SwitchingSetAssignment = 65
1399
- }
1400
- declare function messageParameterTypeFromNumber(value: bigint | number): MessageParameterType;
1401
- declare enum TokenAliasType {
1402
- Delete = 0,
1403
- Register = 1,
1404
- UseAlias = 2,
1405
- UseValue = 3
1406
- }
1407
- declare function tokenAliasTypeFromNumber(value: number): TokenAliasType;
1408
- //#endregion
1409
- //#region src/model/parameter/parameter.d.ts
1410
- interface Parameter {
1411
- toKeyValuePair(): KeyValuePair;
1412
- }
1413
- //#endregion
1414
- //#region src/model/parameter/common/authorization_token.d.ts
1415
- type AuthTokenVariant = {
1416
- aliasType: TokenAliasType.Delete;
1417
- tokenAlias: bigint;
1418
- } | {
1419
- aliasType: TokenAliasType.Register;
1420
- tokenAlias: bigint;
1421
- tokenType: bigint;
1422
- tokenValue: Uint8Array;
1423
- } | {
1424
- aliasType: TokenAliasType.UseAlias;
1425
- tokenAlias: bigint;
1426
- } | {
1427
- aliasType: TokenAliasType.UseValue;
1428
- tokenType: bigint;
1429
- tokenValue: Uint8Array;
1430
- };
1431
- declare class AuthorizationToken implements Parameter {
1432
- readonly variant: AuthTokenVariant;
1433
- static readonly TYPE = MessageParameterType.AuthorizationToken;
1434
- private constructor();
1435
- static newDelete(tokenAlias: bigint | number): AuthorizationToken;
1436
- static newRegister(tokenAlias: bigint | number, tokenType: bigint | number, tokenValue: Uint8Array): AuthorizationToken;
1437
- static newUseAlias(tokenAlias: bigint | number): AuthorizationToken;
1438
- static newUseValue(tokenType: bigint | number, tokenValue: Uint8Array): AuthorizationToken;
1439
- toKeyValuePair(): KeyValuePair;
1440
- static fromKeyValuePair(pair: KeyValuePair): AuthorizationToken | undefined;
1441
- }
1442
- //#endregion
1443
- //#region src/model/parameter/message/fill_timeout.d.ts
1444
- /**
1445
- * Duration in milliseconds a relay SHOULD wait for objects it does not yet hold before
1446
- * ending the FETCH. FETCH only (§10.2.5).
1447
- */
1448
- declare class FillTimeout implements Parameter {
1449
- readonly timeout: bigint;
1450
- static readonly TYPE = MessageParameterType.FillTimeout;
1451
- constructor(timeout: bigint);
1452
- toKeyValuePair(): KeyValuePair;
1453
- static fromKeyValuePair(pair: KeyValuePair): FillTimeout | undefined;
1454
- }
1455
- //#endregion
1456
- //#region src/model/parameter/message/object_delivery_timeout.d.ts
1457
- /**
1458
- * Duration in milliseconds the relay SHOULD continue to attempt forwarding an Object.
1459
- * A value of 0 means no timeout is set (§8).
1460
- * This parameter is subscription-specific and SHOULD NOT be forwarded upstream
1461
- * by a relay serving multiple subscriptions for the same track.
1462
- */
1463
- declare class ObjectDeliveryTimeout implements Parameter {
1464
- readonly timeout: bigint;
1465
- static readonly TYPE = MessageParameterType.ObjectDeliveryTimeout;
1466
- constructor(timeout: bigint);
1467
- toKeyValuePair(): KeyValuePair;
1468
- static fromKeyValuePair(pair: KeyValuePair): ObjectDeliveryTimeout | undefined;
1469
- }
1470
- //#endregion
1471
- //#region src/model/parameter/message/rendezvous_timeout.d.ts
1472
- /**
1473
- * Duration in milliseconds a relay SHOULD wait for a publisher of a track that has none
1474
- * before answering the SUBSCRIBE. SUBSCRIBE only (§10.2.6).
1475
- */
1476
- declare class RendezvousTimeout implements Parameter {
1477
- readonly timeout: bigint;
1478
- static readonly TYPE = MessageParameterType.RendezvousTimeout;
1479
- constructor(timeout: bigint);
1480
- toKeyValuePair(): KeyValuePair;
1481
- static fromKeyValuePair(pair: KeyValuePair): RendezvousTimeout | undefined;
1482
- }
1483
- //#endregion
1484
- //#region src/model/parameter/message/subgroup_delivery_timeout.d.ts
1485
- /**
1486
- * Duration in milliseconds the relay SHOULD continue to attempt forwarding a Subgroup.
1487
- * A value of 0 means no timeout is set (§8).
1488
- */
1489
- declare class SubgroupDeliveryTimeout implements Parameter {
1490
- readonly timeout: bigint;
1491
- static readonly TYPE = MessageParameterType.SubgroupDeliveryTimeout;
1492
- constructor(timeout: bigint);
1493
- toKeyValuePair(): KeyValuePair;
1494
- static fromKeyValuePair(pair: KeyValuePair): SubgroupDeliveryTimeout | undefined;
1495
- }
1496
- //#endregion
1497
- //#region src/model/parameter/message/expires.d.ts
1498
- /**
1499
- * Time in milliseconds after which the sender will terminate the subscription.
1500
- * A value of 0 means the subscription does not expire or expires at an unknown time.
1501
- * The receiver can extend the subscription by sending a REQUEST_UPDATE.
1502
- */
1503
- declare class Expires implements Parameter {
1504
- readonly expires: bigint;
1505
- static readonly TYPE = MessageParameterType.Expires;
1506
- constructor(expires: bigint);
1507
- toKeyValuePair(): KeyValuePair;
1508
- static fromKeyValuePair(pair: KeyValuePair): Expires | undefined;
1509
- }
1510
- //#endregion
1511
- //#region src/model/parameter/message/forward.d.ts
1512
- /**
1513
- * Forwarding state for affected subscriptions.
1514
- * Allowed wire values: 0 (don't forward) or 1 (forward).
1515
- * Any other value is a PROTOCOL_VIOLATION.
1516
- * Default (when omitted) is 1 (forward).
1517
- */
1518
- declare class Forward implements Parameter {
1519
- readonly forward: boolean;
1520
- static readonly TYPE = MessageParameterType.Forward;
1521
- constructor(forward: boolean);
1522
- toKeyValuePair(): KeyValuePair;
1523
- static fromKeyValuePair(pair: KeyValuePair): Forward | undefined;
1524
- }
1525
- //#endregion
1526
- //#region src/model/parameter/message/include_properties.d.ts
1527
- /**
1528
- * Whether the response carries Track Properties: the OK answering a SUBSCRIBE,
1529
- * TRACK_STATUS or FETCH, or each PUBLISH a SUBSCRIBE_TRACKS brings. With 0 the
1530
- * Track Properties field is still there, but empty.
1531
- * Allowed wire values: 0 or 1; any other value is a PROTOCOL_VIOLATION.
1532
- * Default (when omitted) is 1 (include them).
1533
- */
1534
- declare class IncludeProperties implements Parameter {
1535
- readonly include: boolean;
1536
- static readonly TYPE = MessageParameterType.IncludeProperties;
1537
- constructor(include: boolean);
1538
- toKeyValuePair(): KeyValuePair;
1539
- static fromKeyValuePair(pair: KeyValuePair): IncludeProperties | undefined;
1540
- }
1541
- //#endregion
1542
- //#region src/model/parameter/message/group_order_param.d.ts
1543
- /**
1544
- * How to prioritize Objects from different groups (Ascending=0x1 or Descending=0x2).
1545
- * Values outside this range are a PROTOCOL_VIOLATION (Original/0x0 is not a valid wire value).
1546
- * If omitted from SUBSCRIBE, the publisher's track preference is used.
1547
- * If omitted from FETCH, Ascending (0x1) is used.
1548
- */
1549
- declare class GroupOrderParam implements Parameter {
1550
- readonly order: GroupOrder.Ascending | GroupOrder.Descending;
1551
- static readonly TYPE = MessageParameterType.GroupOrder;
1552
- constructor(order: GroupOrder.Ascending | GroupOrder.Descending);
1553
- toKeyValuePair(): KeyValuePair;
1554
- static fromKeyValuePair(pair: KeyValuePair): GroupOrderParam | undefined;
1555
- }
1556
- //#endregion
1557
- //#region src/model/common/grease.d.ts
1558
- /**
1559
- * Copyright 2026 The MOQtail Authors
1560
- *
1561
- * Licensed under the Apache License, Version 2.0 (the "License");
1562
- * you may not use this file except in compliance with the License.
1563
- * You may obtain a copy of the License at
1564
- *
1565
- * http://www.apache.org/licenses/LICENSE-2.0
1566
- *
1567
- * Unless required by applicable law or agreed to in writing, software
1568
- * distributed under the License is distributed on an "AS IS" BASIS,
1569
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1570
- * See the License for the specific language governing permissions and
1571
- * limitations under the License.
1572
- */
1573
- /**
1574
- * GREASE reservations (§14). Values matching `0x7f * N + 0x9D` are reserved across
1575
- * several registries (Setup Options, Properties, error codes) so peers can emit them
1576
- * to exercise unknown-value handling. Receivers treat them like any other unknown
1577
- * value: ignore, never fatal.
1578
- */
1579
- /** Step between successive GREASE values. */
1580
- declare const GREASE_STEP = 127n;
1581
- /** The smallest GREASE value (N = 0). */
1582
- declare const GREASE_BASE = 157n;
1583
- /**
1584
- * @public
1585
- * True if `value` is a reserved GREASE value, i.e. `0x7f * N + 0x9D` for some
1586
- * non-negative `N`.
1587
- */
1588
- declare function isGrease(value: bigint | number): boolean;
1589
- /**
1590
- * @public
1591
- * The `N`-th GREASE value, `0x7f * N + 0x9D`, or undefined if it would exceed what a
1592
- * varint can carry (the pattern is capped at `0x3fffffffffffffde`).
1593
- */
1594
- declare function greaseValue(n: bigint | number): bigint | undefined;
1595
- //#endregion
1596
- //#region src/model/common/moqt_url.d.ts
1597
- /**
1598
- * Copyright 2026 The MOQtail Authors
1599
- *
1600
- * Licensed under the Apache License, Version 2.0 (the "License");
1601
- * you may not use this file except in compliance with the License.
1602
- * You may obtain a copy of the License at
1603
- *
1604
- * http://www.apache.org/licenses/LICENSE-2.0
1605
- *
1606
- * Unless required by applicable law or agreed to in writing, software
1607
- * distributed under the License is distributed on an "AS IS" BASIS,
1608
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1609
- * See the License for the specific language governing permissions and
1610
- * limitations under the License.
1611
- */
1612
- /**
1613
- * @public
1614
- * A `moqt://` fragment, `#<type>:<value>`. Processed locally and never sent to the
1615
- * server (§3.1).
1616
- */
1617
- interface MoqtFragment {
1618
- kind: string;
1619
- value: string;
1620
- }
1621
- /**
1622
- * @public
1623
- * A parsed `moqt://authority/path[?query][#fragment]` URI.
1624
- *
1625
- * `moqt-URI = "moqt" "://" authority path-abempty [ "?" query ]`, with an optional
1626
- * local-only fragment. `authority` is `host[:port]`; `path` keeps its leading `/`
1627
- * (empty when absent); `query` excludes the `?`.
1628
- *
1629
- * This is the TypeScript twin of `MoqtUrl` in `apps/client/src/connection.rs`; the two
1630
- * must agree on what a given URL means.
1631
- */
1632
- declare class MoqtUrl {
1633
- readonly authority: string;
1634
- readonly path: string;
1635
- readonly query: string | undefined;
1636
- readonly fragment: MoqtFragment | undefined;
1637
- constructor(authority: string, path: string, query: string | undefined, fragment: MoqtFragment | undefined);
1638
- static parse(input: string): MoqtUrl;
1639
- /** The `path[?query]` string carried in the PATH setup option on native QUIC. */
1640
- pathAndQuery(): string;
1641
- /** The equivalent `https://` URL for WebTransport, dropping the local fragment. */
1642
- toHttps(): string;
1643
- }
1644
- /**
1645
- * @public
1646
- * Resolves a session URL to the URL WebTransport is actually opened with.
1647
- *
1648
- * `moqt://` is the scheme callers are meant to use (§3.1); it is mapped to the
1649
- * equivalent `https://` here because the browser's WebTransport constructor only speaks
1650
- * HTTP/3. An `https://` input is passed through unchanged so existing callers keep
1651
- * working. Over WebTransport the authority and path travel in the HTTP CONNECT request,
1652
- * so neither is repeated as a setup option -- AUTHORITY over WebTransport is a protocol
1653
- * violation, and PATH would be redundant.
1654
- */
1655
- declare function resolveTransportUrl(url: string | URL): {
1656
- transportUrl: string;
1657
- moqtUrl: MoqtUrl | undefined;
1658
- };
1659
- //#endregion
1660
- //#region src/model/common/redirect.d.ts
1661
- /**
1662
- * @public
1663
- * Directs the peer to retry a request at a different URI and/or for a different Full
1664
- * Track Name (§10.6.1). Carried by a REQUEST_ERROR whose code is `REDIRECT`.
1665
- */
1666
- declare class Redirect {
1667
- /** Empty, together with an empty {@link Redirect.trackName}, means reuse the original request's track. */
1668
- readonly trackNamespace: Tuple;
1669
- /** Empty for namespace-scoped requests, which have no track name to redirect. */
1670
- readonly trackName: Uint8Array;
1671
- /** Undefined means reuse the current session's URI. */
1672
- readonly connectUri: string | undefined;
1673
- constructor(connectUri: string | undefined, /** Empty, together with an empty {@link Redirect.trackName}, means reuse the original request's track. */
1674
-
1675
- trackNamespace: Tuple, /** Empty for namespace-scoped requests, which have no track name to redirect. */
1676
-
1677
- trackName: Uint8Array);
1678
- /** True when the redirect names no track of its own, so the original request's track carries over. */
1679
- get keepsOriginalTrack(): boolean;
1680
- serialize(): FrozenByteBuffer;
1681
- static deserialize(buf: BaseByteBuffer): Redirect;
1682
- }
1683
- //#endregion
1684
- //#region src/model/parameter/message/largest_object.d.ts
1685
- /**
1686
- * The largest Location in the Track observed by the sending endpoint.
1687
- * If omitted from a message, the sending endpoint has not published or
1688
- * received any Objects in the Track.
1689
- */
1690
- declare class LargestObject implements Parameter {
1691
- readonly location: Location;
1692
- static readonly TYPE = MessageParameterType.LargestObject;
1693
- constructor(location: Location);
1694
- toKeyValuePair(): KeyValuePair;
1695
- static fromKeyValuePair(pair: KeyValuePair): LargestObject | undefined;
1696
- }
1697
- //#endregion
1698
- //#region src/model/parameter/message/new_group_request.d.ts
1699
- /**
1700
- * The largest Group ID in the Track known by the subscriber, plus 1.
1701
- * A value of 0 indicates the subscriber has no Group information for the Track.
1702
- * Only valid for tracks with the DYNAMIC_GROUPS property (value 1).
1703
- */
1704
- declare class NewGroupRequest implements Parameter {
1705
- readonly group: bigint;
1706
- static readonly TYPE = MessageParameterType.NewGroupRequest;
1707
- constructor(group: bigint);
1708
- toKeyValuePair(): KeyValuePair;
1709
- static fromKeyValuePair(pair: KeyValuePair): NewGroupRequest | undefined;
1710
- }
1711
- //#endregion
1712
- //#region src/model/parameter/message/switching_set_assignment.d.ts
1713
- /**
1714
- * Assigns a subscription to an SSTS (sender-side track switching) switching
1715
- * set. Carried on SUBSCRIBE and on the PUBLISH_OK of a pushed track.
1716
- *
1717
- * PROVISIONAL: sender-side track switching is not an adopted extension, so
1718
- * this parameter has no codepoint in the registry the conformance fixture
1719
- * tracks (`dev/conformance/draft22`) and is never asserted against it. Id 0 is
1720
- * the default allocation every implementation runs; other ids select an
1721
- * algorithm specific to one implementation.
1722
- */
1723
- declare class SwitchingSetAssignment implements Parameter {
1724
- readonly switchingSetId: bigint;
1725
- readonly algorithmId: bigint;
1726
- readonly throughputThresholdKbps: bigint;
1727
- /** Relative bandwidth weight among same-rank sets, 1 through 10. */
1728
- readonly setThroughputWeight: bigint;
1729
- /** 0 pauses SSTS for the set; switching activates once the number of assigned tracks reaches this value. */
1730
- readonly activateSwitching: bigint;
1731
- /** Degradation priority; lower values are protected first. Default 0. */
1732
- readonly setRank: number;
1733
- static readonly TYPE = MessageParameterType.SwitchingSetAssignment;
1734
- constructor(switchingSetId: bigint, algorithmId: bigint, throughputThresholdKbps: bigint, /** Relative bandwidth weight among same-rank sets, 1 through 10. */
1735
-
1736
- setThroughputWeight: bigint, /** 0 pauses SSTS for the set; switching activates once the number of assigned tracks reaches this value. */
1737
-
1738
- activateSwitching: bigint, /** Degradation priority; lower values are protected first. Default 0. */
1739
-
1740
- setRank?: number);
1741
- toKeyValuePair(): KeyValuePair;
1742
- static fromKeyValuePair(pair: KeyValuePair): SwitchingSetAssignment | undefined;
1743
- }
1744
- //#endregion
1745
- //#region src/model/parameter/message/subscriber_priority.d.ts
1746
- /**
1747
- * Priority of a subscription relative to others in the same session.
1748
- * Lower numbers have higher priority. Range: 0-255.
1749
- * Values outside this range are a PROTOCOL_VIOLATION.
1750
- * Default (when omitted from SUBSCRIBE, PUBLISH_OK, or FETCH) is 128.
1751
- */
1752
- declare class SubscriberPriority implements Parameter {
1753
- readonly priority: number;
1754
- static readonly TYPE = MessageParameterType.SubscriberPriority;
1755
- constructor(priority: number);
1756
- toKeyValuePair(): KeyValuePair;
1757
- static fromKeyValuePair(pair: KeyValuePair): SubscriberPriority | undefined;
1758
- }
1759
- //#endregion
1760
- //#region src/model/parameter/message/location_filter.d.ts
1761
- /**
1762
- * The range of Locations a subscription or fetch selects. The Location Filter
1763
- * Type decides which fields are set, and the value is not length-prefixed.
1764
- *
1765
- * Every Group here is absolute, except `startGroup` of a
1766
- * {@link (LocationFilterType:enum).RelativeStart}, which counts back from the Next
1767
- * Group: 0 is the Next Group, 1 the current one. The wire carries the End Group
1768
- * as a delta from the Start Group; that is undone on the way in and redone on
1769
- * the way out.
1770
- *
1771
- * If omitted from SUBSCRIBE or FETCH, the subscription or fetch is unfiltered.
1772
- * If omitted from REQUEST_UPDATE, the value is unchanged.
1773
- */
1774
- declare class LocationFilter implements Parameter {
1775
- readonly filterType: LocationFilterType;
1776
- readonly startGroup?: bigint | undefined;
1777
- readonly startObject?: bigint | undefined;
1778
- readonly endGroup?: bigint | undefined;
1779
- readonly endObject?: bigint | undefined;
1780
- static readonly TYPE = MessageParameterType.LocationFilter;
1781
- /**
1782
- * @throws :{@link ProtocolViolationError} When a field the type calls for is
1783
- * missing, or the End Group is before the Start Group.
1784
- */
1785
- constructor(filterType: LocationFilterType, startGroup?: bigint | undefined, startObject?: bigint | undefined, endGroup?: bigint | undefined, endObject?: bigint | undefined);
1786
- /**
1787
- * The first Location the filter passes, given the track's Largest Object, or
1788
- * `undefined` when there is no filter. A relative start that would fall before
1789
- * group 0 is group 0; a track with nothing published yet starts a relative
1790
- * filter at `{0,0}`.
1791
- */
1792
- startLocation(largest?: Location): Location | undefined;
1793
- /** The Start Location an absolute filter carries; `undefined` for the others. */
1794
- get absoluteStart(): Location | undefined;
1795
- /**
1796
- * The last Location the filter passes, inclusive, or `undefined` when it is
1797
- * open-ended. A Group End is the whole of that group, so its Object is 2^64-1.
1798
- */
1799
- endLocation(): Location | undefined;
1800
- /**
1801
- * The inclusive range the filter selects under the rules for a Fetch, which
1802
- * never reach past the Largest Object: an open end is the Largest Object, and
1803
- * no filter at all is the whole track up to it.
1804
- *
1805
- * `undefined` when that range is empty, which includes a track with nothing
1806
- * published yet and a Next Object filter, whose start is always past the
1807
- * Largest Object.
1808
- */
1809
- fetchRange(largest?: Location): {
1810
- start: Location;
1811
- end: Location;
1812
- } | undefined;
1813
- /** The Location Filter Type and its fields, without the Parameter Type. */
1814
- serializeValue(): Uint8Array;
1815
- /**
1816
- * Reads a Location Filter Type and exactly the fields it calls for.
1817
- * @throws :{@link ProtocolViolationError} For an unknown Location Filter Type,
1818
- * or an End Group past 2^64-1.
1819
- */
1820
- static deserializeValue(buf: BaseByteBuffer): LocationFilter;
1821
- toKeyValuePair(): KeyValuePair;
1822
- static fromKeyValuePair(pair: KeyValuePair): LocationFilter | undefined;
1823
- }
1824
- //#endregion
1825
- //#region src/model/parameter/message/switch_from.d.ts
1826
- /**
1827
- * Identifies the subscription being replaced by a switch request.
1828
- * The value is two varints followed by a flags byte: bit 7 (MSB) is Publish Done;
1829
- * bits 0 through 6 are reserved and must be zero.
1830
- */
1831
- declare class SwitchFrom implements Parameter {
1832
- readonly requestId: bigint;
1833
- readonly mode: SwitchMode;
1834
- readonly publishDone: boolean;
1835
- static readonly TYPE = MessageParameterType.SwitchFrom;
1836
- constructor(requestId: bigint, mode: SwitchMode, publishDone: boolean);
1837
- toKeyValuePair(): KeyValuePair;
1838
- static fromKeyValuePair(pair: KeyValuePair): SwitchFrom | undefined;
1839
- }
1840
- //#endregion
1841
- //#region src/model/parameter/message/fill_parameters.d.ts
1842
- /**
1843
- * Requests a fill fetch stream, and overrides for it. An omitted parameter keeps
1844
- * the value it has for the live subscription; an omitted LOCATION_FILTER fills
1845
- * over the subscription's own.
1846
- */
1847
- declare class FillParameters implements Parameter {
1848
- readonly parameters: MessageParameter[];
1849
- static readonly TYPE = MessageParameterType.FillParameters;
1850
- constructor(parameters: MessageParameter[]);
1851
- toKeyValuePair(): KeyValuePair;
1852
- static fromKeyValuePair(pair: KeyValuePair): FillParameters | undefined;
1853
- }
1854
- //#endregion
1855
- //#region src/model/error/error.d.ts
1856
- /**
1857
- * Copyright 2025 The MOQtail Authors
1858
- *
1859
- * Licensed under the Apache License, Version 2.0 (the "License");
1860
- * you may not use this file except in compliance with the License.
1861
- * You may obtain a copy of the License at
1862
- *
1863
- * http://www.apache.org/licenses/LICENSE-2.0
1864
- *
1865
- * Unless required by applicable law or agreed to in writing, software
1866
- * distributed under the License is distributed on an "AS IS" BASIS,
1867
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1868
- * See the License for the specific language governing permissions and
1869
- * limitations under the License.
1870
- */
1871
- /**
1872
- * Base class for all MOQtail errors.
1873
- */
1874
- declare class MOQtailError extends Error {
1875
- constructor(cause?: string);
1876
- }
1877
- /**
1878
- * Not enough bytes in buffer to satisfy a read.
1879
- */
1880
- declare class NotEnoughBytesError extends MOQtailError {
1881
- context: string;
1882
- needed: number;
1883
- available: number;
1884
- constructor(context: string, needed: number, available: number);
1885
- }
1886
- /**
1887
- * Cannot cast between two incompatible types.
1888
- */
1889
- declare class CastingError extends MOQtailError {
1890
- context: string;
1891
- fromType: string;
1892
- toType: string;
1893
- details: string;
1894
- constructor(context: string, fromType: string, toType: string, details: string);
1895
- }
1896
- /**
1897
- * Value too large to encode as varint.
1898
- */
1899
- declare class VarIntOverflowError extends MOQtailError {
1900
- context: string;
1901
- value: number;
1902
- constructor(context: string, value: number);
1903
- }
1904
- /**
1905
- * Length exceeds maximum allowed by protocol.
1906
- */
1907
- declare class LengthExceedsMaxError extends MOQtailError {
1908
- context: string;
1909
- max: number;
1910
- len: number;
1911
- constructor(context: string, max: number, len: number);
1912
- }
1913
- /**
1914
- * Key/value formatting error.
1915
- */
1916
- declare class KeyValueFormattingError extends MOQtailError {
1917
- context: string;
1918
- constructor(context: string);
1919
- }
1920
- /**
1921
- * Invalid discriminant or type tag.
1922
- */
1923
- declare class InvalidTypeError extends MOQtailError {
1924
- context: string;
1925
- details: string;
1926
- constructor(context: string, details: string);
1927
- }
1928
- /**
1929
- * Invalid enum discriminant / value encountered when mapping to a protocol enum.
1930
- */
1931
- declare class InvalidEnumValue extends MOQtailError {
1932
- context: string;
1933
- value: bigint | number;
1934
- constructor(context: string, value: bigint | number);
1935
- }
1936
- /**
1937
- * Invalid UTF-8 encountered in a string or bytes field.
1938
- */
1939
- declare class InvalidUTF8Error extends MOQtailError {
1940
- context: string;
1941
- details: string;
1942
- constructor(context: string, details: string);
1943
- }
1944
- /**
1945
- * Generic protocol violation.
1946
- */
1947
- declare class ProtocolViolationError extends MOQtailError {
1948
- context: string;
1949
- details: string;
1950
- constructor(context: string, details: string);
1951
- }
1952
- /**
1953
- * Track naming error.
1954
- */
1955
- declare class TrackNameError extends MOQtailError {
1956
- context: string;
1957
- details: string;
1958
- constructor(context: string, details: string);
1959
- }
1960
- /**
1961
- * Request ID error.
1962
- */
1963
- declare class RequestIdError extends MOQtailError {
1964
- context: string;
1965
- details: string;
1966
- constructor(context: string, details: string);
1967
- }
1968
- /**
1969
- * Operation timed out.
1970
- */
1971
- declare class TimeoutError extends MOQtailError {
1972
- context: string;
1973
- constructor(context: string);
1974
- }
1975
- /**
1976
- * Internal error.
1977
- */
1978
- declare class InternalError extends MOQtailError {
1979
- context: string;
1980
- details: string;
1981
- constructor(context: string, details: string);
1982
- }
1983
- /**
1984
- * Connection terminated.
1985
- */
1986
- declare class TerminationError extends MOQtailError {
1987
- context: string;
1988
- terminationCode: number;
1989
- constructor(context: string, terminationCode: number);
1990
- }
1991
- //#endregion
1992
- //#region src/model/parameter/message/range_filter.d.ts
1993
- /**
1994
- * What a Range Filter selects on. Each kind is its own parameter type, and the two
1995
- * property kinds also name the Property they read.
1996
- */
1997
- declare enum RangeFilterKind {
1998
- Subgroup = 37,
1999
- ObjectId = 38,
2000
- /** Publisher Priority, which is a single byte. */
2001
- Priority = 39,
2002
- ObjectProperty = 40,
2003
- /** Selects tracks rather than Objects, so it only rides SUBSCRIBE_TRACKS. */
2004
- TrackProperty = 41
2005
- }
2006
- declare namespace RangeFilterKind {
2007
- /** Whether the filter carries a Property Type after its SetID. */
2008
- function hasPropertyType(kind: RangeFilterKind): boolean;
2009
- function isRangeFilterType(typeValue: bigint | number): boolean;
2010
- }
2011
- /** An inclusive range of values. An open-ended range has no `end`. */
2012
- interface Range {
2013
- readonly start: bigint;
2014
- readonly end?: bigint;
2015
- }
2016
- /**
2017
- * A Range as the wire carries it: the Start as a delta from the End before it, the
2018
- * End as a delta from its own Start.
2019
- */
2020
- type RangeDelta = readonly [start: bigint, end?: bigint];
2021
- /**
2022
- * A Range Filter that cannot be honoured. A peer that sends one is answered with
2023
- * REQUEST_ERROR INVALID_FILTER rather than a closed session: the request is
2024
- * well-formed, it just asks for something that cannot be applied.
2025
- */
2026
- declare class InvalidFilterError extends MOQtailError {
2027
- readonly context: string;
2028
- readonly details: string;
2029
- constructor(context: string, details: string);
2030
- }
2031
- /**
2032
- * Delta-encodes ascending `ranges`. Only the last may be open-ended.
2033
- * @throws :{@link InvalidFilterError} When the ranges do not ascend.
2034
- */
2035
- declare function encodeRanges(ranges: readonly Range[]): RangeDelta[];
2036
- /**
2037
- * One Range Filter parameter. Unlike other parameters it may repeat in a message,
2038
- * once per SetID (and Property Type).
2039
- *
2040
- * Without a `setId` it is the zero-length form, which in REQUEST_UPDATE removes the
2041
- * filters of its kind.
2042
- *
2043
- * The Ranges are held as the wire's deltas and only added back by {@link
2044
- * RangeFilter.ranges}: a sum past 2^64-1 is answered with a REQUEST_ERROR for the
2045
- * request that carried it, which a parser that rejected it could not do.
2046
- */
2047
- declare class RangeFilter implements Parameter {
2048
- readonly kind: RangeFilterKind;
2049
- readonly setId?: number | undefined;
2050
- readonly propertyType?: bigint | undefined;
2051
- readonly deltas: readonly RangeDelta[];
2052
- /**
2053
- * @throws :{@link ProtocolViolationError} When the Property Type's presence does not
2054
- * match the kind, or a removal carries anything but its kind.
2055
- */
2056
- constructor(kind: RangeFilterKind, setId?: number | undefined, propertyType?: bigint | undefined, deltas?: readonly RangeDelta[]);
2057
- /** The zero-length form, which removes the filters of its kind. */
2058
- get isRemoval(): boolean;
2059
- /** How many Ranges the filter holds, which is what a peer's range limit counts. */
2060
- get rangeCount(): number;
2061
- /**
2062
- * The Ranges with their deltas added back.
2063
- * @throws :{@link InvalidFilterError} When a bound exceeds 2^64-1.
2064
- */
2065
- ranges(): Range[];
2066
- /**
2067
- * The Ranges, once everything a filter of this kind has to satisfy holds.
2068
- * @throws :{@link InvalidFilterError} For an odd Property Type, a priority above
2069
- * 255, or a bound past 2^64-1.
2070
- */
2071
- validate(): Range[];
2072
- /** The SetID, Property Type if any, and the Ranges, without the Type or Length. */
2073
- serializeValue(): Uint8Array;
2074
- toKeyValuePair(): KeyValuePair;
2075
- /**
2076
- * Decodes a Range Filter value. The Value ends with the last Range, so a Start
2077
- * with nothing after it is an open-ended last Range.
2078
- */
2079
- static fromKeyValuePair(pair: KeyValuePair): RangeFilter | undefined;
2080
- }
2081
- //#endregion
2082
- //#region src/model/parameter/message_parameter.d.ts
2083
- type MessageParameter = ObjectDeliveryTimeout | SubgroupDeliveryTimeout | RendezvousTimeout | FillTimeout | AuthorizationToken | Expires | LargestObject | Forward | SubscriberPriority | GroupOrderParam | LocationFilter | NewGroupRequest | SwitchFrom | FillParameters | RangeFilter | IncludeProperties | SwitchingSetAssignment;
2084
- declare namespace MessageParameter {
2085
- /**
2086
- * Parses a single KeyValuePair into a MessageParameter.
2087
- * Returns undefined for unrecognized parameter types (be forgiving).
2088
- * Still throws ProtocolViolationError for known types with invalid values.
2089
- */
2090
- function fromKeyValuePair(pair: KeyValuePair): MessageParameter | undefined;
2091
- function toKeyValuePair(param: MessageParameter): KeyValuePair;
2092
- function isObjectDeliveryTimeout(param: MessageParameter): param is ObjectDeliveryTimeout;
2093
- function isSubgroupDeliveryTimeout(param: MessageParameter): param is SubgroupDeliveryTimeout;
2094
- function isRendezvousTimeout(param: MessageParameter): param is RendezvousTimeout;
2095
- function isFillTimeout(param: MessageParameter): param is FillTimeout;
2096
- function isAuthorizationToken(param: MessageParameter): param is AuthorizationToken;
2097
- function isExpires(param: MessageParameter): param is Expires;
2098
- function isLargestObject(param: MessageParameter): param is LargestObject;
2099
- function isForward(param: MessageParameter): param is Forward;
2100
- function isSubscriberPriority(param: MessageParameter): param is SubscriberPriority;
2101
- function isGroupOrderParam(param: MessageParameter): param is GroupOrderParam;
2102
- function isSwitchingSetAssignment(param: MessageParameter): param is SwitchingSetAssignment;
2103
- /** The negotiated Group Order, or {@link (GroupOrder:enum).Original} when unparameterized. */
2104
- function groupOrderOf(params: readonly MessageParameter[]): GroupOrder;
2105
- function isLocationFilter(param: MessageParameter): param is LocationFilter;
2106
- function isNewGroupRequest(param: MessageParameter): param is NewGroupRequest;
2107
- function isSwitchFrom(param: MessageParameter): param is SwitchFrom;
2108
- function isFillParameters(param: MessageParameter): param is FillParameters;
2109
- function isRangeFilter(param: MessageParameter): param is RangeFilter;
2110
- /**
2111
- * Whether `params` carry a Range Filter, either directly or inside FILL_PARAMETERS,
2112
- * removals included. An endpoint that allows no filter ranges rejects any of them.
2113
- */
2114
- function carriesRangeFilter(params: readonly MessageParameter[]): boolean;
2115
- function isIncludeProperties(param: MessageParameter): param is IncludeProperties;
2116
- /**
2117
- * The parameters a PUBLISH answering a SUBSCRIBE_TRACKS states: the request's
2118
- * settings that a PUBLISH can carry (FORWARD, GROUP_ORDER, LOCATION_FILTER), which
2119
- * are the new subscription's initial settings. AUTHORIZATION_TOKEN is never copied.
2120
- * The Range Filters, FILL_PARAMETERS and INCLUDE_PROPERTIES cannot go in a PUBLISH;
2121
- * they are the publisher's to apply.
2122
- */
2123
- function publishParametersFor(subscribeTracks: readonly MessageParameter[]): MessageParameter[];
2124
- /**
2125
- * Whether a request's response should carry Track Properties: false only when it
2126
- * has INCLUDE_PROPERTIES set to 0.
2127
- */
2128
- function includesProperties(params: readonly MessageParameter[]): boolean;
2129
- }
2130
- /**
2131
- * Builder for constructing a list of MessageParameters.
2132
- * Mirrors the SetupOptions builder pattern.
2133
- */
2134
- declare class MessageParameters {
2135
- private params;
2136
- add(param: MessageParameter): this;
2137
- addObjectDeliveryTimeout(timeout: bigint | number): this;
2138
- addSubgroupDeliveryTimeout(timeout: bigint | number): this;
2139
- addRendezvousTimeout(timeout: bigint | number): this;
2140
- addFillTimeout(timeout: bigint | number): this;
2141
- addAuthorizationToken(token: AuthorizationToken): this;
2142
- addExpires(expires: bigint | number): this;
2143
- addForward(forward: boolean): this;
2144
- addIncludeProperties(include: boolean): this;
2145
- addSubscriberPriority(priority: number): this;
2146
- addGroupOrder(order: GroupOrderParam['order']): this;
2147
- addLocationFilter(filter: LocationFilter): this;
2148
- addNewGroupRequest(group: bigint | number): this;
2149
- addSwitchFrom(requestId: bigint | number, mode: SwitchMode, publishDone: boolean): this;
2150
- addFillParameters(parameters: MessageParameter[]): this;
2151
- addRangeFilter(filter: RangeFilter): this;
2152
- build(): MessageParameter[];
2153
- /**
2154
- * Parses an array of KeyValuePairs into a list of MessageParameters.
2155
- * Unrecognized parameter types are silently skipped.
2156
- * Known parameter types with invalid values still throw ProtocolViolationError.
2157
- */
2158
- static fromKeyValuePairs(pairs: KeyValuePair[]): MessageParameter[];
2159
- }
2160
- /**
2161
- * Serializes a list of message-parameter KVPs, delta-encoding the Types.
2162
- * Mirrors {@link serializeKvpList} but honours per-parameter value encodings.
2163
- */
2164
- declare function serializeMessageParameterKvps(items: KeyValuePair[]): FrozenByteBuffer;
2165
- /**
2166
- * Reads exactly `count` delta-encoded message-parameter KVPs.
2167
- * Mirrors {@link deserializeKvpList} but honours per-parameter value encodings.
2168
- */
2169
- declare function deserializeMessageParameterKvps(buf: BaseByteBuffer, count: number | bigint): KeyValuePair[];
2170
- /**
2171
- * Applies a set of parameter updates to an existing parameter list.
2172
- *
2173
- * A Type the update leaves out keeps its value. A Type it carries is replaced
2174
- * outright, every instance of it: a Range Filter can repeat, and an update that
2175
- * names a filter kind states the whole of that kind, so one left over from before
2176
- * would quietly widen or narrow what the subscriber asked for. A zero-length Range
2177
- * Filter replaces its kind with nothing.
2178
- */
2179
- declare function applyMessageParameterUpdate(current: MessageParameter[], updates: MessageParameter[]): void;
2180
- //#endregion
2181
- //#region src/model/control/publish_namespace.d.ts
2182
- /**
2183
- * Represents a protocol PublishNamespace message, used to announce a track and its parameters.
2184
- *
2185
- * @public
2186
- */
2187
- declare class PublishNamespace {
2188
- readonly requestId: bigint;
2189
- readonly trackNamespace: Tuple;
2190
- readonly parameters: MessageParameter[];
2191
- /**
2192
- * @public
2193
- * Constructs a PublishNamespace message.
2194
- *
2195
- * @param requestId - The request ID for this publish namespace message.
2196
- * @param trackNamespace - The track namespace as a Tuple.
2197
- * @param parameters - The list of strongly-typed message parameters for the track.
2198
- */
2199
- constructor(requestId: bigint, trackNamespace: Tuple, parameters: MessageParameter[]);
2200
- /**
2201
- * @public
2202
- * Gets the message type for this PublishNamespace message.
2203
- *
2204
- * @returns The ControlMessageType.PublishNamespace value.
2205
- */
2206
- getType(): ControlMessageType;
2207
- /**
2208
- * @public
2209
- * Serializes the PublishNamespace message into a {@link FrozenByteBuffer}.
2210
- *
2211
- * @returns The serialized buffer.
2212
- * @throws :{@link LengthExceedsMaxError} If the payload exceeds 65535 bytes.
2213
- */
2214
- serialize(): FrozenByteBuffer;
2215
- /**
2216
- * @public
2217
- * Parses a PublishNamespace message from the given buffer.
2218
- *
2219
- * @param buf - The buffer to parse from.
2220
- * @returns The parsed PublishNamespace message.
2221
- * @throws :{@link NotEnoughBytesError} If the buffer does not contain enough bytes.
2222
- */
2223
- static parsePayload(buf: BaseByteBuffer): PublishNamespace;
2224
- }
2225
- //#endregion
2226
- //#region src/model/control/namespace.d.ts
2227
- /**
2228
- * @public
2229
- * Represents a NAMESPACE message sent on a SUBSCRIBE_NAMESPACE bi-stream.
2230
- * Carries the namespace suffix (fields after the subscriber's prefix).
2231
- */
2232
- declare class Namespace {
2233
- readonly trackNamespaceSuffix: Tuple;
2234
- constructor(trackNamespaceSuffix: Tuple);
2235
- getType(): ControlMessageType;
2236
- serialize(): FrozenByteBuffer;
2237
- static parsePayload(buf: BaseByteBuffer): Namespace;
2238
- }
2239
- //#endregion
2240
- //#region src/model/control/namespace_done.d.ts
2241
- /**
2242
- * @public
2243
- * Represents a NAMESPACE_DONE message sent on a SUBSCRIBE_NAMESPACE bi-stream.
2244
- * Signals that a previously announced namespace suffix is no longer available.
2245
- */
2246
- declare class NamespaceDone {
2247
- readonly trackNamespaceSuffix: Tuple;
2248
- constructor(trackNamespaceSuffix: Tuple);
2249
- getType(): ControlMessageType;
2250
- serialize(): FrozenByteBuffer;
2251
- static parsePayload(buf: BaseByteBuffer): NamespaceDone;
2252
- }
2253
- //#endregion
2254
- //#region src/model/control/setup.d.ts
2255
- /**
2256
- * The first message each endpoint sends on its control stream.
2257
- *
2258
- * Both peers send the same message; there are no separate client and server forms and
2259
- * no version fields, since version negotiation happens over ALPN.
2260
- *
2261
- * Some options are client-only (see {@link SetupOptionType}); whether a peer is
2262
- * allowed to send a given option depends on which side it is and on the transport,
2263
- * neither of which is knowable here, so that rule is enforced by the caller rather than
2264
- * by this class.
2265
- */
2266
- declare class Setup {
2267
- readonly setupOptions: KeyValuePair[];
2268
- constructor(setupOptions: KeyValuePair[]);
2269
- getType(): ControlMessageType;
2270
- serialize(): FrozenByteBuffer;
2271
- static parsePayload(buf: BaseByteBuffer): Setup;
2272
- }
2273
- //#endregion
2274
- //#region src/model/control/fetch.d.ts
2275
- declare class Fetch {
2276
- readonly requestId: bigint;
2277
- readonly fullTrackName: FullTrackName;
2278
- readonly parameters: MessageParameter[];
2279
- constructor(requestId: bigint, fullTrackName: FullTrackName, parameters: MessageParameter[]);
2280
- /**
2281
- * The requested range. A FETCH without a LOCATION_FILTER parameter asks for the
2282
- * whole track up to the Largest Object, the same as a {@link (LocationFilterType:enum).None} filter.
2283
- */
2284
- get locationFilter(): LocationFilter;
2285
- getType(): ControlMessageType;
2286
- serialize(): FrozenByteBuffer;
2287
- static parsePayload(buf: BaseByteBuffer): Fetch;
2288
- }
2289
- //#endregion
2290
- //#region src/model/property/constant.d.ts
2291
- /**
2292
- * Copyright 2025 The MOQtail Authors
2293
- *
2294
- * Licensed under the Apache License, Version 2.0 (the "License");
2295
- * you may not use this file except in compliance with the License.
2296
- * You may obtain a copy of the License at
2297
- *
2298
- * http://www.apache.org/licenses/LICENSE-2.0
2299
- *
2300
- * Unless required by applicable law or agreed to in writing, software
2301
- * distributed under the License is distributed on an "AS IS" BASIS,
2302
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2303
- * See the License for the specific language governing permissions and
2304
- * limitations under the License.
2305
- */
2306
- declare enum LOCPropertyId {
2307
- Timescale = 8,
2308
- VideoFrameMarking = 9,
2309
- AudioLevel = 12,
2310
- VideoConfig = 13,
2311
- AudioConfig = 15,
2312
- Timestamp = 16
2313
- }
2314
- declare enum TrackPropertyType {
2315
- ObjectDeliveryTimeout = 2,
2316
- MaxCacheDuration = 4,
2317
- SubgroupDeliveryTimeout = 6,
2318
- ImmutableProperties = 11,
2319
- DefaultPublisherPriority = 14,
2320
- DefaultPublisherGroupOrder = 34,
2321
- DynamicGroups = 48,
2322
- PriorGroupIdGap = 60,
2323
- PriorObjectIdGap = 62
2324
- }
2325
- declare function locPropertyIdFromNumber(value: number): LOCPropertyId;
2326
- /**
2327
- * @public
2328
- * A registration-policy range in the Property Type space. `to` is absent for the
2329
- * open-ended top range.
2330
- */
2331
- interface PropertyRange {
2332
- readonly from: bigint;
2333
- readonly to?: bigint;
2334
- }
2335
- /**
2336
- * @public
2337
- * Registration-policy ranges for the Property Type space.
2338
- *
2339
- */
2340
- declare const PropertyRanges: {
2341
- /** Standards Action or IESG Approval (1-byte encoding). */readonly StandardsAction: {
2342
- readonly from: 0n;
2343
- readonly to: 119n;
2344
- }; /** Application-specific use, no registration permitted (1-byte encoding). */
2345
- readonly AppSpecific1Byte: {
2346
- readonly from: 120n;
2347
- readonly to: 127n;
2348
- }; /** Specification Required (2-byte encoding). */
2349
- readonly SpecRequired: {
2350
- readonly from: 128n;
2351
- readonly to: 14335n;
2352
- }; /** Application-specific use, no registration permitted (2-byte encoding). */
2353
- readonly AppSpecific2Byte: {
2354
- readonly from: 14336n;
2355
- readonly to: 16383n;
2356
- }; /** Mandatory Track Properties; Track scope only. */
2357
- readonly MandatoryTrack: {
2358
- readonly from: 16384n;
2359
- readonly to: 32767n;
2360
- }; /** First Come First Served begins here (open-ended). */
2361
- readonly Fcfs: {
2362
- readonly from: 32768n;
2363
- };
2364
- };
2365
- /**
2366
- * @public
2367
- * True if a Property Type is reserved for application-specific use (either encoding-width
2368
- * range), for which no IANA registration is permitted.
2369
- */
2370
- declare function isApplicationSpecificProperty(typeValue: bigint | number): boolean;
2371
- //#endregion
2372
- //#region src/model/property/track_property.d.ts
2373
- /** A timeout of 0 means no timeout is set (§8), on this side as on the parameter side. */
2374
- declare class ObjectDeliveryTimeoutProperty {
2375
- readonly timeoutMs: bigint;
2376
- static readonly TYPE = TrackPropertyType.ObjectDeliveryTimeout;
2377
- constructor(timeoutMs: bigint);
2378
- toKeyValuePair(): KeyValuePair;
2379
- static fromKeyValuePair(pair: KeyValuePair): ObjectDeliveryTimeoutProperty | undefined;
2380
- }
2381
- declare class SubgroupDeliveryTimeoutProperty {
2382
- readonly timeoutMs: bigint;
2383
- static readonly TYPE = TrackPropertyType.SubgroupDeliveryTimeout;
2384
- constructor(timeoutMs: bigint);
2385
- toKeyValuePair(): KeyValuePair;
2386
- static fromKeyValuePair(pair: KeyValuePair): SubgroupDeliveryTimeoutProperty | undefined;
2387
- }
2388
- declare class MaxCacheDurationProperty {
2389
- readonly durationMs: bigint;
2390
- static readonly TYPE = TrackPropertyType.MaxCacheDuration;
2391
- constructor(durationMs: bigint);
2392
- toKeyValuePair(): KeyValuePair;
2393
- static fromKeyValuePair(pair: KeyValuePair): MaxCacheDurationProperty | undefined;
2394
- }
2395
- declare class ImmutablePropertiesTrackProperty {
2396
- readonly properties: KeyValuePair[];
2397
- static readonly TYPE = TrackPropertyType.ImmutableProperties;
2398
- constructor(properties: KeyValuePair[]);
2399
- toKeyValuePair(): KeyValuePair;
2400
- static fromKeyValuePair(pair: KeyValuePair): ImmutablePropertiesTrackProperty | undefined;
2401
- }
2402
- declare class DefaultPublisherPriorityProperty {
2403
- readonly priority: number;
2404
- static readonly TYPE = TrackPropertyType.DefaultPublisherPriority;
2405
- constructor(priority: number);
2406
- toKeyValuePair(): KeyValuePair;
2407
- static fromKeyValuePair(pair: KeyValuePair): DefaultPublisherPriorityProperty | undefined;
2408
- }
2409
- declare class DefaultPublisherGroupOrderProperty {
2410
- readonly order: GroupOrder;
2411
- static readonly TYPE = TrackPropertyType.DefaultPublisherGroupOrder;
2412
- constructor(order: GroupOrder);
2413
- toKeyValuePair(): KeyValuePair;
2414
- static fromKeyValuePair(pair: KeyValuePair): DefaultPublisherGroupOrderProperty | undefined;
2415
- }
2416
- declare class DynamicGroupsProperty {
2417
- readonly enabled: boolean;
2418
- static readonly TYPE = TrackPropertyType.DynamicGroups;
2419
- constructor(enabled: boolean);
2420
- toKeyValuePair(): KeyValuePair;
2421
- static fromKeyValuePair(pair: KeyValuePair): DynamicGroupsProperty | undefined;
2422
- }
2423
- declare class UnknownTrackProperty {
2424
- readonly kvp: KeyValuePair;
2425
- constructor(kvp: KeyValuePair);
2426
- toKeyValuePair(): KeyValuePair;
2427
- }
2428
- type TrackProperty = ObjectDeliveryTimeoutProperty | SubgroupDeliveryTimeoutProperty | MaxCacheDurationProperty | ImmutablePropertiesTrackProperty | DefaultPublisherPriorityProperty | DefaultPublisherGroupOrderProperty | DynamicGroupsProperty | UnknownTrackProperty;
2429
- declare namespace TrackProperty {
2430
- function fromKeyValuePair(pair: KeyValuePair): TrackProperty;
2431
- function toKeyValuePair(ext: TrackProperty): KeyValuePair;
2432
- function deserializeAll(buf: BaseByteBuffer): TrackProperty[];
2433
- function serializeInto(exts: TrackProperty[], payload: ByteBuffer): void;
2434
- function isObjectDeliveryTimeout(ext: TrackProperty): ext is ObjectDeliveryTimeoutProperty;
2435
- function isSubgroupDeliveryTimeout(ext: TrackProperty): ext is SubgroupDeliveryTimeoutProperty;
2436
- function isMaxCacheDuration(ext: TrackProperty): ext is MaxCacheDurationProperty;
2437
- function isImmutableProperties(ext: TrackProperty): ext is ImmutablePropertiesTrackProperty;
2438
- function isDefaultPublisherPriority(ext: TrackProperty): ext is DefaultPublisherPriorityProperty;
2439
- function isDefaultPublisherGroupOrder(ext: TrackProperty): ext is DefaultPublisherGroupOrderProperty;
2440
- function isDynamicGroups(ext: TrackProperty): ext is DynamicGroupsProperty;
2441
- function isUnknown(ext: TrackProperty): ext is UnknownTrackProperty;
2442
- }
2443
- //#endregion
2444
- //#region src/model/control/fetch_ok.d.ts
2445
- /**
2446
- * FETCH_OK (0x18) keeps a body of its own rather than folding into REQUEST_OK, but like
2447
- * every other response it carries no Request ID: the request stream it arrives on
2448
- * identifies the request (§10.1).
2449
- */
2450
- declare class FetchOk {
2451
- readonly endOfTrack: boolean;
2452
- /** The last Location the response covers, inclusive. Object 2^64-1 is all of that group. */
2453
- readonly endLocation: Location;
2454
- readonly parameters: MessageParameter[];
2455
- readonly trackProperties: TrackProperty[];
2456
- constructor(endOfTrack: boolean, /** The last Location the response covers, inclusive. Object 2^64-1 is all of that group. */
2457
-
2458
- endLocation: Location, parameters: MessageParameter[], trackProperties?: TrackProperty[]);
2459
- getType(): ControlMessageType;
2460
- serialize(): FrozenByteBuffer;
2461
- static parsePayload(buf: BaseByteBuffer): FetchOk;
2462
- }
2463
- //#endregion
2464
- //#region src/model/control/goaway.d.ts
2465
- /** §10.4: a longer New Session URI is a protocol violation. */
2466
- declare const MAX_NEW_SESSION_URI_LENGTH = 8192;
2467
- /**
2468
- * GOAWAY (0x10) winds down a session, or — on a request stream — migrates that one
2469
- * request.
2470
- */
2471
- declare class GoAway {
2472
- newSessionUri?: string | undefined;
2473
- /**
2474
- * Milliseconds the sender waits for graceful closure; 0 means no specific timeout.
2475
- * On the control stream the sender closes the session with `GOAWAY_TIMEOUT` after it,
2476
- * on a request stream it resets the stream with `GOING_AWAY`.
2477
- */
2478
- readonly timeout: bigint;
2479
- constructor(newSessionUri?: string, timeout?: bigint);
2480
- getType(): ControlMessageType;
2481
- serialize(): FrozenByteBuffer;
2482
- static parsePayload(buf: BaseByteBuffer): GoAway;
2483
- }
2484
- //#endregion
2485
- //#region src/model/control/subscribe.d.ts
2486
- declare class Subscribe {
2487
- requestId: bigint;
2488
- fullTrackName: FullTrackName;
2489
- parameters: MessageParameter[];
2490
- constructor(requestId: bigint, fullTrackName: FullTrackName, parameters: MessageParameter[]);
2491
- getType(): ControlMessageType;
2492
- serialize(): FrozenByteBuffer;
2493
- static parsePayload(buf: BaseByteBuffer): Subscribe;
2494
- }
2495
- //#endregion
2496
- //#region src/model/control/publish_done.d.ts
2497
- declare class PublishDone {
2498
- readonly statusCode: PublishDoneStatusCode;
2499
- readonly streamCount: bigint;
2500
- readonly errorReason: ReasonPhrase;
2501
- /**
2502
- * The Stream Count a publisher sends when it cannot name the exact number of streams
2503
- * it opened. Receivers fall back on a timeout to end the subscription.
2504
- */
2505
- static readonly UNKNOWN_STREAM_COUNT: bigint;
2506
- constructor(statusCode: PublishDoneStatusCode, streamCount: bigint, errorReason: ReasonPhrase);
2507
- static new(statusCode: PublishDoneStatusCode, streamCount: bigint, errorReason: ReasonPhrase): PublishDone;
2508
- getType(): ControlMessageType;
2509
- serialize(): FrozenByteBuffer;
2510
- static parsePayload(buf: BaseByteBuffer): PublishDone;
2511
- }
2512
- //#endregion
2513
- //#region src/model/control/publish.d.ts
2514
- declare class Publish {
2515
- readonly requestId: bigint;
2516
- readonly fullTrackName: FullTrackName;
2517
- readonly trackAlias: bigint;
2518
- readonly parameters: MessageParameter[];
2519
- readonly trackProperties: TrackProperty[];
2520
- constructor(requestId: bigint, fullTrackName: FullTrackName, trackAlias: bigint, parameters: MessageParameter[], trackProperties?: TrackProperty[]);
2521
- getType(): ControlMessageType;
2522
- serialize(): FrozenByteBuffer;
2523
- static parsePayload(buf: BaseByteBuffer): Publish;
2524
- }
2525
- //#endregion
2526
- //#region src/model/control/subscribe_ok.d.ts
2527
- /**
2528
- * SUBSCRIBE_OK (0x4) keeps a body of its own rather than folding into REQUEST_OK, but
2529
- * like every other response it carries no Request ID: the request stream it arrives on
2530
- * identifies the request (§10.1).
2531
- */
2532
- declare class SubscribeOk {
2533
- trackAlias: bigint;
2534
- parameters: MessageParameter[];
2535
- trackProperties: TrackProperty[];
2536
- private constructor();
2537
- static create(trackAlias: bigint, parameters: MessageParameter[], trackProperties?: TrackProperty[]): SubscribeOk;
2538
- getType(): ControlMessageType;
2539
- serialize(): FrozenByteBuffer;
2540
- static parsePayload(buf: BaseByteBuffer): SubscribeOk;
2541
- }
2542
- //#endregion
2543
- //#region src/model/control/request_update.d.ts
2544
- declare class RequestUpdate {
2545
- requestId: bigint;
2546
- parameters: MessageParameter[];
2547
- constructor(requestId: bigint, parameters: MessageParameter[]);
2548
- getType(): ControlMessageType;
2549
- serialize(): FrozenByteBuffer;
2550
- static parsePayload(buf: BaseByteBuffer): RequestUpdate;
2551
- equals(other: RequestUpdate): boolean;
2552
- }
2553
- //#endregion
2554
- //#region src/model/control/track_status.d.ts
2555
- declare class TrackStatus {
2556
- requestId: bigint;
2557
- trackAlias: bigint;
2558
- fullTrackName: FullTrackName;
2559
- subscriberPriority: number;
2560
- groupOrder: GroupOrder;
2561
- forward: boolean;
2562
- locationFilter: LocationFilter;
2563
- subscribeParameters: MessageParameter[];
2564
- constructor(requestId: bigint, trackAlias: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, locationFilter: LocationFilter, subscribeParameters: MessageParameter[]);
2565
- getType(): ControlMessageType;
2566
- serialize(): FrozenByteBuffer;
2567
- static parsePayload(buf: BaseByteBuffer): TrackStatus;
2568
- }
2569
- //#endregion
2570
- //#region src/model/control/subscribe_namespace.d.ts
2571
- declare class SubscribeNamespace {
2572
- readonly requestId: bigint;
2573
- readonly trackNamespacePrefix: Tuple;
2574
- readonly parameters: MessageParameter[];
2575
- constructor(requestId: bigint, trackNamespacePrefix: Tuple, parameters: MessageParameter[]);
2576
- getType(): ControlMessageType;
2577
- serialize(): FrozenByteBuffer;
2578
- static parsePayload(buf: BaseByteBuffer): SubscribeNamespace;
2579
- }
2580
- //#endregion
2581
- //#region src/model/control/subscribe_tracks.d.ts
2582
- /**
2583
- * SUBSCRIBE_TRACKS (0x51) asks for a PUBLISH for every track under a matching
2584
- * namespace prefix, present and future (§10.19).
2585
- *
2586
- * Shares SUBSCRIBE_NAMESPACE's wire shape but has its own prefix-overlap space: the
2587
- * two types may hold the same prefix, two of the same type may not.
2588
- */
2589
- declare class SubscribeTracks {
2590
- readonly requestId: bigint;
2591
- readonly trackNamespacePrefix: Tuple;
2592
- readonly parameters: MessageParameter[];
2593
- constructor(requestId: bigint, trackNamespacePrefix: Tuple, parameters: MessageParameter[]);
2594
- getType(): ControlMessageType;
2595
- serialize(): FrozenByteBuffer;
2596
- static parsePayload(buf: BaseByteBuffer): SubscribeTracks;
2597
- }
2598
- //#endregion
2599
- //#region src/model/control/request_ok.d.ts
2600
- /**
2601
- * @public
2602
- * REQUEST_OK (0x7) answers PUBLISH, REQUEST_UPDATE, TRACK_STATUS, SUBSCRIBE_NAMESPACE,
2603
- * SUBSCRIBE_TRACKS and PUBLISH_NAMESPACE. There is one wire type; the per-request-type
2604
- * names (PUBLISH_OK, TRACK_STATUS_OK, ...) are shorthands for logging, not distinct
2605
- * messages. SUBSCRIBE_OK (0x4) and FETCH_OK (0x18) do keep bodies of their own.
2606
- *
2607
- * It carries no Request ID: the request stream it arrives on identifies the request.
2608
- */
2609
- declare class RequestOk {
2610
- readonly parameters: MessageParameter[];
2611
- /**
2612
- * Track Properties, which the trailing bytes of the payload carry with no
2613
- * count of their own. Populated only in TRACK_STATUS_OK; empty for every other request
2614
- * type — see {@link RequestOk.validateTrackProperties}.
2615
- */
2616
- readonly trackProperties: TrackProperty[];
2617
- constructor(parameters?: MessageParameter[], trackProperties?: TrackProperty[]);
2618
- getType(): ControlMessageType;
2619
- /**
2620
- * Track Properties may only be non-empty when this REQUEST_OK answers a TRACK_STATUS
2621
- * request (§10.5). A receiver that sees them in any other REQUEST_OK — PUBLISH_OK,
2622
- * REQUEST_UPDATE_OK, SUBSCRIBE_NAMESPACE_OK or PUBLISH_NAMESPACE_OK — MUST close the
2623
- * session with a PROTOCOL_VIOLATION.
2624
- *
2625
- * @throws :{@link ProtocolViolationError} If Track Properties are present and this
2626
- * REQUEST_OK does not answer a TRACK_STATUS.
2627
- */
2628
- validateTrackProperties(answersTrackStatus: boolean): void;
2629
- serialize(): FrozenByteBuffer;
2630
- /**
2631
- * Parses a REQUEST_OK body. `buf` must hold exactly the payload: whatever follows the
2632
- * parameters is read as Track Properties, so trailing bytes from a longer buffer would
2633
- * be parsed as properties.
2634
- */
2635
- static parsePayload(buf: BaseByteBuffer): RequestOk;
2636
- }
2637
- //#endregion
2638
- //#region src/model/control/request_error.d.ts
2639
- /**
2640
- * REQUEST_ERROR (0x5) refuses any request type. It carries no Request ID: the request
2641
- * stream it arrives on identifies the request (§10.1).
2642
- */
2643
- declare class RequestError {
2644
- readonly errorCode: RequestErrorCode;
2645
- readonly retryInterval: bigint;
2646
- readonly reasonPhrase: ReasonPhrase;
2647
- /** Present exactly when {@link RequestError.errorCode} is `REDIRECT` (§10.6.2). */
2648
- readonly redirect: Redirect | undefined;
2649
- constructor(errorCode: RequestErrorCode, retryInterval: bigint, reasonPhrase: ReasonPhrase, redirect?: Redirect);
2650
- /** A REQUEST_ERROR that redirects the request elsewhere (§10.6.1). */
2651
- static redirect(retryInterval: bigint, reasonPhrase: ReasonPhrase, redirect: Redirect): RequestError;
2652
- getType(): ControlMessageType;
2653
- serialize(): FrozenByteBuffer;
2654
- static parsePayload(buf: BaseByteBuffer): RequestError;
2655
- }
2656
- //#endregion
2657
- //#region src/model/control/control_message.d.ts
2658
- type ControlMessage = Publish | PublishSkipped | PublishDone | PublishNamespace | Namespace | NamespaceDone | Setup | Fetch | FetchOk | GoAway | Subscribe | RequestError | SubscribeOk | RequestUpdate | TrackStatus | SubscribeNamespace | SubscribeTracks | RequestOk;
2659
- declare namespace ControlMessage {
2660
- function deserialize(buf: FrozenByteBuffer): ControlMessage;
2661
- function serialize(msg: ControlMessage): FrozenByteBuffer;
2662
- }
2663
- //#endregion
2664
- //#region src/model/error/stream_reset.d.ts
2665
- /**
2666
- * Copyright 2026 The MOQtail Authors
2667
- *
2668
- * Licensed under the Apache License, Version 2.0 (the "License");
2669
- * you may not use this file except in compliance with the License.
2670
- * You may obtain a copy of the License at
2671
- *
2672
- * http://www.apache.org/licenses/LICENSE-2.0
2673
- *
2674
- * Unless required by applicable law or agreed to in writing, software
2675
- * distributed under the License is distributed on an "AS IS" BASIS,
2676
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2677
- * See the License for the specific language governing permissions and
2678
- * limitations under the License.
2679
- */
2680
- /**
2681
- * @public
2682
- * Codes carried when resetting a request stream or sending STOP_SENDING on one.
2683
- *
2684
- * A separate registry from {@link (RequestErrorCode:enum)}, which disagrees with it on
2685
- * the same names: `GOING_AWAY` is `0x4` here but `0x6` there.
2686
- */
2687
- declare enum StreamResetCode {
2688
- InternalError = 0,
2689
- Cancelled = 1,
2690
- DeliveryTimeout = 2,
2691
- SessionClosed = 3,
2692
- GoingAway = 4,
2693
- TooFarBehind = 5,
2694
- UnknownObjectStatus = 6,
2695
- ExpiredAuthToken = 7,
2696
- ExcessiveLoad = 9,
2697
- MalformedTrack = 18
2698
- }
2699
- declare namespace StreamResetCode {
2700
- /**
2701
- * Converts a numeric application error code to a StreamResetCode. The code is a
2702
- * `number` because that is what the transport reports it as
2703
- * (`WebTransportError.streamErrorCode`, an `unsigned long`).
2704
- *
2705
- * @throws :{@link InvalidEnumValue} if the code is not a defined stream reset code.
2706
- */
2707
- function tryFrom(code: number): StreamResetCode;
2708
- }
2709
- //#endregion
2710
- //#region src/model/catalog/cmsf.d.ts
2711
- /**
2712
- * Copyright 2026 The MOQtail Authors
2713
- *
2714
- * Licensed under the Apache License, Version 2.0 (the "License");
2715
- * you may not use this file except in compliance with the License.
2716
- * You may obtain a copy of the License at
2717
- *
2718
- * http://www.apache.org/licenses/LICENSE-2.0
2719
- *
2720
- * Unless required by applicable law or agreed to in writing, software
2721
- * distributed under the License is distributed on an "AS IS" BASIS,
2722
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2723
- * See the License for the specific language governing permissions and
2724
- * limitations under the License.
2725
- */
2726
- interface CMSFTrack {
2727
- name: string;
2728
- packaging: 'cmaf' | 'chunk-per-object' | 'timeline';
2729
- codec?: string;
2730
- role: 'video' | 'audio' | 'timeline';
2731
- depends?: string[];
2732
- mimeType?: string;
2733
- width?: number;
2734
- height?: number;
2735
- timescale?: number;
2736
- bitrate?: number;
2737
- initData?: string;
2738
- }
2739
- interface CMSF {
2740
- version: string;
2741
- tracks: CMSFTrack[];
2742
- }
2743
- declare class CMSFCatalog {
2744
- #private;
2745
- private constructor();
2746
- static from(payload: ArrayBufferLike): CMSFCatalog;
2747
- getByTrackName(trackName: string): CMSFTrack | undefined;
2748
- getTracks(role?: CMSF['tracks'][number]['role']): CMSFTrack[];
2749
- getVideo(index?: number): CMSFTrack | undefined;
2750
- getAudio(index?: number): CMSFTrack | undefined;
2751
- getTimeline(index?: number): CMSFTrack | undefined;
2752
- getCodecString(trackName: string): string | undefined;
2753
- getRole(trackName: string): "video" | "audio" | "timeline" | undefined;
2754
- getPackaging(trackName: string): "timeline" | "cmaf" | "chunk-per-object" | undefined;
2755
- isCMAF(trackName: string): boolean;
2756
- getTimescale(trackName: string): number | undefined;
2757
- getInitData(trackName: string): Uint8Array<ArrayBuffer> | undefined;
2758
- private extractTrackName;
2759
- }
2760
- //#endregion
2761
- //#region src/model/error/constant.d.ts
2762
- /**
2763
- * Copyright 2025 The MOQtail Authors
2764
- *
2765
- * Licensed under the Apache License, Version 2.0 (the "License");
2766
- * you may not use this file except in compliance with the License.
2767
- * You may obtain a copy of the License at
2768
- *
2769
- * http://www.apache.org/licenses/LICENSE-2.0
2770
- *
2771
- * Unless required by applicable law or agreed to in writing, software
2772
- * distributed under the License is distributed on an "AS IS" BASIS,
2773
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2774
- * See the License for the specific language governing permissions and
2775
- * limitations under the License.
2776
- */
2777
- declare enum TerminationCode {
2778
- NO_ERROR = 0,
2779
- INTERNAL_ERROR = 1,
2780
- UNAUTHORIZED = 2,
2781
- PROTOCOL_VIOLATION = 3,
2782
- INVALID_REQUEST_ID = 4,
2783
- DUPLICATE_TRACK_ALIAS = 5,
2784
- KEY_VALUE_FORMATTING_ERROR = 6,
2785
- INVALID_PATH = 8,
2786
- MALFORMED_PATH = 9,
2787
- GOAWAY_TIMEOUT = 16,
2788
- CONTROL_MESSAGE_TIMEOUT = 17,
2789
- DATA_STREAM_TIMEOUT = 18,
2790
- AUTH_TOKEN_CACHE_OVERFLOW = 19,
2791
- DUPLICATE_AUTH_TOKEN_ALIAS = 20,
2792
- MALFORMED_AUTH_TOKEN = 22,
2793
- UNKNOWN_AUTH_TOKEN_ALIAS = 23,
2794
- EXPIRED_AUTH_TOKEN = 24,
2795
- INVALID_AUTHORITY = 25,
2796
- MALFORMED_AUTHORITY = 26,
2797
- TOO_MANY_REQUEST_UPDATES = 27
2798
- }
2799
- declare namespace TerminationCode {
2800
- /**
2801
- * Tries to convert a number to a TerminationCode enum member.
2802
- *
2803
- * @param code - The numeric code to convert.
2804
- * @returns The corresponding TerminationCode member, or throws InvalidTypeError if the code is not valid.
2805
- */
2806
- function tryFrom(code: number): TerminationCode;
2807
- }
2808
- //#endregion
2809
- //#region src/model/property/timestamp.d.ts
2810
- declare class Timestamp {
2811
- readonly timestamp: bigint;
2812
- static readonly TYPE = LOCPropertyId.Timestamp;
2813
- constructor(timestamp: bigint);
2814
- toKeyValuePair(): KeyValuePair;
2815
- static fromKeyValuePair(pair: KeyValuePair): Timestamp | undefined;
2816
- }
2817
- //#endregion
2818
- //#region src/model/property/timescale.d.ts
2819
- declare class Timescale {
2820
- readonly timescale: bigint;
2821
- static readonly TYPE = LOCPropertyId.Timescale;
2822
- constructor(timescale: bigint);
2823
- toKeyValuePair(): KeyValuePair;
2824
- static fromKeyValuePair(pair: KeyValuePair): Timescale | undefined;
2825
- }
2826
- //#endregion
2827
- //#region src/model/property/video_frame_marking.d.ts
2828
- declare class VideoFrameMarking {
2829
- readonly value: Uint8Array;
2830
- static readonly TYPE = LOCPropertyId.VideoFrameMarking;
2831
- /** The RFC 9626 frame-marking octets (1 to 4), without the length prefix. */
2832
- constructor(value: Uint8Array);
2833
- /** True if the frame decodes without temporally prior frames (the I bit). */
2834
- get independent(): boolean;
2835
- toKeyValuePair(): KeyValuePair;
2836
- static fromKeyValuePair(pair: KeyValuePair): VideoFrameMarking | undefined;
2837
- }
2838
- //#endregion
2839
- //#region src/model/property/audio_level.d.ts
2840
- declare class AudioLevel {
2841
- readonly audioLevel: bigint;
2842
- static readonly TYPE = LOCPropertyId.AudioLevel;
2843
- constructor(audioLevel: bigint);
2844
- toKeyValuePair(): KeyValuePair;
2845
- static fromKeyValuePair(pair: KeyValuePair): AudioLevel | undefined;
2846
- }
2847
- //#endregion
2848
- //#region src/model/property/video_config.d.ts
2849
- declare class VideoConfig {
2850
- readonly config: Uint8Array;
2851
- static readonly TYPE = LOCPropertyId.VideoConfig;
2852
- constructor(config: Uint8Array);
2853
- toKeyValuePair(): KeyValuePair;
2854
- static fromKeyValuePair(pair: KeyValuePair): VideoConfig | undefined;
2855
- }
2856
- //#endregion
2857
- //#region src/model/property/audio_config.d.ts
2858
- declare class AudioConfig {
2859
- readonly config: Uint8Array;
2860
- static readonly TYPE = LOCPropertyId.AudioConfig;
2861
- constructor(config: Uint8Array);
2862
- toKeyValuePair(): KeyValuePair;
2863
- static fromKeyValuePair(pair: KeyValuePair): AudioConfig | undefined;
2864
- }
2865
- //#endregion
2866
- //#region src/model/property/loc.d.ts
2867
- type LOCProperty = Timestamp | Timescale | VideoFrameMarking | AudioLevel | VideoConfig | AudioConfig;
2868
- declare namespace LOCProperty {
2869
- function fromKeyValuePair(pair: KeyValuePair): LOCProperty | undefined;
2870
- function toKeyValuePair(header: LOCProperty): KeyValuePair;
2871
- function isTimestamp(header: LOCProperty): header is Timestamp;
2872
- function isTimescale(header: LOCProperty): header is Timescale;
2873
- function isVideoFrameMarking(header: LOCProperty): header is VideoFrameMarking;
2874
- function isAudioLevel(header: LOCProperty): header is AudioLevel;
2875
- function isVideoConfig(header: LOCProperty): header is VideoConfig;
2876
- function isAudioConfig(header: LOCProperty): header is AudioConfig;
2877
- }
2878
- declare class LOCProperties {
2879
- private kvps;
2880
- addTimestamp(timestamp: bigint | number): this;
2881
- addTimescale(timescale: bigint | number): this;
2882
- /** Marks a whole, non-scalable frame (RFC 9626 short form): S and E set, I set on a keyframe. */
2883
- addVideoFrameMarking(isKey: boolean): this;
2884
- addAudioLevel(audioLevel: bigint | number): this;
2885
- addVideoConfig(config: Uint8Array): this;
2886
- addAudioConfig(config: Uint8Array): this;
2887
- addRaw(pair: KeyValuePair): this;
2888
- build(): KeyValuePair[];
2889
- static fromKeyValuePairs(kvps: KeyValuePair[]): LOCProperty[];
2890
- }
2891
- //#endregion
2892
- //#region src/model/property/object_property.d.ts
2893
- declare class ImmutablePropertiesObjectProperty {
2894
- readonly properties: KeyValuePair[];
2895
- static readonly TYPE = TrackPropertyType.ImmutableProperties;
2896
- constructor(properties: KeyValuePair[]);
2897
- toKeyValuePair(): KeyValuePair;
2898
- static fromKeyValuePair(pair: KeyValuePair): ImmutablePropertiesObjectProperty | undefined;
2899
- }
2900
- declare class PriorGroupIdGapProperty {
2901
- readonly gap: bigint;
2902
- static readonly TYPE = TrackPropertyType.PriorGroupIdGap;
2903
- constructor(gap: bigint);
2904
- toKeyValuePair(): KeyValuePair;
2905
- static fromKeyValuePair(pair: KeyValuePair): PriorGroupIdGapProperty | undefined;
2906
- }
2907
- declare class PriorObjectIdGapProperty {
2908
- readonly gap: bigint;
2909
- static readonly TYPE = TrackPropertyType.PriorObjectIdGap;
2910
- constructor(gap: bigint);
2911
- toKeyValuePair(): KeyValuePair;
2912
- static fromKeyValuePair(pair: KeyValuePair): PriorObjectIdGapProperty | undefined;
2913
- }
2914
- declare class UnknownObjectProperty {
2915
- readonly kvp: KeyValuePair;
2916
- constructor(kvp: KeyValuePair);
2917
- toKeyValuePair(): KeyValuePair;
2918
- }
2919
- type ObjectProperty = ImmutablePropertiesObjectProperty | PriorGroupIdGapProperty | PriorObjectIdGapProperty | UnknownObjectProperty;
2920
- declare namespace ObjectProperty {
2921
- function fromKeyValuePair(pair: KeyValuePair): ObjectProperty;
2922
- function toKeyValuePair(ext: ObjectProperty): KeyValuePair;
2923
- function deserializeAll(buf: BaseByteBuffer): ObjectProperty[];
2924
- function serializeInto(exts: ObjectProperty[], payload: ByteBuffer): void;
2925
- function isImmutableProperties(ext: ObjectProperty): ext is ImmutablePropertiesObjectProperty;
2926
- function isPriorGroupIdGap(ext: ObjectProperty): ext is PriorGroupIdGapProperty;
2927
- function isPriorObjectIdGap(ext: ObjectProperty): ext is PriorObjectIdGapProperty;
2928
- function isUnknown(ext: ObjectProperty): ext is UnknownObjectProperty;
2929
- }
2930
- //#endregion
2931
- //#region src/model/parameter/setup/path.d.ts
2932
- declare class Path implements Parameter {
2933
- readonly moqtPath: string;
2934
- static readonly TYPE = SetupOptionType.Path;
2935
- constructor(moqtPath: string);
2936
- toKeyValuePair(): KeyValuePair;
2937
- static fromKeyValuePair(pair: KeyValuePair): Path | undefined;
2938
- }
2939
- //#endregion
2940
- //#region src/model/parameter/setup/max_auth_token_cache_size.d.ts
2941
- declare class MaxAuthTokenCacheSize implements Parameter {
2942
- readonly maxSize: bigint;
2943
- static readonly TYPE = SetupOptionType.MaxAuthTokenCacheSize;
2944
- constructor(maxSize: bigint);
2945
- toKeyValuePair(): KeyValuePair;
2946
- static fromKeyValuePair(pair: KeyValuePair): MaxAuthTokenCacheSize | undefined;
2947
- }
2948
- //#endregion
2949
- //#region src/model/parameter/setup/authority.d.ts
2950
- /**
2951
- * Raw-QUIC only: the authority component of the `moqt://` URI, carried in SETUP because
2952
- * there is no HTTP CONNECT to carry it.
2953
- *
2954
- * Client-only; MUST NOT be sent by a server or over WebTransport. moqtail-ts always
2955
- * connects over WebTransport, so its own handshake never sends this — see
2956
- * `MOQtailClient.new`.
2957
- */
2958
- declare class Authority implements Parameter {
2959
- readonly authority: string;
2960
- static readonly TYPE = SetupOptionType.Authority;
2961
- constructor(authority: string);
2962
- toKeyValuePair(): KeyValuePair;
2963
- static fromKeyValuePair(pair: KeyValuePair): Authority | undefined;
2964
- }
2965
- //#endregion
2966
- //#region src/model/parameter/setup/max_filter_ranges.d.ts
2967
- /**
2968
- * Limits the total number of Ranges the peer may have across all Range filter parameters
2969
- * of a single subscription or fetch. Zero, the default when absent, means the peer may
2970
- * not send Range filters at all.
2971
- */
2972
- declare class MaxFilterRanges implements Parameter {
2973
- readonly value: bigint;
2974
- static readonly TYPE = SetupOptionType.MaxFilterRanges;
2975
- constructor(value: bigint);
2976
- toKeyValuePair(): KeyValuePair;
2977
- static fromKeyValuePair(pair: KeyValuePair): MaxFilterRanges | undefined;
2978
- }
2979
- //#endregion
2980
- //#region src/model/parameter/setup/moqt_implementation.d.ts
2981
- /**
2982
- * Free-form implementation identification string, e.g. for logging and debugging.
2983
- * Either peer may send it.
2984
- */
2985
- declare class MoqtImplementation implements Parameter {
2986
- readonly info: string;
2987
- static readonly TYPE = SetupOptionType.MoqtImplementation;
2988
- constructor(info: string);
2989
- toKeyValuePair(): KeyValuePair;
2990
- static fromKeyValuePair(pair: KeyValuePair): MoqtImplementation | undefined;
2991
- }
2992
- //#endregion
2993
- //#region src/model/parameter/setup/max_request_updates.d.ts
2994
- /**
2995
- * Maximum number of outstanding REQUEST_UPDATEs per request stream: an update counts
2996
- * until its REQUEST_OK or REQUEST_ERROR arrives. Zero, the default when absent, means
2997
- * no limit. Receiving one past the limit closes the session with TOO_MANY_REQUEST_UPDATES.
2998
- */
2999
- declare class MaxRequestUpdates implements Parameter {
3000
- readonly value: bigint;
3001
- static readonly TYPE = SetupOptionType.MaxRequestUpdates;
3002
- constructor(value: bigint);
3003
- toKeyValuePair(): KeyValuePair;
3004
- static fromKeyValuePair(pair: KeyValuePair): MaxRequestUpdates | undefined;
3005
- }
3006
- //#endregion
3007
- //#region src/model/parameter/setup/ssts_algorithms.d.ts
3008
- /**
3009
- * The sender-side track switching (SSTS) algorithms this endpoint supports.
3010
- *
3011
- * PROVISIONAL: sender-side track switching is not an adopted extension, so
3012
- * this option has no codepoint in the registry the conformance fixture tracks
3013
- * (`dev/conformance/draft22`) and is never asserted against it. An empty list
3014
- * — or the absence of the option — prohibits the use of SSTS.
3015
- */
3016
- declare class SstsAlgorithms implements Parameter {
3017
- readonly algorithms: bigint[];
3018
- static readonly TYPE = SetupOptionType.SstsAlgorithms;
3019
- constructor(algorithms: bigint[]);
3020
- toKeyValuePair(): KeyValuePair;
3021
- static fromKeyValuePair(pair: KeyValuePair): SstsAlgorithms | undefined;
3022
- }
3023
- //#endregion
3024
- //#region src/model/parameter/setup_option.d.ts
3025
- type SetupOption = Path | MaxAuthTokenCacheSize | AuthorizationToken | Authority | MaxFilterRanges | MoqtImplementation | MaxRequestUpdates | SstsAlgorithms;
3026
- declare namespace SetupOption {
3027
- function fromKeyValuePair(pair: KeyValuePair): SetupOption | undefined;
3028
- function toKeyValuePair(param: SetupOption): KeyValuePair;
3029
- function isPath(param: SetupOption): param is Path;
3030
- function isMaxAuthTokenCacheSize(param: SetupOption): param is MaxAuthTokenCacheSize;
3031
- function isAuthorizationToken(param: SetupOption): param is AuthorizationToken;
3032
- function isAuthority(param: SetupOption): param is Authority;
3033
- function isMaxFilterRanges(param: SetupOption): param is MaxFilterRanges;
3034
- function isMaxRequestUpdates(param: SetupOption): param is MaxRequestUpdates;
3035
- function isMoqtImplementation(param: SetupOption): param is MoqtImplementation;
3036
- function isSstsAlgorithms(param: SetupOption): param is SstsAlgorithms;
3037
- }
3038
- /** Throws if `params` carries AUTHORITY, which MUST NOT be sent over WebTransport. */
3039
- declare function assertNoAuthorityOverWebTransport(params: KeyValuePair[]): void;
3040
- declare class SetupOptions {
3041
- private kvps;
3042
- addMaxAuthTokenCacheSize(maxSize: bigint | number): this;
3043
- addPath(moqtPath: string): this;
3044
- addAuthorizationToken(auth: AuthorizationToken): this;
3045
- addMaxFilterRanges(value: bigint | number): this;
3046
- addMaxRequestUpdates(value: bigint | number): this;
3047
- addMoqtImplementation(info: string): this;
3048
- addSstsAlgorithms(algorithms: (bigint | number)[]): this;
3049
- addRaw(pair: KeyValuePair): this;
3050
- build(): KeyValuePair[];
3051
- static fromKeyValuePairs(kvps: KeyValuePair[]): SetupOption[];
3052
- }
3053
- //#endregion
3054
- //#region src/model/parameter/message/combined_filter.d.ts
3055
- /**
3056
- * The object filter a request's Range Filters add up to.
3057
- *
3058
- * Ranges within one filter are OR'd, filters sharing a SetID are AND'd, and the
3059
- * SetIDs are OR'd with each other. No filter at all passes every Object.
3060
- */
3061
- declare class CombinedFilter {
3062
- #private;
3063
- /** How many Ranges the filters hold, which is what a range limit counts. */
3064
- readonly rangeCount: number;
3065
- /**
3066
- * Builds the filter from every Range Filter in `params`; anything else, and a
3067
- * zero-length removal, is ignored.
3068
- *
3069
- * @throws :{@link InvalidFilterError} For a filter that cannot be applied: one
3070
- * that repeats a Type, SetID and Property Type already given, one with an odd
3071
- * Property Type, a priority above 255 or a bound past 2^64-1, or a track filter,
3072
- * which selects tracks rather than Objects.
3073
- */
3074
- constructor(params: readonly MessageParameter[]);
3075
- /** Whether the filter passes everything. */
3076
- get isEmpty(): boolean;
3077
- /**
3078
- * Whether `obj` passes.
3079
- *
3080
- * @param subgroupId - The Subgroup ID `obj` travels in. It is passed in because an
3081
- * Object whose Subgroup ID is its subgroup's first Object ID does not know it
3082
- * itself. `null` — a datagram — has no subgroup, so no subgroup filter passes it.
3083
- */
3084
- matches(obj: MoqtObject, subgroupId?: bigint | null): boolean;
3085
- }
3086
- //#endregion
3087
- export { LOCPropertyId as $, isBytes as $n, Forward as $t, ControlMessage as A, GroupOrder as An, ProtocolViolationError as At, Subscribe as B, FetchHeaderType as Bn, SwitchingSetAssignment as Bt, Timescale as C, FullTrackName as Cn, InvalidEnumValue as Ct, CMSFCatalog as D, FetchObject as Dn, LengthExceedsMaxError as Dt, CMSF as E, EndOfRangeKind as En, KeyValueFormattingError as Et, TrackStatus as F, SwitchMode as Fn, VarIntOverflowError as Ft, DefaultPublisherPriorityProperty as G, MAX_REASON_PHRASE_LEN as Gn, MoqtUrl as Gt, MAX_NEW_SESSION_URI_LENGTH as H, ObjectForwardingPreference as Hn, LargestObject as Ht, RequestUpdate as I, TrackStatusCode as In, FillParameters as It, MaxCacheDurationProperty as J, TupleField as Jn, GREASE_STEP as Jt, DynamicGroupsProperty as K, ReasonPhrase as Kn, resolveTransportUrl as Kt, SubscribeOk as L, FetchHeader as Ln, SwitchFrom as Lt, RequestOk as M, PublishDoneStatusCode as Mn, TerminationError as Mt, SubscribeTracks as N, RequestErrorCode as Nn, TimeoutError as Nt, CMSFTrack as O, FetchObjectContext as On, MOQtailError as Ot, SubscribeNamespace as P, SUPPORTED_VERSIONS as Pn, TrackNameError as Pt, UnknownTrackProperty as Q, deserializeKvpListUntilEmpty as Qn, IncludeProperties as Qt, Publish as R, Datagram as Rn, LocationFilter as Rt, VideoFrameMarking as S, SubgroupObject as Sn, InternalError as St, TerminationCode as T, MAX_NAMESPACE_TUPLE_COUNT as Tn, InvalidUTF8Error as Tt, FetchOk as U, ObjectStatus as Un, Redirect as Ut, GoAway as V, ObjectDatagramType as Vn, NewGroupRequest as Vt, DefaultPublisherGroupOrderProperty as W, SubgroupHeaderType as Wn, MoqtFragment as Wt, SubgroupDeliveryTimeoutProperty as X, KeyValuePair as Xn, isGrease as Xt, ObjectDeliveryTimeoutProperty as Y, Location as Yn, greaseValue as Yt, TrackProperty as Z, deserializeKvpList as Zn, GroupOrderParam as Zt, LOCProperties as _, FrozenByteBuffer as _n, RangeDelta as _t, SstsAlgorithms as a, AuthTokenVariant as an, Fetch as at, VideoConfig as b, SubgroupHeader as bn, encodeRanges as bt, MaxFilterRanges as c, MessageParameterType as cn, Namespace as ct, Path as d, messageParameterTypeFromNumber as dn, MessageParameters as dt, Expires as en, isVarInt as er, PropertyRange as et, ImmutablePropertiesObjectProperty as f, setupOptionTypeFromNumber as fn, applyMessageParameterUpdate as ft, UnknownObjectProperty as g, ByteBuffer as gn, Range as gt, PriorObjectIdGapProperty as h, BaseByteBuffer as hn, InvalidFilterError as ht, assertNoAuthorityOverWebTransport as i, FillTimeout as in, locPropertyIdFromNumber as it, RequestError as j, LocationFilterType as jn, RequestIdError as jt, StreamResetCode as k, ControlMessageType as kn, NotEnoughBytesError as kt, Authority as l, SetupOptionType as ln, PublishNamespace as lt, PriorGroupIdGapProperty as m, PublishSkipped as mn, serializeMessageParameterKvps as mt, SetupOption as n, RendezvousTimeout as nn, TrackPropertyType as nt, MaxRequestUpdates as o, AuthorizationToken as on, Setup as ot, ObjectProperty as p, tokenAliasTypeFromNumber as pn, deserializeMessageParameterKvps as pt, ImmutablePropertiesTrackProperty as q, Tuple as qn, GREASE_BASE as qt, SetupOptions as r, ObjectDeliveryTimeout as rn, isApplicationSpecificProperty as rt, MoqtImplementation as s, Parameter as sn, NamespaceDone as st, CombinedFilter as t, SubgroupDeliveryTimeout as tn, serializeKvpList as tr, PropertyRanges as tt, MaxAuthTokenCacheSize as u, TokenAliasType as un, MessageParameter as ut, LOCProperty as v, Header as vn, RangeFilter as vt, Timestamp as w, MAX_FULL_TRACK_NAME_LENGTH as wn, InvalidTypeError as wt, AudioLevel as x, MoqtObject as xn, CastingError as xt, AudioConfig as y, RequestIdMap as yn, RangeFilterKind as yt, PublishDone as z, DEFAULT_PUBLISHER_PRIORITY as zn, SubscriberPriority as zt };