moqtail 0.14.0 → 0.16.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.
- package/README.md +153 -473
- package/dist/{client-Z7egUKTO.cjs → client-DQ5aGbLR.cjs} +1100 -1099
- package/dist/client-DUzLw_Y8.d.cts +1932 -0
- package/dist/{client-BW1agDFV.mjs → client-DVi4Nh1J.mjs} +942 -947
- package/dist/client-epHqMdHm.d.mts +1932 -0
- package/dist/client.cjs +121 -4
- package/dist/client.d.cts +23 -1933
- package/dist/client.d.mts +23 -1933
- package/dist/client.mjs +117 -2
- package/dist/emitter-UbeRcbuf.mjs +109 -0
- package/dist/{logger-c2NoQqtx.cjs → emitter-qNJYD3yQ.cjs} +61 -2
- package/dist/index-B-BMK-b6.d.mts +2090 -0
- package/dist/index-BtemTtwe.d.cts +2090 -0
- package/dist/{index-DBbxKcc1.d.cts → index-CNn9BgO6.d.mts} +168 -337
- package/dist/index.cjs +39 -34
- package/dist/index.d.cts +20 -4
- package/dist/index.d.mts +20 -4
- package/dist/index.mjs +5 -4
- package/dist/logger-B8IYkljn.d.cts +64 -0
- package/dist/logger-B8IYkljn.d.mts +64 -0
- package/dist/model.cjs +208 -359
- package/dist/model.d.cts +2896 -2
- package/dist/model.d.mts +17 -2
- package/dist/model.mjs +207 -359
- package/dist/player/component.cjs +317 -0
- package/dist/player/component.d.cts +50 -0
- package/dist/player/component.d.mts +50 -0
- package/dist/player/component.mjs +315 -0
- package/dist/player-CJayEzwt.cjs +6750 -0
- package/dist/player-DcctWhyM.mjs +6599 -0
- package/dist/player.cjs +27 -0
- package/dist/player.d.cts +17 -0
- package/dist/player.d.mts +17 -0
- package/dist/player.mjs +1 -0
- package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
- package/dist/util.cjs +9 -10
- package/dist/util.d.cts +20 -13
- package/dist/util.d.mts +20 -13
- package/dist/util.mjs +4 -6
- package/package.json +45 -5
- package/dist/index-DBbxKcc1.d.mts +0 -3051
- package/dist/logger-ByDB8lYF.mjs +0 -56
- package/dist/logger-dEoueCj7.d.cts +0 -35
- package/dist/logger-dEoueCj7.d.mts +0 -35
|
@@ -1,3051 +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
|
-
* Prior-object state threaded across successive Fetch Objects on the same stream.
|
|
950
|
-
*/
|
|
951
|
-
type FetchObjectContext = {
|
|
952
|
-
groupId: bigint;
|
|
953
|
-
subgroupId: bigint;
|
|
954
|
-
objectId: bigint;
|
|
955
|
-
publisherPriority: number;
|
|
956
|
-
};
|
|
957
|
-
/**
|
|
958
|
-
* Kind discriminator for End-of-Range markers (§11.5).
|
|
959
|
-
*/
|
|
960
|
-
declare enum EndOfRangeKind {
|
|
961
|
-
NonExistent = 140,
|
|
962
|
-
Unknown = 268
|
|
963
|
-
}
|
|
964
|
-
/**
|
|
965
|
-
* Payload-bearing fetch object (§11.5, non-End-of-Range form).
|
|
966
|
-
*
|
|
967
|
-
* FETCH objects carry no Object Status field; a zero-length payload
|
|
968
|
-
* signals a zero-length Normal object.
|
|
969
|
-
*/
|
|
970
|
-
declare class FetchObject {
|
|
971
|
-
readonly kind: 'object' | 'end_of_range';
|
|
972
|
-
readonly publisherPriority: number;
|
|
973
|
-
readonly forwardingPreference: ObjectForwardingPreference;
|
|
974
|
-
readonly properties: KeyValuePair[] | null;
|
|
975
|
-
readonly payload: Uint8Array | null;
|
|
976
|
-
readonly endOfRange: EndOfRangeKind | null;
|
|
977
|
-
readonly location: Location;
|
|
978
|
-
readonly subgroupId: bigint;
|
|
979
|
-
private constructor();
|
|
980
|
-
get groupId(): bigint;
|
|
981
|
-
get objectId(): bigint;
|
|
982
|
-
/**
|
|
983
|
-
* Context to thread into the next call on this stream.
|
|
984
|
-
* Returns null for EndOfRange markers — they MUST NOT update prior state.
|
|
985
|
-
*/
|
|
986
|
-
toContext(): FetchObjectContext | null;
|
|
987
|
-
static newObject(groupId: bigint | number, subgroupId: bigint | number, objectId: bigint | number, publisherPriority: number, forwardingPreference: ObjectForwardingPreference, properties: KeyValuePair[] | null, payload: Uint8Array): FetchObject;
|
|
988
|
-
static newEndOfRange(kind: EndOfRangeKind, groupId: bigint | number, objectId: bigint | number): FetchObject;
|
|
989
|
-
serialize(prev?: FetchObjectContext, groupOrder?: GroupOrder): FrozenByteBuffer;
|
|
990
|
-
static deserialize(buf: BaseByteBuffer, prev?: FetchObjectContext, groupOrder?: GroupOrder): FetchObject;
|
|
991
|
-
}
|
|
992
|
-
//#endregion
|
|
993
|
-
//#region src/model/data/full_track_name.d.ts
|
|
994
|
-
declare const MAX_NAMESPACE_TUPLE_COUNT = 32;
|
|
995
|
-
declare const MAX_FULL_TRACK_NAME_LENGTH = 4096;
|
|
996
|
-
/**
|
|
997
|
-
* Fully-qualified track identifier = hierarchical namespace (tuple) + leaf name bytes.
|
|
998
|
-
*
|
|
999
|
-
* Constraints enforced (throws {@link TrackNameError}):
|
|
1000
|
-
* - Namespace tuple field count: 0 .. {@link MAX_NAMESPACE_TUPLE_COUNT} (an empty namespace is legal).
|
|
1001
|
-
* - Total serialized length (namespace tuple + raw name bytes) less than or equals {@link MAX_FULL_TRACK_NAME_LENGTH} bytes.
|
|
1002
|
-
*
|
|
1003
|
-
* Namespace input may be:
|
|
1004
|
-
* - `string` path with segments separated by `/` (converted via {@link Tuple.fromUtf8Path}). Empty segments are dropped,
|
|
1005
|
-
* so `''` and `'/'` both yield a zero-element namespace.
|
|
1006
|
-
* - Existing {@link Tuple} instance.
|
|
1007
|
-
*
|
|
1008
|
-
* Name input may be:
|
|
1009
|
-
* - UTF-8 string (encoded)
|
|
1010
|
-
* - Raw `Uint8Array` (used directly)
|
|
1011
|
-
*
|
|
1012
|
-
* Instances are created via {@link FullTrackName.tryNew} (validates) or {@link FullTrackName.deserialize}.
|
|
1013
|
-
* Use {@link FullTrackName.serialize} for wire encoding and {@link FullTrackName.toString} for a human friendly
|
|
1014
|
-
* diagnostic format: `namespace/segments:hexname` (name rendered as lowercase hex, no 0x prefix).
|
|
1015
|
-
*
|
|
1016
|
-
* The string form is intended for logs/debug only; do not parse it for protocol operations.
|
|
1017
|
-
*/
|
|
1018
|
-
declare class FullTrackName {
|
|
1019
|
-
readonly namespace: Tuple;
|
|
1020
|
-
readonly name: Uint8Array;
|
|
1021
|
-
private constructor();
|
|
1022
|
-
/**
|
|
1023
|
-
* Human-readable representation: `\<namespace path joined by '/'\>:\<name as lowercase hex\>`.
|
|
1024
|
-
* If the underlying {@link Tuple} exposes `toUtf8Path`, it's used; otherwise the raw fields are joined.
|
|
1025
|
-
* This is lossy only in the sense that name bytes are hex encoded; round-tripping requires serialization.
|
|
1026
|
-
*/
|
|
1027
|
-
toString(): string;
|
|
1028
|
-
/**
|
|
1029
|
-
* Construct a validated full track name.
|
|
1030
|
-
*
|
|
1031
|
-
* Validation steps:
|
|
1032
|
-
* 1. Convert namespace string -\> {@link Tuple} (split on '/') if needed.
|
|
1033
|
-
* 2. Reject if namespace tuple field count is \> {@link MAX_NAMESPACE_TUPLE_COUNT}.
|
|
1034
|
-
* 3. Encode name string to UTF-8 if needed.
|
|
1035
|
-
* 4. Reject if total serialized length (namespace tuple + name bytes) \> {@link MAX_FULL_TRACK_NAME_LENGTH}.
|
|
1036
|
-
*
|
|
1037
|
-
* @throws :{@link TrackNameError} on any constraint violation.
|
|
1038
|
-
* @example
|
|
1039
|
-
* ```ts
|
|
1040
|
-
* const full = FullTrackName.tryNew('media/video', 'keyframe')
|
|
1041
|
-
* console.log(full.toString()) // media/video:6b65796672616d65
|
|
1042
|
-
* ```
|
|
1043
|
-
*/
|
|
1044
|
-
static tryNew(namespace: string | Tuple, name: string | Uint8Array): FullTrackName;
|
|
1045
|
-
/**
|
|
1046
|
-
* Serialize to a frozen buffer: tuple (namespace) followed by length‑prefixed name bytes.
|
|
1047
|
-
* Consumers needing raw bytes should call `.toUint8Array()` on the returned {@link FrozenByteBuffer}.
|
|
1048
|
-
*/
|
|
1049
|
-
serialize(): FrozenByteBuffer;
|
|
1050
|
-
/**
|
|
1051
|
-
* Parse a serialized full track name. Performs the same validations as {@link FullTrackName.tryNew}.
|
|
1052
|
-
* The provided buffer's read cursor advances accordingly.
|
|
1053
|
-
* @throws :{@link TrackNameError} if constraints are violated.
|
|
1054
|
-
*/
|
|
1055
|
-
static deserialize(buf: BaseByteBuffer): FullTrackName;
|
|
1056
|
-
}
|
|
1057
|
-
//#endregion
|
|
1058
|
-
//#region src/model/data/subgroup_object.d.ts
|
|
1059
|
-
declare class SubgroupObject {
|
|
1060
|
-
readonly properties: KeyValuePair[] | null;
|
|
1061
|
-
readonly objectStatus: ObjectStatus | null;
|
|
1062
|
-
readonly payload: Uint8Array | null;
|
|
1063
|
-
readonly objectId: bigint;
|
|
1064
|
-
private constructor();
|
|
1065
|
-
static newWithStatus(objectId: bigint | number, properties: KeyValuePair[] | null, objectStatus: ObjectStatus): SubgroupObject;
|
|
1066
|
-
static newWithPayload(objectId: bigint | number, properties: KeyValuePair[] | null, payload: Uint8Array): SubgroupObject;
|
|
1067
|
-
serialize(previousObjectId: bigint | undefined): FrozenByteBuffer;
|
|
1068
|
-
static deserialize(buf: BaseByteBuffer, hasProperties: boolean, previousObjectId: bigint | undefined): SubgroupObject;
|
|
1069
|
-
}
|
|
1070
|
-
//#endregion
|
|
1071
|
-
//#region src/model/data/object.d.ts
|
|
1072
|
-
declare class MoqtObject {
|
|
1073
|
-
readonly fullTrackName: FullTrackName;
|
|
1074
|
-
readonly publisherPriority: number;
|
|
1075
|
-
readonly objectForwardingPreference: ObjectForwardingPreference;
|
|
1076
|
-
readonly objectStatus: ObjectStatus;
|
|
1077
|
-
readonly properties: KeyValuePair[] | null;
|
|
1078
|
-
readonly payload: Uint8Array | null;
|
|
1079
|
-
readonly location: Location;
|
|
1080
|
-
readonly subgroupId: bigint | null;
|
|
1081
|
-
private constructor();
|
|
1082
|
-
get groupId(): bigint;
|
|
1083
|
-
get objectId(): bigint;
|
|
1084
|
-
getSubgroupHeaderType(containsEnd: boolean, useDefaultPriority?: boolean, firstObject?: boolean): SubgroupHeaderType;
|
|
1085
|
-
isDatagram(): boolean;
|
|
1086
|
-
isSubgroup(): boolean;
|
|
1087
|
-
isEndOfGroup(): boolean;
|
|
1088
|
-
isEndOfTrack(): boolean;
|
|
1089
|
-
hasPayload(): boolean;
|
|
1090
|
-
hasStatus(): boolean;
|
|
1091
|
-
static newWithPayload(fullTrackName: FullTrackName, location: Location, publisherPriority: number, objectForwardingPreference: ObjectForwardingPreference, subgroupId: bigint | number | null, properties: KeyValuePair[] | null, payload: Uint8Array): MoqtObject;
|
|
1092
|
-
static newWithStatus(fullTrackName: FullTrackName, location: Location, publisherPriority: number, objectForwardingPreference: ObjectForwardingPreference, subgroupId: bigint | number | null, properties: KeyValuePair[] | null, objectStatus: ObjectStatus): MoqtObject;
|
|
1093
|
-
/**
|
|
1094
|
-
* Create a MoqtObject from a Datagram.
|
|
1095
|
-
* @param datagram - The received Datagram.
|
|
1096
|
-
* @param fullTrackName - The resolved full track name.
|
|
1097
|
-
* @param defaultPriority - The default publisher priority from the control message (used when DEFAULT_PRIORITY bit is set).
|
|
1098
|
-
*/
|
|
1099
|
-
static fromDatagram(datagram: Datagram, fullTrackName: FullTrackName, defaultPriority?: number): MoqtObject;
|
|
1100
|
-
/**
|
|
1101
|
-
* Returns the endOfGroup flag from the source Datagram.
|
|
1102
|
-
* This is separate from ObjectStatus.EndOfGroup - the flag indicates
|
|
1103
|
-
* this is the last object in the group even with Normal status.
|
|
1104
|
-
*/
|
|
1105
|
-
static isDatagramEndOfGroup(datagram: Datagram): boolean;
|
|
1106
|
-
static fromFetchObject(fetchObject: FetchObject, fullTrackName: FullTrackName): MoqtObject;
|
|
1107
|
-
static fromSubgroupObject(subgroupObject: SubgroupObject, groupId: bigint | number, publisherPriority: number | undefined, subgroupId: bigint | number | null, fullTrackName: FullTrackName): MoqtObject;
|
|
1108
|
-
/**
|
|
1109
|
-
* Convert to Datagram for wire transmission.
|
|
1110
|
-
* Automatically creates a payload or status Datagram based on the object's state.
|
|
1111
|
-
* @param trackAlias - The track alias to use.
|
|
1112
|
-
* @param endOfGroup - Whether this is the last object in the group (only for payload datagrams).
|
|
1113
|
-
* @param defaultPriority - If provided and matches this object's priority, the DEFAULT_PRIORITY bit is set.
|
|
1114
|
-
*/
|
|
1115
|
-
tryIntoDatagram(trackAlias: bigint | number, endOfGroup?: boolean, defaultPriority?: number): Datagram;
|
|
1116
|
-
tryIntoFetchObject(): FetchObject;
|
|
1117
|
-
tryIntoSubgroupObject(): SubgroupObject;
|
|
1118
|
-
}
|
|
1119
|
-
//#endregion
|
|
1120
|
-
//#region src/model/data/subgroup_header.d.ts
|
|
1121
|
-
declare class SubgroupHeader {
|
|
1122
|
-
readonly type: SubgroupHeaderType;
|
|
1123
|
-
readonly publisherPriority: number | undefined;
|
|
1124
|
-
/**
|
|
1125
|
-
* Absent on the wire, and still unknown here, when the type says the Subgroup ID
|
|
1126
|
-
* is the first Object ID: that object has not been read yet at header time.
|
|
1127
|
-
* `resolveSubgroupId` fills it in, so consumers can read this rather than each
|
|
1128
|
-
* deriving it again.
|
|
1129
|
-
*/
|
|
1130
|
-
subgroupId: bigint | undefined;
|
|
1131
|
-
readonly trackAlias: bigint;
|
|
1132
|
-
readonly groupId: bigint;
|
|
1133
|
-
constructor(type: SubgroupHeaderType, trackAlias: bigint | number, groupId: bigint | number, subgroupId: bigint | number | undefined, publisherPriority: number | undefined);
|
|
1134
|
-
serialize(): FrozenByteBuffer;
|
|
1135
|
-
static deserialize(buf: BaseByteBuffer): SubgroupHeader;
|
|
1136
|
-
/**
|
|
1137
|
-
* Name this subgroup from the first object read off its stream, for the header
|
|
1138
|
-
* type that defers the Subgroup ID to it. Ignored for every other type, and for
|
|
1139
|
-
* a header already named, so later objects on the stream cannot rename it.
|
|
1140
|
-
*/
|
|
1141
|
-
resolveSubgroupId(firstObjectId: bigint): void;
|
|
1142
|
-
}
|
|
1143
|
-
//#endregion
|
|
1144
|
-
//#region src/model/data/request_id.d.ts
|
|
1145
|
-
/**
|
|
1146
|
-
* A bidirectional map between requestId (bigint) and full track names.
|
|
1147
|
-
* Used to efficiently look up either by requestId or by name, enforcing uniqueness.
|
|
1148
|
-
*
|
|
1149
|
-
* @public
|
|
1150
|
-
*/
|
|
1151
|
-
declare class RequestIdMap {
|
|
1152
|
-
private requestIdToName;
|
|
1153
|
-
private nameToRequestId;
|
|
1154
|
-
/**
|
|
1155
|
-
* @public
|
|
1156
|
-
* Adds a mapping between a requestId and a full track name.
|
|
1157
|
-
*
|
|
1158
|
-
* @param requestId - The requestId to associate.
|
|
1159
|
-
* @param name - The full track name to associate.
|
|
1160
|
-
* @throws :{@link RequestIdError} if the requestId or name is already mapped to a different value.
|
|
1161
|
-
*/
|
|
1162
|
-
addMapping(requestId: bigint, name: FullTrackName): void;
|
|
1163
|
-
/**
|
|
1164
|
-
* @public
|
|
1165
|
-
* Gets the full track name for a given requestId.
|
|
1166
|
-
*
|
|
1167
|
-
* @param requestId - The requestId to look up.
|
|
1168
|
-
* @returns The associated full track name.
|
|
1169
|
-
* @throws :{@link RequestIdError} if the requestId does not exist.
|
|
1170
|
-
*/
|
|
1171
|
-
getNameByRequestId(requestId: bigint): FullTrackName;
|
|
1172
|
-
/**
|
|
1173
|
-
* @public
|
|
1174
|
-
* Gets the requestId for a given full track name.
|
|
1175
|
-
*
|
|
1176
|
-
* @param name - The full track name to look up.
|
|
1177
|
-
* @returns The associated requestId.
|
|
1178
|
-
* @throws :{@link RequestIdError} if the name does not exist.
|
|
1179
|
-
*/
|
|
1180
|
-
getRequestIdByName(name: FullTrackName): bigint;
|
|
1181
|
-
/**
|
|
1182
|
-
* @public
|
|
1183
|
-
* Removes a mapping by requestId.
|
|
1184
|
-
*
|
|
1185
|
-
* @param requestId - The requestId to remove.
|
|
1186
|
-
* @returns The removed full track name, or undefined if not found.
|
|
1187
|
-
*/
|
|
1188
|
-
removeMappingByRequestId(requestId: bigint): FullTrackName | undefined;
|
|
1189
|
-
/**
|
|
1190
|
-
* @public
|
|
1191
|
-
* Removes a mapping by full track name.
|
|
1192
|
-
*
|
|
1193
|
-
* @param name - The full track name to remove.
|
|
1194
|
-
* @returns The removed requestId, or undefined if not found.
|
|
1195
|
-
*/
|
|
1196
|
-
removeMappingByName(name: FullTrackName): bigint | undefined;
|
|
1197
|
-
/**
|
|
1198
|
-
* @public
|
|
1199
|
-
* Checks if the map contains a given requestId.
|
|
1200
|
-
*
|
|
1201
|
-
* @param requestId - The requestId to check.
|
|
1202
|
-
* @returns True if the requestId exists, false otherwise.
|
|
1203
|
-
*/
|
|
1204
|
-
containsRequestId(requestId: bigint): boolean;
|
|
1205
|
-
/**
|
|
1206
|
-
* @public
|
|
1207
|
-
* Checks if the map contains a given full track name.
|
|
1208
|
-
*
|
|
1209
|
-
* @param name - The full track name to check.
|
|
1210
|
-
* @returns True if the name exists, false otherwise.
|
|
1211
|
-
*/
|
|
1212
|
-
containsName(name: FullTrackName): boolean;
|
|
1213
|
-
}
|
|
1214
|
-
//#endregion
|
|
1215
|
-
//#region src/model/data/header.d.ts
|
|
1216
|
-
type Header = FetchHeader | SubgroupHeader;
|
|
1217
|
-
declare namespace Header {
|
|
1218
|
-
function newFetch(...args: ConstructorParameters<typeof FetchHeader>): Header;
|
|
1219
|
-
function newSubgroup(...args: ConstructorParameters<typeof SubgroupHeader>): Header;
|
|
1220
|
-
function isFetch(header: Header): header is FetchHeader;
|
|
1221
|
-
function isSubgroup(header: Header): header is SubgroupHeader;
|
|
1222
|
-
function serialize(header: Header): FrozenByteBuffer;
|
|
1223
|
-
function deserialize(buf: BaseByteBuffer): Header;
|
|
1224
|
-
}
|
|
1225
|
-
//#endregion
|
|
1226
|
-
//#region src/model/common/byte_buffer.d.ts
|
|
1227
|
-
declare abstract class BaseByteBuffer {
|
|
1228
|
-
protected buf: Uint8Array;
|
|
1229
|
-
protected view: DataView;
|
|
1230
|
-
protected _offset: number;
|
|
1231
|
-
protected _checkpoint: number;
|
|
1232
|
-
constructor(buf: Uint8Array);
|
|
1233
|
-
get offset(): number;
|
|
1234
|
-
abstract get length(): number;
|
|
1235
|
-
get remaining(): number;
|
|
1236
|
-
/**
|
|
1237
|
-
* Save current read position for potential rollback
|
|
1238
|
-
*/
|
|
1239
|
-
checkpoint(): void;
|
|
1240
|
-
/**
|
|
1241
|
-
* Restore read position to last checkpoint
|
|
1242
|
-
*/
|
|
1243
|
-
restore(): void;
|
|
1244
|
-
toUint8Array(): Uint8Array;
|
|
1245
|
-
getU8(): number;
|
|
1246
|
-
getU16(): number;
|
|
1247
|
-
getVI(): bigint;
|
|
1248
|
-
countLeadingOnes(byte: number): number;
|
|
1249
|
-
firstByteValueBits(first: number, length: number): bigint;
|
|
1250
|
-
getNumberVI(): number;
|
|
1251
|
-
getBytes(len: number): Uint8Array;
|
|
1252
|
-
getLengthPrefixedBytes(): Uint8Array;
|
|
1253
|
-
getKeyValuePair(): KeyValuePair;
|
|
1254
|
-
getReasonPhrase(): ReasonPhrase;
|
|
1255
|
-
getLocation(): Location;
|
|
1256
|
-
getTuple(): Tuple;
|
|
1257
|
-
getFullTrackName(): FullTrackName;
|
|
1258
|
-
}
|
|
1259
|
-
declare class ByteBuffer extends BaseByteBuffer {
|
|
1260
|
-
private _length;
|
|
1261
|
-
constructor(initialSize?: number);
|
|
1262
|
-
get length(): number;
|
|
1263
|
-
/**
|
|
1264
|
-
* Clear all data and reset all positions
|
|
1265
|
-
*/
|
|
1266
|
-
clear(): void;
|
|
1267
|
-
/**
|
|
1268
|
-
* Drop all data before current offset and reset positions
|
|
1269
|
-
* This is the key method for memory management - removes processed data
|
|
1270
|
-
*/
|
|
1271
|
-
commit(): void;
|
|
1272
|
-
private ensureCapacity;
|
|
1273
|
-
putU8(v: number): void;
|
|
1274
|
-
putU16(v: number): void;
|
|
1275
|
-
/**
|
|
1276
|
-
/**
|
|
1277
|
-
* Encode a MOQT varint using the minimal length.
|
|
1278
|
-
*/
|
|
1279
|
-
putVI(v: bigint | number): void;
|
|
1280
|
-
putBytes(src: Uint8Array): void;
|
|
1281
|
-
putLengthPrefixedBytes(src: Uint8Array): void;
|
|
1282
|
-
putKeyValuePair(pair: KeyValuePair): void;
|
|
1283
|
-
putReasonPhrase(reason: ReasonPhrase): void;
|
|
1284
|
-
toUint8Array(): Uint8Array;
|
|
1285
|
-
freeze(): FrozenByteBuffer;
|
|
1286
|
-
putLocation(loc: Location): void;
|
|
1287
|
-
putTuple(tuple: Tuple): void;
|
|
1288
|
-
putFullTrackName(fullTrackName: FullTrackName): void;
|
|
1289
|
-
}
|
|
1290
|
-
declare class FrozenByteBuffer extends BaseByteBuffer {
|
|
1291
|
-
constructor(buf: Uint8Array);
|
|
1292
|
-
get length(): number;
|
|
1293
|
-
}
|
|
1294
|
-
//#endregion
|
|
1295
|
-
//#region src/model/control/publish_skipped.d.ts
|
|
1296
|
-
/**
|
|
1297
|
-
* @public
|
|
1298
|
-
* PUBLISH_SKIPPED (0xF): a publisher tells the peer it cannot send the PUBLISH that
|
|
1299
|
-
* would start a subscription to a track under a SUBSCRIBE_TRACKS namespace.
|
|
1300
|
-
*
|
|
1301
|
-
* Sent on the SUBSCRIBE_TRACKS response stream, so only the namespace suffix after that
|
|
1302
|
-
* subscription's prefix is carried.
|
|
1303
|
-
*/
|
|
1304
|
-
declare class PublishSkipped {
|
|
1305
|
-
readonly trackNamespaceSuffix: Tuple;
|
|
1306
|
-
readonly trackName: Uint8Array;
|
|
1307
|
-
constructor(trackNamespaceSuffix: Tuple, trackName: Uint8Array);
|
|
1308
|
-
getType(): ControlMessageType;
|
|
1309
|
-
serialize(): FrozenByteBuffer;
|
|
1310
|
-
static parsePayload(buf: BaseByteBuffer): PublishSkipped;
|
|
1311
|
-
}
|
|
1312
|
-
//#endregion
|
|
1313
|
-
//#region src/model/parameter/constant.d.ts
|
|
1314
|
-
/**
|
|
1315
|
-
* Copyright 2026 The MOQtail Authors
|
|
1316
|
-
*
|
|
1317
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1318
|
-
* you may not use this file except in compliance with the License.
|
|
1319
|
-
* You may obtain a copy of the License at
|
|
1320
|
-
*
|
|
1321
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1322
|
-
*
|
|
1323
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1324
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1325
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1326
|
-
* See the License for the specific language governing permissions and
|
|
1327
|
-
* limitations under the License.
|
|
1328
|
-
*/
|
|
1329
|
-
declare enum SetupOptionType {
|
|
1330
|
-
Path = 1,
|
|
1331
|
-
AuthorizationToken = 3,
|
|
1332
|
-
MaxAuthTokenCacheSize = 4,
|
|
1333
|
-
/** Raw-QUIC only. Client-only; MUST NOT be sent over WebTransport. */
|
|
1334
|
-
Authority = 5,
|
|
1335
|
-
MaxFilterRanges = 6,
|
|
1336
|
-
MoqtImplementation = 7,
|
|
1337
|
-
MaxRequestUpdates = 8,
|
|
1338
|
-
/**
|
|
1339
|
-
* PROVISIONAL: sender-side track switching is not an adopted extension, so this
|
|
1340
|
-
* codepoint is absent from the registry the conformance fixture tracks. It sits in the
|
|
1341
|
-
* 0x07-0x7F range of this space, which that registry leaves free.
|
|
1342
|
-
*/
|
|
1343
|
-
SstsAlgorithms = 9
|
|
1344
|
-
}
|
|
1345
|
-
declare function setupOptionTypeFromNumber(value: number): SetupOptionType;
|
|
1346
|
-
declare enum MessageParameterType {
|
|
1347
|
-
ObjectDeliveryTimeout = 2,
|
|
1348
|
-
AuthorizationToken = 3,
|
|
1349
|
-
RendezvousTimeout = 4,
|
|
1350
|
-
SubgroupDeliveryTimeout = 6,
|
|
1351
|
-
Expires = 8,
|
|
1352
|
-
LargestObject = 9,
|
|
1353
|
-
FillTimeout = 10,
|
|
1354
|
-
Forward = 16,
|
|
1355
|
-
SubscriberPriority = 32,
|
|
1356
|
-
LocationFilter = 33,
|
|
1357
|
-
GroupOrder = 34,
|
|
1358
|
-
FillParameters = 35,
|
|
1359
|
-
SwitchFrom = 36,
|
|
1360
|
-
SubgroupFilter = 37,
|
|
1361
|
-
ObjectIdFilter = 38,
|
|
1362
|
-
PriorityFilter = 39,
|
|
1363
|
-
ObjectPropertyFilter = 40,
|
|
1364
|
-
TrackPropertyFilter = 41,
|
|
1365
|
-
NewGroupRequest = 50,
|
|
1366
|
-
/**
|
|
1367
|
-
* Registered codepoint with no typed parameter yet: its consumer is REQUEST_UPDATE for
|
|
1368
|
-
* SUBSCRIBE_TRACKS (TS-11), and the value is a Track Namespace tuple rather than the
|
|
1369
|
-
* varint its even Type implies.
|
|
1370
|
-
*/
|
|
1371
|
-
TrackNamespacePrefix = 52,
|
|
1372
|
-
IncludeProperties = 53,
|
|
1373
|
-
/**
|
|
1374
|
-
* PROVISIONAL: sender-side track switching is not an adopted extension, so this
|
|
1375
|
-
* codepoint is absent from the registry the conformance fixture tracks; see its
|
|
1376
|
-
* `local_extensions`.
|
|
1377
|
-
*/
|
|
1378
|
-
SwitchingSetAssignment = 65
|
|
1379
|
-
}
|
|
1380
|
-
declare function messageParameterTypeFromNumber(value: bigint | number): MessageParameterType;
|
|
1381
|
-
declare enum TokenAliasType {
|
|
1382
|
-
Delete = 0,
|
|
1383
|
-
Register = 1,
|
|
1384
|
-
UseAlias = 2,
|
|
1385
|
-
UseValue = 3
|
|
1386
|
-
}
|
|
1387
|
-
declare function tokenAliasTypeFromNumber(value: number): TokenAliasType;
|
|
1388
|
-
//#endregion
|
|
1389
|
-
//#region src/model/parameter/parameter.d.ts
|
|
1390
|
-
interface Parameter {
|
|
1391
|
-
toKeyValuePair(): KeyValuePair;
|
|
1392
|
-
}
|
|
1393
|
-
//#endregion
|
|
1394
|
-
//#region src/model/parameter/common/authorization_token.d.ts
|
|
1395
|
-
type AuthTokenVariant = {
|
|
1396
|
-
aliasType: TokenAliasType.Delete;
|
|
1397
|
-
tokenAlias: bigint;
|
|
1398
|
-
} | {
|
|
1399
|
-
aliasType: TokenAliasType.Register;
|
|
1400
|
-
tokenAlias: bigint;
|
|
1401
|
-
tokenType: bigint;
|
|
1402
|
-
tokenValue: Uint8Array;
|
|
1403
|
-
} | {
|
|
1404
|
-
aliasType: TokenAliasType.UseAlias;
|
|
1405
|
-
tokenAlias: bigint;
|
|
1406
|
-
} | {
|
|
1407
|
-
aliasType: TokenAliasType.UseValue;
|
|
1408
|
-
tokenType: bigint;
|
|
1409
|
-
tokenValue: Uint8Array;
|
|
1410
|
-
};
|
|
1411
|
-
declare class AuthorizationToken implements Parameter {
|
|
1412
|
-
readonly variant: AuthTokenVariant;
|
|
1413
|
-
static readonly TYPE = MessageParameterType.AuthorizationToken;
|
|
1414
|
-
private constructor();
|
|
1415
|
-
static newDelete(tokenAlias: bigint | number): AuthorizationToken;
|
|
1416
|
-
static newRegister(tokenAlias: bigint | number, tokenType: bigint | number, tokenValue: Uint8Array): AuthorizationToken;
|
|
1417
|
-
static newUseAlias(tokenAlias: bigint | number): AuthorizationToken;
|
|
1418
|
-
static newUseValue(tokenType: bigint | number, tokenValue: Uint8Array): AuthorizationToken;
|
|
1419
|
-
toKeyValuePair(): KeyValuePair;
|
|
1420
|
-
static fromKeyValuePair(pair: KeyValuePair): AuthorizationToken | undefined;
|
|
1421
|
-
}
|
|
1422
|
-
//#endregion
|
|
1423
|
-
//#region src/model/parameter/message/fill_timeout.d.ts
|
|
1424
|
-
/**
|
|
1425
|
-
* Duration in milliseconds a relay SHOULD wait for objects it does not yet hold before
|
|
1426
|
-
* ending the FETCH. FETCH only (§10.2.5).
|
|
1427
|
-
*/
|
|
1428
|
-
declare class FillTimeout implements Parameter {
|
|
1429
|
-
readonly timeout: bigint;
|
|
1430
|
-
static readonly TYPE = MessageParameterType.FillTimeout;
|
|
1431
|
-
constructor(timeout: bigint);
|
|
1432
|
-
toKeyValuePair(): KeyValuePair;
|
|
1433
|
-
static fromKeyValuePair(pair: KeyValuePair): FillTimeout | undefined;
|
|
1434
|
-
}
|
|
1435
|
-
//#endregion
|
|
1436
|
-
//#region src/model/parameter/message/object_delivery_timeout.d.ts
|
|
1437
|
-
/**
|
|
1438
|
-
* Duration in milliseconds the relay SHOULD continue to attempt forwarding an Object.
|
|
1439
|
-
* A value of 0 means no timeout is set (§8).
|
|
1440
|
-
* This parameter is subscription-specific and SHOULD NOT be forwarded upstream
|
|
1441
|
-
* by a relay serving multiple subscriptions for the same track.
|
|
1442
|
-
*/
|
|
1443
|
-
declare class ObjectDeliveryTimeout implements Parameter {
|
|
1444
|
-
readonly timeout: bigint;
|
|
1445
|
-
static readonly TYPE = MessageParameterType.ObjectDeliveryTimeout;
|
|
1446
|
-
constructor(timeout: bigint);
|
|
1447
|
-
toKeyValuePair(): KeyValuePair;
|
|
1448
|
-
static fromKeyValuePair(pair: KeyValuePair): ObjectDeliveryTimeout | undefined;
|
|
1449
|
-
}
|
|
1450
|
-
//#endregion
|
|
1451
|
-
//#region src/model/parameter/message/rendezvous_timeout.d.ts
|
|
1452
|
-
/**
|
|
1453
|
-
* Duration in milliseconds a relay SHOULD wait for a publisher of a track that has none
|
|
1454
|
-
* before answering the SUBSCRIBE. SUBSCRIBE only (§10.2.6).
|
|
1455
|
-
*/
|
|
1456
|
-
declare class RendezvousTimeout implements Parameter {
|
|
1457
|
-
readonly timeout: bigint;
|
|
1458
|
-
static readonly TYPE = MessageParameterType.RendezvousTimeout;
|
|
1459
|
-
constructor(timeout: bigint);
|
|
1460
|
-
toKeyValuePair(): KeyValuePair;
|
|
1461
|
-
static fromKeyValuePair(pair: KeyValuePair): RendezvousTimeout | undefined;
|
|
1462
|
-
}
|
|
1463
|
-
//#endregion
|
|
1464
|
-
//#region src/model/parameter/message/subgroup_delivery_timeout.d.ts
|
|
1465
|
-
/**
|
|
1466
|
-
* Duration in milliseconds the relay SHOULD continue to attempt forwarding a Subgroup.
|
|
1467
|
-
* A value of 0 means no timeout is set (§8).
|
|
1468
|
-
*/
|
|
1469
|
-
declare class SubgroupDeliveryTimeout implements Parameter {
|
|
1470
|
-
readonly timeout: bigint;
|
|
1471
|
-
static readonly TYPE = MessageParameterType.SubgroupDeliveryTimeout;
|
|
1472
|
-
constructor(timeout: bigint);
|
|
1473
|
-
toKeyValuePair(): KeyValuePair;
|
|
1474
|
-
static fromKeyValuePair(pair: KeyValuePair): SubgroupDeliveryTimeout | undefined;
|
|
1475
|
-
}
|
|
1476
|
-
//#endregion
|
|
1477
|
-
//#region src/model/parameter/message/expires.d.ts
|
|
1478
|
-
/**
|
|
1479
|
-
* Time in milliseconds after which the sender will terminate the subscription.
|
|
1480
|
-
* A value of 0 means the subscription does not expire or expires at an unknown time.
|
|
1481
|
-
* The receiver can extend the subscription by sending a REQUEST_UPDATE.
|
|
1482
|
-
*/
|
|
1483
|
-
declare class Expires implements Parameter {
|
|
1484
|
-
readonly expires: bigint;
|
|
1485
|
-
static readonly TYPE = MessageParameterType.Expires;
|
|
1486
|
-
constructor(expires: bigint);
|
|
1487
|
-
toKeyValuePair(): KeyValuePair;
|
|
1488
|
-
static fromKeyValuePair(pair: KeyValuePair): Expires | undefined;
|
|
1489
|
-
}
|
|
1490
|
-
//#endregion
|
|
1491
|
-
//#region src/model/parameter/message/forward.d.ts
|
|
1492
|
-
/**
|
|
1493
|
-
* Forwarding state for affected subscriptions.
|
|
1494
|
-
* Allowed wire values: 0 (don't forward) or 1 (forward).
|
|
1495
|
-
* Any other value is a PROTOCOL_VIOLATION.
|
|
1496
|
-
* Default (when omitted) is 1 (forward).
|
|
1497
|
-
*/
|
|
1498
|
-
declare class Forward implements Parameter {
|
|
1499
|
-
readonly forward: boolean;
|
|
1500
|
-
static readonly TYPE = MessageParameterType.Forward;
|
|
1501
|
-
constructor(forward: boolean);
|
|
1502
|
-
toKeyValuePair(): KeyValuePair;
|
|
1503
|
-
static fromKeyValuePair(pair: KeyValuePair): Forward | undefined;
|
|
1504
|
-
}
|
|
1505
|
-
//#endregion
|
|
1506
|
-
//#region src/model/parameter/message/include_properties.d.ts
|
|
1507
|
-
/**
|
|
1508
|
-
* Whether the response carries Track Properties: the OK answering a SUBSCRIBE,
|
|
1509
|
-
* TRACK_STATUS or FETCH, or each PUBLISH a SUBSCRIBE_TRACKS brings. With 0 the
|
|
1510
|
-
* Track Properties field is still there, but empty.
|
|
1511
|
-
* Allowed wire values: 0 or 1; any other value is a PROTOCOL_VIOLATION.
|
|
1512
|
-
* Default (when omitted) is 1 (include them).
|
|
1513
|
-
*/
|
|
1514
|
-
declare class IncludeProperties implements Parameter {
|
|
1515
|
-
readonly include: boolean;
|
|
1516
|
-
static readonly TYPE = MessageParameterType.IncludeProperties;
|
|
1517
|
-
constructor(include: boolean);
|
|
1518
|
-
toKeyValuePair(): KeyValuePair;
|
|
1519
|
-
static fromKeyValuePair(pair: KeyValuePair): IncludeProperties | undefined;
|
|
1520
|
-
}
|
|
1521
|
-
//#endregion
|
|
1522
|
-
//#region src/model/parameter/message/group_order_param.d.ts
|
|
1523
|
-
/**
|
|
1524
|
-
* How to prioritize Objects from different groups (Ascending=0x1 or Descending=0x2).
|
|
1525
|
-
* Values outside this range are a PROTOCOL_VIOLATION (Original/0x0 is not a valid wire value).
|
|
1526
|
-
* If omitted from SUBSCRIBE, the publisher's track preference is used.
|
|
1527
|
-
* If omitted from FETCH, Ascending (0x1) is used.
|
|
1528
|
-
*/
|
|
1529
|
-
declare class GroupOrderParam implements Parameter {
|
|
1530
|
-
readonly order: GroupOrder.Ascending | GroupOrder.Descending;
|
|
1531
|
-
static readonly TYPE = MessageParameterType.GroupOrder;
|
|
1532
|
-
constructor(order: GroupOrder.Ascending | GroupOrder.Descending);
|
|
1533
|
-
toKeyValuePair(): KeyValuePair;
|
|
1534
|
-
static fromKeyValuePair(pair: KeyValuePair): GroupOrderParam | undefined;
|
|
1535
|
-
}
|
|
1536
|
-
//#endregion
|
|
1537
|
-
//#region src/model/common/grease.d.ts
|
|
1538
|
-
/**
|
|
1539
|
-
* Copyright 2026 The MOQtail Authors
|
|
1540
|
-
*
|
|
1541
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1542
|
-
* you may not use this file except in compliance with the License.
|
|
1543
|
-
* You may obtain a copy of the License at
|
|
1544
|
-
*
|
|
1545
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1546
|
-
*
|
|
1547
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1548
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1549
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1550
|
-
* See the License for the specific language governing permissions and
|
|
1551
|
-
* limitations under the License.
|
|
1552
|
-
*/
|
|
1553
|
-
/**
|
|
1554
|
-
* GREASE reservations (§14). Values matching `0x7f * N + 0x9D` are reserved across
|
|
1555
|
-
* several registries (Setup Options, Properties, error codes) so peers can emit them
|
|
1556
|
-
* to exercise unknown-value handling. Receivers treat them like any other unknown
|
|
1557
|
-
* value: ignore, never fatal.
|
|
1558
|
-
*/
|
|
1559
|
-
/** Step between successive GREASE values. */
|
|
1560
|
-
declare const GREASE_STEP = 127n;
|
|
1561
|
-
/** The smallest GREASE value (N = 0). */
|
|
1562
|
-
declare const GREASE_BASE = 157n;
|
|
1563
|
-
/**
|
|
1564
|
-
* @public
|
|
1565
|
-
* True if `value` is a reserved GREASE value, i.e. `0x7f * N + 0x9D` for some
|
|
1566
|
-
* non-negative `N`.
|
|
1567
|
-
*/
|
|
1568
|
-
declare function isGrease(value: bigint | number): boolean;
|
|
1569
|
-
/**
|
|
1570
|
-
* @public
|
|
1571
|
-
* The `N`-th GREASE value, `0x7f * N + 0x9D`, or undefined if it would exceed what a
|
|
1572
|
-
* varint can carry (the pattern is capped at `0x3fffffffffffffde`).
|
|
1573
|
-
*/
|
|
1574
|
-
declare function greaseValue(n: bigint | number): bigint | undefined;
|
|
1575
|
-
//#endregion
|
|
1576
|
-
//#region src/model/common/moqt_url.d.ts
|
|
1577
|
-
/**
|
|
1578
|
-
* Copyright 2026 The MOQtail Authors
|
|
1579
|
-
*
|
|
1580
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1581
|
-
* you may not use this file except in compliance with the License.
|
|
1582
|
-
* You may obtain a copy of the License at
|
|
1583
|
-
*
|
|
1584
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1585
|
-
*
|
|
1586
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1587
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1588
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1589
|
-
* See the License for the specific language governing permissions and
|
|
1590
|
-
* limitations under the License.
|
|
1591
|
-
*/
|
|
1592
|
-
/**
|
|
1593
|
-
* @public
|
|
1594
|
-
* A `moqt://` fragment, `#<type>:<value>`. Processed locally and never sent to the
|
|
1595
|
-
* server (§3.1).
|
|
1596
|
-
*/
|
|
1597
|
-
interface MoqtFragment {
|
|
1598
|
-
kind: string;
|
|
1599
|
-
value: string;
|
|
1600
|
-
}
|
|
1601
|
-
/**
|
|
1602
|
-
* @public
|
|
1603
|
-
* A parsed `moqt://authority/path[?query][#fragment]` URI.
|
|
1604
|
-
*
|
|
1605
|
-
* `moqt-URI = "moqt" "://" authority path-abempty [ "?" query ]`, with an optional
|
|
1606
|
-
* local-only fragment. `authority` is `host[:port]`; `path` keeps its leading `/`
|
|
1607
|
-
* (empty when absent); `query` excludes the `?`.
|
|
1608
|
-
*
|
|
1609
|
-
* This is the TypeScript twin of `MoqtUrl` in `apps/client/src/connection.rs`; the two
|
|
1610
|
-
* must agree on what a given URL means.
|
|
1611
|
-
*/
|
|
1612
|
-
declare class MoqtUrl {
|
|
1613
|
-
readonly authority: string;
|
|
1614
|
-
readonly path: string;
|
|
1615
|
-
readonly query: string | undefined;
|
|
1616
|
-
readonly fragment: MoqtFragment | undefined;
|
|
1617
|
-
constructor(authority: string, path: string, query: string | undefined, fragment: MoqtFragment | undefined);
|
|
1618
|
-
static parse(input: string): MoqtUrl;
|
|
1619
|
-
/** The `path[?query]` string carried in the PATH setup option on native QUIC. */
|
|
1620
|
-
pathAndQuery(): string;
|
|
1621
|
-
/** The equivalent `https://` URL for WebTransport, dropping the local fragment. */
|
|
1622
|
-
toHttps(): string;
|
|
1623
|
-
}
|
|
1624
|
-
/**
|
|
1625
|
-
* @public
|
|
1626
|
-
* Resolves a session URL to the URL WebTransport is actually opened with.
|
|
1627
|
-
*
|
|
1628
|
-
* `moqt://` is the scheme callers are meant to use (§3.1); it is mapped to the
|
|
1629
|
-
* equivalent `https://` here because the browser's WebTransport constructor only speaks
|
|
1630
|
-
* HTTP/3. An `https://` input is passed through unchanged so existing callers keep
|
|
1631
|
-
* working. Over WebTransport the authority and path travel in the HTTP CONNECT request,
|
|
1632
|
-
* so neither is repeated as a setup option -- AUTHORITY over WebTransport is a protocol
|
|
1633
|
-
* violation, and PATH would be redundant.
|
|
1634
|
-
*/
|
|
1635
|
-
declare function resolveTransportUrl(url: string | URL): {
|
|
1636
|
-
transportUrl: string;
|
|
1637
|
-
moqtUrl: MoqtUrl | undefined;
|
|
1638
|
-
};
|
|
1639
|
-
//#endregion
|
|
1640
|
-
//#region src/model/common/redirect.d.ts
|
|
1641
|
-
/**
|
|
1642
|
-
* @public
|
|
1643
|
-
* Directs the peer to retry a request at a different URI and/or for a different Full
|
|
1644
|
-
* Track Name (§10.6.1). Carried by a REQUEST_ERROR whose code is `REDIRECT`.
|
|
1645
|
-
*/
|
|
1646
|
-
declare class Redirect {
|
|
1647
|
-
/** Empty, together with an empty {@link Redirect.trackName}, means reuse the original request's track. */
|
|
1648
|
-
readonly trackNamespace: Tuple;
|
|
1649
|
-
/** Empty for namespace-scoped requests, which have no track name to redirect. */
|
|
1650
|
-
readonly trackName: Uint8Array;
|
|
1651
|
-
/** Undefined means reuse the current session's URI. */
|
|
1652
|
-
readonly connectUri: string | undefined;
|
|
1653
|
-
constructor(connectUri: string | undefined, /** Empty, together with an empty {@link Redirect.trackName}, means reuse the original request's track. */
|
|
1654
|
-
|
|
1655
|
-
trackNamespace: Tuple, /** Empty for namespace-scoped requests, which have no track name to redirect. */
|
|
1656
|
-
|
|
1657
|
-
trackName: Uint8Array);
|
|
1658
|
-
/** True when the redirect names no track of its own, so the original request's track carries over. */
|
|
1659
|
-
get keepsOriginalTrack(): boolean;
|
|
1660
|
-
serialize(): FrozenByteBuffer;
|
|
1661
|
-
static deserialize(buf: BaseByteBuffer): Redirect;
|
|
1662
|
-
}
|
|
1663
|
-
//#endregion
|
|
1664
|
-
//#region src/model/parameter/message/largest_object.d.ts
|
|
1665
|
-
/**
|
|
1666
|
-
* The largest Location in the Track observed by the sending endpoint.
|
|
1667
|
-
* If omitted from a message, the sending endpoint has not published or
|
|
1668
|
-
* received any Objects in the Track.
|
|
1669
|
-
*/
|
|
1670
|
-
declare class LargestObject implements Parameter {
|
|
1671
|
-
readonly location: Location;
|
|
1672
|
-
static readonly TYPE = MessageParameterType.LargestObject;
|
|
1673
|
-
constructor(location: Location);
|
|
1674
|
-
toKeyValuePair(): KeyValuePair;
|
|
1675
|
-
static fromKeyValuePair(pair: KeyValuePair): LargestObject | undefined;
|
|
1676
|
-
}
|
|
1677
|
-
//#endregion
|
|
1678
|
-
//#region src/model/parameter/message/new_group_request.d.ts
|
|
1679
|
-
/**
|
|
1680
|
-
* The largest Group ID in the Track known by the subscriber, plus 1.
|
|
1681
|
-
* A value of 0 indicates the subscriber has no Group information for the Track.
|
|
1682
|
-
* Only valid for tracks with the DYNAMIC_GROUPS property (value 1).
|
|
1683
|
-
*/
|
|
1684
|
-
declare class NewGroupRequest implements Parameter {
|
|
1685
|
-
readonly group: bigint;
|
|
1686
|
-
static readonly TYPE = MessageParameterType.NewGroupRequest;
|
|
1687
|
-
constructor(group: bigint);
|
|
1688
|
-
toKeyValuePair(): KeyValuePair;
|
|
1689
|
-
static fromKeyValuePair(pair: KeyValuePair): NewGroupRequest | undefined;
|
|
1690
|
-
}
|
|
1691
|
-
//#endregion
|
|
1692
|
-
//#region src/model/parameter/message/switching_set_assignment.d.ts
|
|
1693
|
-
/**
|
|
1694
|
-
* Assigns a subscription to an SSTS (sender-side track switching) switching
|
|
1695
|
-
* set. Carried on SUBSCRIBE and on the PUBLISH_OK of a pushed track.
|
|
1696
|
-
*
|
|
1697
|
-
* PROVISIONAL: sender-side track switching is not an adopted extension, so
|
|
1698
|
-
* this parameter has no codepoint in the registry the conformance fixture
|
|
1699
|
-
* tracks (`dev/conformance/draft22`) and is never asserted against it. Id 0 is
|
|
1700
|
-
* the default allocation every implementation runs; other ids select an
|
|
1701
|
-
* algorithm specific to one implementation.
|
|
1702
|
-
*/
|
|
1703
|
-
declare class SwitchingSetAssignment implements Parameter {
|
|
1704
|
-
readonly switchingSetId: bigint;
|
|
1705
|
-
readonly algorithmId: bigint;
|
|
1706
|
-
readonly throughputThresholdKbps: bigint;
|
|
1707
|
-
/** Relative bandwidth weight among same-rank sets, 1 through 10. */
|
|
1708
|
-
readonly setThroughputWeight: bigint;
|
|
1709
|
-
/** 0 pauses SSTS for the set; switching activates once the number of assigned tracks reaches this value. */
|
|
1710
|
-
readonly activateSwitching: bigint;
|
|
1711
|
-
/** Degradation priority; lower values are protected first. Default 0. */
|
|
1712
|
-
readonly setRank: number;
|
|
1713
|
-
static readonly TYPE = MessageParameterType.SwitchingSetAssignment;
|
|
1714
|
-
constructor(switchingSetId: bigint, algorithmId: bigint, throughputThresholdKbps: bigint, /** Relative bandwidth weight among same-rank sets, 1 through 10. */
|
|
1715
|
-
|
|
1716
|
-
setThroughputWeight: bigint, /** 0 pauses SSTS for the set; switching activates once the number of assigned tracks reaches this value. */
|
|
1717
|
-
|
|
1718
|
-
activateSwitching: bigint, /** Degradation priority; lower values are protected first. Default 0. */
|
|
1719
|
-
|
|
1720
|
-
setRank?: number);
|
|
1721
|
-
toKeyValuePair(): KeyValuePair;
|
|
1722
|
-
static fromKeyValuePair(pair: KeyValuePair): SwitchingSetAssignment | undefined;
|
|
1723
|
-
}
|
|
1724
|
-
//#endregion
|
|
1725
|
-
//#region src/model/parameter/message/subscriber_priority.d.ts
|
|
1726
|
-
/**
|
|
1727
|
-
* Priority of a subscription relative to others in the same session.
|
|
1728
|
-
* Lower numbers have higher priority. Range: 0-255.
|
|
1729
|
-
* Values outside this range are a PROTOCOL_VIOLATION.
|
|
1730
|
-
* Default (when omitted from SUBSCRIBE, PUBLISH_OK, or FETCH) is 128.
|
|
1731
|
-
*/
|
|
1732
|
-
declare class SubscriberPriority implements Parameter {
|
|
1733
|
-
readonly priority: number;
|
|
1734
|
-
static readonly TYPE = MessageParameterType.SubscriberPriority;
|
|
1735
|
-
constructor(priority: number);
|
|
1736
|
-
toKeyValuePair(): KeyValuePair;
|
|
1737
|
-
static fromKeyValuePair(pair: KeyValuePair): SubscriberPriority | undefined;
|
|
1738
|
-
}
|
|
1739
|
-
//#endregion
|
|
1740
|
-
//#region src/model/parameter/message/location_filter.d.ts
|
|
1741
|
-
/**
|
|
1742
|
-
* The range of Locations a subscription or fetch selects. The Location Filter
|
|
1743
|
-
* Type decides which fields are set, and the value is not length-prefixed.
|
|
1744
|
-
*
|
|
1745
|
-
* Every Group here is absolute, except `startGroup` of a
|
|
1746
|
-
* {@link (LocationFilterType:enum).RelativeStart}, which counts back from the Next
|
|
1747
|
-
* Group: 0 is the Next Group, 1 the current one. The wire carries the End Group
|
|
1748
|
-
* as a delta from the Start Group; that is undone on the way in and redone on
|
|
1749
|
-
* the way out.
|
|
1750
|
-
*
|
|
1751
|
-
* If omitted from SUBSCRIBE or FETCH, the subscription or fetch is unfiltered.
|
|
1752
|
-
* If omitted from REQUEST_UPDATE, the value is unchanged.
|
|
1753
|
-
*/
|
|
1754
|
-
declare class LocationFilter implements Parameter {
|
|
1755
|
-
readonly filterType: LocationFilterType;
|
|
1756
|
-
readonly startGroup?: bigint | undefined;
|
|
1757
|
-
readonly startObject?: bigint | undefined;
|
|
1758
|
-
readonly endGroup?: bigint | undefined;
|
|
1759
|
-
readonly endObject?: bigint | undefined;
|
|
1760
|
-
static readonly TYPE = MessageParameterType.LocationFilter;
|
|
1761
|
-
/**
|
|
1762
|
-
* @throws :{@link ProtocolViolationError} When a field the type calls for is
|
|
1763
|
-
* missing, or the End Group is before the Start Group.
|
|
1764
|
-
*/
|
|
1765
|
-
constructor(filterType: LocationFilterType, startGroup?: bigint | undefined, startObject?: bigint | undefined, endGroup?: bigint | undefined, endObject?: bigint | undefined);
|
|
1766
|
-
/**
|
|
1767
|
-
* The first Location the filter passes, given the track's Largest Object, or
|
|
1768
|
-
* `undefined` when there is no filter. A relative start that would fall before
|
|
1769
|
-
* group 0 is group 0; a track with nothing published yet starts a relative
|
|
1770
|
-
* filter at `{0,0}`.
|
|
1771
|
-
*/
|
|
1772
|
-
startLocation(largest?: Location): Location | undefined;
|
|
1773
|
-
/** The Start Location an absolute filter carries; `undefined` for the others. */
|
|
1774
|
-
get absoluteStart(): Location | undefined;
|
|
1775
|
-
/**
|
|
1776
|
-
* The last Location the filter passes, inclusive, or `undefined` when it is
|
|
1777
|
-
* open-ended. A Group End is the whole of that group, so its Object is 2^64-1.
|
|
1778
|
-
*/
|
|
1779
|
-
endLocation(): Location | undefined;
|
|
1780
|
-
/**
|
|
1781
|
-
* The inclusive range the filter selects under the rules for a Fetch, which
|
|
1782
|
-
* never reach past the Largest Object: an open end is the Largest Object, and
|
|
1783
|
-
* no filter at all is the whole track up to it.
|
|
1784
|
-
*
|
|
1785
|
-
* `undefined` when that range is empty, which includes a track with nothing
|
|
1786
|
-
* published yet and a Next Object filter, whose start is always past the
|
|
1787
|
-
* Largest Object.
|
|
1788
|
-
*/
|
|
1789
|
-
fetchRange(largest?: Location): {
|
|
1790
|
-
start: Location;
|
|
1791
|
-
end: Location;
|
|
1792
|
-
} | undefined;
|
|
1793
|
-
/** The Location Filter Type and its fields, without the Parameter Type. */
|
|
1794
|
-
serializeValue(): Uint8Array;
|
|
1795
|
-
/**
|
|
1796
|
-
* Reads a Location Filter Type and exactly the fields it calls for.
|
|
1797
|
-
* @throws :{@link ProtocolViolationError} For an unknown Location Filter Type,
|
|
1798
|
-
* or an End Group past 2^64-1.
|
|
1799
|
-
*/
|
|
1800
|
-
static deserializeValue(buf: BaseByteBuffer): LocationFilter;
|
|
1801
|
-
toKeyValuePair(): KeyValuePair;
|
|
1802
|
-
static fromKeyValuePair(pair: KeyValuePair): LocationFilter | undefined;
|
|
1803
|
-
}
|
|
1804
|
-
//#endregion
|
|
1805
|
-
//#region src/model/parameter/message/switch_from.d.ts
|
|
1806
|
-
/**
|
|
1807
|
-
* Identifies the subscription being replaced by a switch request.
|
|
1808
|
-
* The value is two varints followed by a flags byte: bit 7 (MSB) is Publish Done;
|
|
1809
|
-
* bits 0 through 6 are reserved and must be zero.
|
|
1810
|
-
*/
|
|
1811
|
-
declare class SwitchFrom implements Parameter {
|
|
1812
|
-
readonly requestId: bigint;
|
|
1813
|
-
readonly mode: SwitchMode;
|
|
1814
|
-
readonly publishDone: boolean;
|
|
1815
|
-
static readonly TYPE = MessageParameterType.SwitchFrom;
|
|
1816
|
-
constructor(requestId: bigint, mode: SwitchMode, publishDone: boolean);
|
|
1817
|
-
toKeyValuePair(): KeyValuePair;
|
|
1818
|
-
static fromKeyValuePair(pair: KeyValuePair): SwitchFrom | undefined;
|
|
1819
|
-
}
|
|
1820
|
-
//#endregion
|
|
1821
|
-
//#region src/model/parameter/message/fill_parameters.d.ts
|
|
1822
|
-
/**
|
|
1823
|
-
* Requests a fill fetch stream, and overrides for it. An omitted parameter keeps
|
|
1824
|
-
* the value it has for the live subscription; an omitted LOCATION_FILTER fills
|
|
1825
|
-
* over the subscription's own.
|
|
1826
|
-
*/
|
|
1827
|
-
declare class FillParameters implements Parameter {
|
|
1828
|
-
readonly parameters: MessageParameter[];
|
|
1829
|
-
static readonly TYPE = MessageParameterType.FillParameters;
|
|
1830
|
-
constructor(parameters: MessageParameter[]);
|
|
1831
|
-
toKeyValuePair(): KeyValuePair;
|
|
1832
|
-
static fromKeyValuePair(pair: KeyValuePair): FillParameters | undefined;
|
|
1833
|
-
}
|
|
1834
|
-
//#endregion
|
|
1835
|
-
//#region src/model/error/error.d.ts
|
|
1836
|
-
/**
|
|
1837
|
-
* Copyright 2025 The MOQtail Authors
|
|
1838
|
-
*
|
|
1839
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1840
|
-
* you may not use this file except in compliance with the License.
|
|
1841
|
-
* You may obtain a copy of the License at
|
|
1842
|
-
*
|
|
1843
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1844
|
-
*
|
|
1845
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1846
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1847
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1848
|
-
* See the License for the specific language governing permissions and
|
|
1849
|
-
* limitations under the License.
|
|
1850
|
-
*/
|
|
1851
|
-
/**
|
|
1852
|
-
* Base class for all MOQtail errors.
|
|
1853
|
-
*/
|
|
1854
|
-
declare class MOQtailError extends Error {
|
|
1855
|
-
constructor(cause?: string);
|
|
1856
|
-
}
|
|
1857
|
-
/**
|
|
1858
|
-
* Not enough bytes in buffer to satisfy a read.
|
|
1859
|
-
*/
|
|
1860
|
-
declare class NotEnoughBytesError extends MOQtailError {
|
|
1861
|
-
context: string;
|
|
1862
|
-
needed: number;
|
|
1863
|
-
available: number;
|
|
1864
|
-
constructor(context: string, needed: number, available: number);
|
|
1865
|
-
}
|
|
1866
|
-
/**
|
|
1867
|
-
* Cannot cast between two incompatible types.
|
|
1868
|
-
*/
|
|
1869
|
-
declare class CastingError extends MOQtailError {
|
|
1870
|
-
context: string;
|
|
1871
|
-
fromType: string;
|
|
1872
|
-
toType: string;
|
|
1873
|
-
details: string;
|
|
1874
|
-
constructor(context: string, fromType: string, toType: string, details: string);
|
|
1875
|
-
}
|
|
1876
|
-
/**
|
|
1877
|
-
* Value too large to encode as varint.
|
|
1878
|
-
*/
|
|
1879
|
-
declare class VarIntOverflowError extends MOQtailError {
|
|
1880
|
-
context: string;
|
|
1881
|
-
value: number;
|
|
1882
|
-
constructor(context: string, value: number);
|
|
1883
|
-
}
|
|
1884
|
-
/**
|
|
1885
|
-
* Length exceeds maximum allowed by protocol.
|
|
1886
|
-
*/
|
|
1887
|
-
declare class LengthExceedsMaxError extends MOQtailError {
|
|
1888
|
-
context: string;
|
|
1889
|
-
max: number;
|
|
1890
|
-
len: number;
|
|
1891
|
-
constructor(context: string, max: number, len: number);
|
|
1892
|
-
}
|
|
1893
|
-
/**
|
|
1894
|
-
* Key/value formatting error.
|
|
1895
|
-
*/
|
|
1896
|
-
declare class KeyValueFormattingError extends MOQtailError {
|
|
1897
|
-
context: string;
|
|
1898
|
-
constructor(context: string);
|
|
1899
|
-
}
|
|
1900
|
-
/**
|
|
1901
|
-
* Invalid discriminant or type tag.
|
|
1902
|
-
*/
|
|
1903
|
-
declare class InvalidTypeError extends MOQtailError {
|
|
1904
|
-
context: string;
|
|
1905
|
-
details: string;
|
|
1906
|
-
constructor(context: string, details: string);
|
|
1907
|
-
}
|
|
1908
|
-
/**
|
|
1909
|
-
* Invalid enum discriminant / value encountered when mapping to a protocol enum.
|
|
1910
|
-
*/
|
|
1911
|
-
declare class InvalidEnumValue extends MOQtailError {
|
|
1912
|
-
context: string;
|
|
1913
|
-
value: bigint | number;
|
|
1914
|
-
constructor(context: string, value: bigint | number);
|
|
1915
|
-
}
|
|
1916
|
-
/**
|
|
1917
|
-
* Invalid UTF-8 encountered in a string or bytes field.
|
|
1918
|
-
*/
|
|
1919
|
-
declare class InvalidUTF8Error extends MOQtailError {
|
|
1920
|
-
context: string;
|
|
1921
|
-
details: string;
|
|
1922
|
-
constructor(context: string, details: string);
|
|
1923
|
-
}
|
|
1924
|
-
/**
|
|
1925
|
-
* Generic protocol violation.
|
|
1926
|
-
*/
|
|
1927
|
-
declare class ProtocolViolationError extends MOQtailError {
|
|
1928
|
-
context: string;
|
|
1929
|
-
details: string;
|
|
1930
|
-
constructor(context: string, details: string);
|
|
1931
|
-
}
|
|
1932
|
-
/**
|
|
1933
|
-
* Track naming error.
|
|
1934
|
-
*/
|
|
1935
|
-
declare class TrackNameError extends MOQtailError {
|
|
1936
|
-
context: string;
|
|
1937
|
-
details: string;
|
|
1938
|
-
constructor(context: string, details: string);
|
|
1939
|
-
}
|
|
1940
|
-
/**
|
|
1941
|
-
* Request ID error.
|
|
1942
|
-
*/
|
|
1943
|
-
declare class RequestIdError extends MOQtailError {
|
|
1944
|
-
context: string;
|
|
1945
|
-
details: string;
|
|
1946
|
-
constructor(context: string, details: string);
|
|
1947
|
-
}
|
|
1948
|
-
/**
|
|
1949
|
-
* Operation timed out.
|
|
1950
|
-
*/
|
|
1951
|
-
declare class TimeoutError extends MOQtailError {
|
|
1952
|
-
context: string;
|
|
1953
|
-
constructor(context: string);
|
|
1954
|
-
}
|
|
1955
|
-
/**
|
|
1956
|
-
* Internal error.
|
|
1957
|
-
*/
|
|
1958
|
-
declare class InternalError extends MOQtailError {
|
|
1959
|
-
context: string;
|
|
1960
|
-
details: string;
|
|
1961
|
-
constructor(context: string, details: string);
|
|
1962
|
-
}
|
|
1963
|
-
/**
|
|
1964
|
-
* Connection terminated.
|
|
1965
|
-
*/
|
|
1966
|
-
declare class TerminationError extends MOQtailError {
|
|
1967
|
-
context: string;
|
|
1968
|
-
terminationCode: number;
|
|
1969
|
-
constructor(context: string, terminationCode: number);
|
|
1970
|
-
}
|
|
1971
|
-
//#endregion
|
|
1972
|
-
//#region src/model/parameter/message/range_filter.d.ts
|
|
1973
|
-
/**
|
|
1974
|
-
* What a Range Filter selects on. Each kind is its own parameter type, and the two
|
|
1975
|
-
* property kinds also name the Property they read.
|
|
1976
|
-
*/
|
|
1977
|
-
declare enum RangeFilterKind {
|
|
1978
|
-
Subgroup = 37,
|
|
1979
|
-
ObjectId = 38,
|
|
1980
|
-
/** Publisher Priority, which is a single byte. */
|
|
1981
|
-
Priority = 39,
|
|
1982
|
-
ObjectProperty = 40,
|
|
1983
|
-
/** Selects tracks rather than Objects, so it only rides SUBSCRIBE_TRACKS. */
|
|
1984
|
-
TrackProperty = 41
|
|
1985
|
-
}
|
|
1986
|
-
declare namespace RangeFilterKind {
|
|
1987
|
-
/** Whether the filter carries a Property Type after its SetID. */
|
|
1988
|
-
function hasPropertyType(kind: RangeFilterKind): boolean;
|
|
1989
|
-
function isRangeFilterType(typeValue: bigint | number): boolean;
|
|
1990
|
-
}
|
|
1991
|
-
/** An inclusive range of values. An open-ended range has no `end`. */
|
|
1992
|
-
interface Range {
|
|
1993
|
-
readonly start: bigint;
|
|
1994
|
-
readonly end?: bigint;
|
|
1995
|
-
}
|
|
1996
|
-
/**
|
|
1997
|
-
* A Range as the wire carries it: the Start as a delta from the End before it, the
|
|
1998
|
-
* End as a delta from its own Start.
|
|
1999
|
-
*/
|
|
2000
|
-
type RangeDelta = readonly [start: bigint, end?: bigint];
|
|
2001
|
-
/**
|
|
2002
|
-
* A Range Filter that cannot be honoured. A peer that sends one is answered with
|
|
2003
|
-
* REQUEST_ERROR INVALID_FILTER rather than a closed session: the request is
|
|
2004
|
-
* well-formed, it just asks for something that cannot be applied.
|
|
2005
|
-
*/
|
|
2006
|
-
declare class InvalidFilterError extends MOQtailError {
|
|
2007
|
-
readonly context: string;
|
|
2008
|
-
readonly details: string;
|
|
2009
|
-
constructor(context: string, details: string);
|
|
2010
|
-
}
|
|
2011
|
-
/**
|
|
2012
|
-
* Delta-encodes ascending `ranges`. Only the last may be open-ended.
|
|
2013
|
-
* @throws :{@link InvalidFilterError} When the ranges do not ascend.
|
|
2014
|
-
*/
|
|
2015
|
-
declare function encodeRanges(ranges: readonly Range[]): RangeDelta[];
|
|
2016
|
-
/**
|
|
2017
|
-
* One Range Filter parameter. Unlike other parameters it may repeat in a message,
|
|
2018
|
-
* once per SetID (and Property Type).
|
|
2019
|
-
*
|
|
2020
|
-
* Without a `setId` it is the zero-length form, which in REQUEST_UPDATE removes the
|
|
2021
|
-
* filters of its kind.
|
|
2022
|
-
*
|
|
2023
|
-
* The Ranges are held as the wire's deltas and only added back by {@link
|
|
2024
|
-
* RangeFilter.ranges}: a sum past 2^64-1 is answered with a REQUEST_ERROR for the
|
|
2025
|
-
* request that carried it, which a parser that rejected it could not do.
|
|
2026
|
-
*/
|
|
2027
|
-
declare class RangeFilter implements Parameter {
|
|
2028
|
-
readonly kind: RangeFilterKind;
|
|
2029
|
-
readonly setId?: number | undefined;
|
|
2030
|
-
readonly propertyType?: bigint | undefined;
|
|
2031
|
-
readonly deltas: readonly RangeDelta[];
|
|
2032
|
-
/**
|
|
2033
|
-
* @throws :{@link ProtocolViolationError} When the Property Type's presence does not
|
|
2034
|
-
* match the kind, or a removal carries anything but its kind.
|
|
2035
|
-
*/
|
|
2036
|
-
constructor(kind: RangeFilterKind, setId?: number | undefined, propertyType?: bigint | undefined, deltas?: readonly RangeDelta[]);
|
|
2037
|
-
/** The zero-length form, which removes the filters of its kind. */
|
|
2038
|
-
get isRemoval(): boolean;
|
|
2039
|
-
/** How many Ranges the filter holds, which is what a peer's range limit counts. */
|
|
2040
|
-
get rangeCount(): number;
|
|
2041
|
-
/**
|
|
2042
|
-
* The Ranges with their deltas added back.
|
|
2043
|
-
* @throws :{@link InvalidFilterError} When a bound exceeds 2^64-1.
|
|
2044
|
-
*/
|
|
2045
|
-
ranges(): Range[];
|
|
2046
|
-
/**
|
|
2047
|
-
* The Ranges, once everything a filter of this kind has to satisfy holds.
|
|
2048
|
-
* @throws :{@link InvalidFilterError} For an odd Property Type, a priority above
|
|
2049
|
-
* 255, or a bound past 2^64-1.
|
|
2050
|
-
*/
|
|
2051
|
-
validate(): Range[];
|
|
2052
|
-
/** The SetID, Property Type if any, and the Ranges, without the Type or Length. */
|
|
2053
|
-
serializeValue(): Uint8Array;
|
|
2054
|
-
toKeyValuePair(): KeyValuePair;
|
|
2055
|
-
/**
|
|
2056
|
-
* Decodes a Range Filter value. The Value ends with the last Range, so a Start
|
|
2057
|
-
* with nothing after it is an open-ended last Range.
|
|
2058
|
-
*/
|
|
2059
|
-
static fromKeyValuePair(pair: KeyValuePair): RangeFilter | undefined;
|
|
2060
|
-
}
|
|
2061
|
-
//#endregion
|
|
2062
|
-
//#region src/model/parameter/message_parameter.d.ts
|
|
2063
|
-
type MessageParameter = ObjectDeliveryTimeout | SubgroupDeliveryTimeout | RendezvousTimeout | FillTimeout | AuthorizationToken | Expires | LargestObject | Forward | SubscriberPriority | GroupOrderParam | LocationFilter | NewGroupRequest | SwitchFrom | FillParameters | RangeFilter | IncludeProperties | SwitchingSetAssignment;
|
|
2064
|
-
declare namespace MessageParameter {
|
|
2065
|
-
/**
|
|
2066
|
-
* Parses a single KeyValuePair into a MessageParameter.
|
|
2067
|
-
* Returns undefined for unrecognized parameter types (be forgiving).
|
|
2068
|
-
* Still throws ProtocolViolationError for known types with invalid values.
|
|
2069
|
-
*/
|
|
2070
|
-
function fromKeyValuePair(pair: KeyValuePair): MessageParameter | undefined;
|
|
2071
|
-
function toKeyValuePair(param: MessageParameter): KeyValuePair;
|
|
2072
|
-
function isObjectDeliveryTimeout(param: MessageParameter): param is ObjectDeliveryTimeout;
|
|
2073
|
-
function isSubgroupDeliveryTimeout(param: MessageParameter): param is SubgroupDeliveryTimeout;
|
|
2074
|
-
function isRendezvousTimeout(param: MessageParameter): param is RendezvousTimeout;
|
|
2075
|
-
function isFillTimeout(param: MessageParameter): param is FillTimeout;
|
|
2076
|
-
function isAuthorizationToken(param: MessageParameter): param is AuthorizationToken;
|
|
2077
|
-
function isExpires(param: MessageParameter): param is Expires;
|
|
2078
|
-
function isLargestObject(param: MessageParameter): param is LargestObject;
|
|
2079
|
-
function isForward(param: MessageParameter): param is Forward;
|
|
2080
|
-
function isSubscriberPriority(param: MessageParameter): param is SubscriberPriority;
|
|
2081
|
-
function isGroupOrderParam(param: MessageParameter): param is GroupOrderParam;
|
|
2082
|
-
function isSwitchingSetAssignment(param: MessageParameter): param is SwitchingSetAssignment;
|
|
2083
|
-
/** The negotiated Group Order, or {@link (GroupOrder:enum).Original} when unparameterized. */
|
|
2084
|
-
function groupOrderOf(params: readonly MessageParameter[]): GroupOrder;
|
|
2085
|
-
function isLocationFilter(param: MessageParameter): param is LocationFilter;
|
|
2086
|
-
function isNewGroupRequest(param: MessageParameter): param is NewGroupRequest;
|
|
2087
|
-
function isSwitchFrom(param: MessageParameter): param is SwitchFrom;
|
|
2088
|
-
function isFillParameters(param: MessageParameter): param is FillParameters;
|
|
2089
|
-
function isRangeFilter(param: MessageParameter): param is RangeFilter;
|
|
2090
|
-
/**
|
|
2091
|
-
* Whether `params` carry a Range Filter, either directly or inside FILL_PARAMETERS,
|
|
2092
|
-
* removals included. An endpoint that allows no filter ranges rejects any of them.
|
|
2093
|
-
*/
|
|
2094
|
-
function carriesRangeFilter(params: readonly MessageParameter[]): boolean;
|
|
2095
|
-
function isIncludeProperties(param: MessageParameter): param is IncludeProperties;
|
|
2096
|
-
/**
|
|
2097
|
-
* The parameters a PUBLISH answering a SUBSCRIBE_TRACKS states: the request's
|
|
2098
|
-
* settings that a PUBLISH can carry (FORWARD, GROUP_ORDER, LOCATION_FILTER), which
|
|
2099
|
-
* are the new subscription's initial settings. AUTHORIZATION_TOKEN is never copied.
|
|
2100
|
-
* The Range Filters, FILL_PARAMETERS and INCLUDE_PROPERTIES cannot go in a PUBLISH;
|
|
2101
|
-
* they are the publisher's to apply.
|
|
2102
|
-
*/
|
|
2103
|
-
function publishParametersFor(subscribeTracks: readonly MessageParameter[]): MessageParameter[];
|
|
2104
|
-
/**
|
|
2105
|
-
* Whether a request's response should carry Track Properties: false only when it
|
|
2106
|
-
* has INCLUDE_PROPERTIES set to 0.
|
|
2107
|
-
*/
|
|
2108
|
-
function includesProperties(params: readonly MessageParameter[]): boolean;
|
|
2109
|
-
}
|
|
2110
|
-
/**
|
|
2111
|
-
* Builder for constructing a list of MessageParameters.
|
|
2112
|
-
* Mirrors the SetupOptions builder pattern.
|
|
2113
|
-
*/
|
|
2114
|
-
declare class MessageParameters {
|
|
2115
|
-
private params;
|
|
2116
|
-
add(param: MessageParameter): this;
|
|
2117
|
-
addObjectDeliveryTimeout(timeout: bigint | number): this;
|
|
2118
|
-
addSubgroupDeliveryTimeout(timeout: bigint | number): this;
|
|
2119
|
-
addRendezvousTimeout(timeout: bigint | number): this;
|
|
2120
|
-
addFillTimeout(timeout: bigint | number): this;
|
|
2121
|
-
addAuthorizationToken(token: AuthorizationToken): this;
|
|
2122
|
-
addExpires(expires: bigint | number): this;
|
|
2123
|
-
addForward(forward: boolean): this;
|
|
2124
|
-
addIncludeProperties(include: boolean): this;
|
|
2125
|
-
addSubscriberPriority(priority: number): this;
|
|
2126
|
-
addGroupOrder(order: GroupOrderParam['order']): this;
|
|
2127
|
-
addLocationFilter(filter: LocationFilter): this;
|
|
2128
|
-
addNewGroupRequest(group: bigint | number): this;
|
|
2129
|
-
addSwitchFrom(requestId: bigint | number, mode: SwitchMode, publishDone: boolean): this;
|
|
2130
|
-
addFillParameters(parameters: MessageParameter[]): this;
|
|
2131
|
-
addRangeFilter(filter: RangeFilter): this;
|
|
2132
|
-
build(): MessageParameter[];
|
|
2133
|
-
/**
|
|
2134
|
-
* Parses an array of KeyValuePairs into a list of MessageParameters.
|
|
2135
|
-
* Unrecognized parameter types are silently skipped.
|
|
2136
|
-
* Known parameter types with invalid values still throw ProtocolViolationError.
|
|
2137
|
-
*/
|
|
2138
|
-
static fromKeyValuePairs(pairs: KeyValuePair[]): MessageParameter[];
|
|
2139
|
-
}
|
|
2140
|
-
/**
|
|
2141
|
-
* Serializes a list of message-parameter KVPs, delta-encoding the Types.
|
|
2142
|
-
* Mirrors {@link serializeKvpList} but honours per-parameter value encodings.
|
|
2143
|
-
*/
|
|
2144
|
-
declare function serializeMessageParameterKvps(items: KeyValuePair[]): FrozenByteBuffer;
|
|
2145
|
-
/**
|
|
2146
|
-
* Reads exactly `count` delta-encoded message-parameter KVPs.
|
|
2147
|
-
* Mirrors {@link deserializeKvpList} but honours per-parameter value encodings.
|
|
2148
|
-
*/
|
|
2149
|
-
declare function deserializeMessageParameterKvps(buf: BaseByteBuffer, count: number | bigint): KeyValuePair[];
|
|
2150
|
-
/**
|
|
2151
|
-
* Applies a set of parameter updates to an existing parameter list.
|
|
2152
|
-
*
|
|
2153
|
-
* A Type the update leaves out keeps its value. A Type it carries is replaced
|
|
2154
|
-
* outright, every instance of it: a Range Filter can repeat, and an update that
|
|
2155
|
-
* names a filter kind states the whole of that kind, so one left over from before
|
|
2156
|
-
* would quietly widen or narrow what the subscriber asked for. A zero-length Range
|
|
2157
|
-
* Filter replaces its kind with nothing.
|
|
2158
|
-
*/
|
|
2159
|
-
declare function applyMessageParameterUpdate(current: MessageParameter[], updates: MessageParameter[]): void;
|
|
2160
|
-
//#endregion
|
|
2161
|
-
//#region src/model/control/publish_namespace.d.ts
|
|
2162
|
-
/**
|
|
2163
|
-
* Represents a protocol PublishNamespace message, used to announce a track and its parameters.
|
|
2164
|
-
*
|
|
2165
|
-
* @public
|
|
2166
|
-
*/
|
|
2167
|
-
declare class PublishNamespace {
|
|
2168
|
-
readonly requestId: bigint;
|
|
2169
|
-
readonly trackNamespace: Tuple;
|
|
2170
|
-
readonly parameters: MessageParameter[];
|
|
2171
|
-
/**
|
|
2172
|
-
* @public
|
|
2173
|
-
* Constructs a PublishNamespace message.
|
|
2174
|
-
*
|
|
2175
|
-
* @param requestId - The request ID for this publish namespace message.
|
|
2176
|
-
* @param trackNamespace - The track namespace as a Tuple.
|
|
2177
|
-
* @param parameters - The list of strongly-typed message parameters for the track.
|
|
2178
|
-
*/
|
|
2179
|
-
constructor(requestId: bigint, trackNamespace: Tuple, parameters: MessageParameter[]);
|
|
2180
|
-
/**
|
|
2181
|
-
* @public
|
|
2182
|
-
* Gets the message type for this PublishNamespace message.
|
|
2183
|
-
*
|
|
2184
|
-
* @returns The ControlMessageType.PublishNamespace value.
|
|
2185
|
-
*/
|
|
2186
|
-
getType(): ControlMessageType;
|
|
2187
|
-
/**
|
|
2188
|
-
* @public
|
|
2189
|
-
* Serializes the PublishNamespace message into a {@link FrozenByteBuffer}.
|
|
2190
|
-
*
|
|
2191
|
-
* @returns The serialized buffer.
|
|
2192
|
-
* @throws :{@link LengthExceedsMaxError} If the payload exceeds 65535 bytes.
|
|
2193
|
-
*/
|
|
2194
|
-
serialize(): FrozenByteBuffer;
|
|
2195
|
-
/**
|
|
2196
|
-
* @public
|
|
2197
|
-
* Parses a PublishNamespace message from the given buffer.
|
|
2198
|
-
*
|
|
2199
|
-
* @param buf - The buffer to parse from.
|
|
2200
|
-
* @returns The parsed PublishNamespace message.
|
|
2201
|
-
* @throws :{@link NotEnoughBytesError} If the buffer does not contain enough bytes.
|
|
2202
|
-
*/
|
|
2203
|
-
static parsePayload(buf: BaseByteBuffer): PublishNamespace;
|
|
2204
|
-
}
|
|
2205
|
-
//#endregion
|
|
2206
|
-
//#region src/model/control/namespace.d.ts
|
|
2207
|
-
/**
|
|
2208
|
-
* @public
|
|
2209
|
-
* Represents a NAMESPACE message sent on a SUBSCRIBE_NAMESPACE bi-stream.
|
|
2210
|
-
* Carries the namespace suffix (fields after the subscriber's prefix).
|
|
2211
|
-
*/
|
|
2212
|
-
declare class Namespace {
|
|
2213
|
-
readonly trackNamespaceSuffix: Tuple;
|
|
2214
|
-
constructor(trackNamespaceSuffix: Tuple);
|
|
2215
|
-
getType(): ControlMessageType;
|
|
2216
|
-
serialize(): FrozenByteBuffer;
|
|
2217
|
-
static parsePayload(buf: BaseByteBuffer): Namespace;
|
|
2218
|
-
}
|
|
2219
|
-
//#endregion
|
|
2220
|
-
//#region src/model/control/namespace_done.d.ts
|
|
2221
|
-
/**
|
|
2222
|
-
* @public
|
|
2223
|
-
* Represents a NAMESPACE_DONE message sent on a SUBSCRIBE_NAMESPACE bi-stream.
|
|
2224
|
-
* Signals that a previously announced namespace suffix is no longer available.
|
|
2225
|
-
*/
|
|
2226
|
-
declare class NamespaceDone {
|
|
2227
|
-
readonly trackNamespaceSuffix: Tuple;
|
|
2228
|
-
constructor(trackNamespaceSuffix: Tuple);
|
|
2229
|
-
getType(): ControlMessageType;
|
|
2230
|
-
serialize(): FrozenByteBuffer;
|
|
2231
|
-
static parsePayload(buf: BaseByteBuffer): NamespaceDone;
|
|
2232
|
-
}
|
|
2233
|
-
//#endregion
|
|
2234
|
-
//#region src/model/control/setup.d.ts
|
|
2235
|
-
/**
|
|
2236
|
-
* The first message each endpoint sends on its control stream.
|
|
2237
|
-
*
|
|
2238
|
-
* Both peers send the same message; there are no separate client and server forms and
|
|
2239
|
-
* no version fields, since version negotiation happens over ALPN.
|
|
2240
|
-
*
|
|
2241
|
-
* Some options are client-only (see {@link SetupOptionType}); whether a peer is
|
|
2242
|
-
* allowed to send a given option depends on which side it is and on the transport,
|
|
2243
|
-
* neither of which is knowable here, so that rule is enforced by the caller rather than
|
|
2244
|
-
* by this class.
|
|
2245
|
-
*/
|
|
2246
|
-
declare class Setup {
|
|
2247
|
-
readonly setupOptions: KeyValuePair[];
|
|
2248
|
-
constructor(setupOptions: KeyValuePair[]);
|
|
2249
|
-
getType(): ControlMessageType;
|
|
2250
|
-
serialize(): FrozenByteBuffer;
|
|
2251
|
-
static parsePayload(buf: BaseByteBuffer): Setup;
|
|
2252
|
-
}
|
|
2253
|
-
//#endregion
|
|
2254
|
-
//#region src/model/control/fetch.d.ts
|
|
2255
|
-
declare class Fetch {
|
|
2256
|
-
readonly requestId: bigint;
|
|
2257
|
-
readonly fullTrackName: FullTrackName;
|
|
2258
|
-
readonly parameters: MessageParameter[];
|
|
2259
|
-
constructor(requestId: bigint, fullTrackName: FullTrackName, parameters: MessageParameter[]);
|
|
2260
|
-
/**
|
|
2261
|
-
* The requested range. A FETCH without a LOCATION_FILTER parameter asks for the
|
|
2262
|
-
* whole track up to the Largest Object, the same as a {@link (LocationFilterType:enum).None} filter.
|
|
2263
|
-
*/
|
|
2264
|
-
get locationFilter(): LocationFilter;
|
|
2265
|
-
getType(): ControlMessageType;
|
|
2266
|
-
serialize(): FrozenByteBuffer;
|
|
2267
|
-
static parsePayload(buf: BaseByteBuffer): Fetch;
|
|
2268
|
-
}
|
|
2269
|
-
//#endregion
|
|
2270
|
-
//#region src/model/property/constant.d.ts
|
|
2271
|
-
/**
|
|
2272
|
-
* Copyright 2025 The MOQtail Authors
|
|
2273
|
-
*
|
|
2274
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2275
|
-
* you may not use this file except in compliance with the License.
|
|
2276
|
-
* You may obtain a copy of the License at
|
|
2277
|
-
*
|
|
2278
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2279
|
-
*
|
|
2280
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2281
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2282
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2283
|
-
* See the License for the specific language governing permissions and
|
|
2284
|
-
* limitations under the License.
|
|
2285
|
-
*/
|
|
2286
|
-
declare enum LOCPropertyId {
|
|
2287
|
-
Timestamp = 6,
|
|
2288
|
-
Timescale = 8,
|
|
2289
|
-
VideoFrameMarking = 10,
|
|
2290
|
-
AudioLevel = 12,
|
|
2291
|
-
VideoConfig = 13
|
|
2292
|
-
}
|
|
2293
|
-
declare enum TrackPropertyType {
|
|
2294
|
-
ObjectDeliveryTimeout = 2,
|
|
2295
|
-
MaxCacheDuration = 4,
|
|
2296
|
-
SubgroupDeliveryTimeout = 6,
|
|
2297
|
-
ImmutableProperties = 11,
|
|
2298
|
-
DefaultPublisherPriority = 14,
|
|
2299
|
-
DefaultPublisherGroupOrder = 34,
|
|
2300
|
-
DynamicGroups = 48,
|
|
2301
|
-
PriorGroupIdGap = 60,
|
|
2302
|
-
PriorObjectIdGap = 62
|
|
2303
|
-
}
|
|
2304
|
-
declare function locPropertyIdFromNumber(value: number): LOCPropertyId;
|
|
2305
|
-
/**
|
|
2306
|
-
* @public
|
|
2307
|
-
* A registration-policy range in the Property Type space. `to` is absent for the
|
|
2308
|
-
* open-ended top range.
|
|
2309
|
-
*/
|
|
2310
|
-
interface PropertyRange {
|
|
2311
|
-
readonly from: bigint;
|
|
2312
|
-
readonly to?: bigint;
|
|
2313
|
-
}
|
|
2314
|
-
/**
|
|
2315
|
-
* @public
|
|
2316
|
-
* Registration-policy ranges for the Property Type space.
|
|
2317
|
-
*
|
|
2318
|
-
*/
|
|
2319
|
-
declare const PropertyRanges: {
|
|
2320
|
-
/** Standards Action or IESG Approval (1-byte encoding). */readonly StandardsAction: {
|
|
2321
|
-
readonly from: 0n;
|
|
2322
|
-
readonly to: 119n;
|
|
2323
|
-
}; /** Application-specific use, no registration permitted (1-byte encoding). */
|
|
2324
|
-
readonly AppSpecific1Byte: {
|
|
2325
|
-
readonly from: 120n;
|
|
2326
|
-
readonly to: 127n;
|
|
2327
|
-
}; /** Specification Required (2-byte encoding). */
|
|
2328
|
-
readonly SpecRequired: {
|
|
2329
|
-
readonly from: 128n;
|
|
2330
|
-
readonly to: 14335n;
|
|
2331
|
-
}; /** Application-specific use, no registration permitted (2-byte encoding). */
|
|
2332
|
-
readonly AppSpecific2Byte: {
|
|
2333
|
-
readonly from: 14336n;
|
|
2334
|
-
readonly to: 16383n;
|
|
2335
|
-
}; /** Mandatory Track Properties; Track scope only. */
|
|
2336
|
-
readonly MandatoryTrack: {
|
|
2337
|
-
readonly from: 16384n;
|
|
2338
|
-
readonly to: 32767n;
|
|
2339
|
-
}; /** First Come First Served begins here (open-ended). */
|
|
2340
|
-
readonly Fcfs: {
|
|
2341
|
-
readonly from: 32768n;
|
|
2342
|
-
};
|
|
2343
|
-
};
|
|
2344
|
-
/**
|
|
2345
|
-
* @public
|
|
2346
|
-
* True if a Property Type is reserved for application-specific use (either encoding-width
|
|
2347
|
-
* range), for which no IANA registration is permitted.
|
|
2348
|
-
*/
|
|
2349
|
-
declare function isApplicationSpecificProperty(typeValue: bigint | number): boolean;
|
|
2350
|
-
//#endregion
|
|
2351
|
-
//#region src/model/property/track_property.d.ts
|
|
2352
|
-
/** A timeout of 0 means no timeout is set (§8), on this side as on the parameter side. */
|
|
2353
|
-
declare class ObjectDeliveryTimeoutProperty {
|
|
2354
|
-
readonly timeoutMs: bigint;
|
|
2355
|
-
static readonly TYPE = TrackPropertyType.ObjectDeliveryTimeout;
|
|
2356
|
-
constructor(timeoutMs: bigint);
|
|
2357
|
-
toKeyValuePair(): KeyValuePair;
|
|
2358
|
-
static fromKeyValuePair(pair: KeyValuePair): ObjectDeliveryTimeoutProperty | undefined;
|
|
2359
|
-
}
|
|
2360
|
-
declare class SubgroupDeliveryTimeoutProperty {
|
|
2361
|
-
readonly timeoutMs: bigint;
|
|
2362
|
-
static readonly TYPE = TrackPropertyType.SubgroupDeliveryTimeout;
|
|
2363
|
-
constructor(timeoutMs: bigint);
|
|
2364
|
-
toKeyValuePair(): KeyValuePair;
|
|
2365
|
-
static fromKeyValuePair(pair: KeyValuePair): SubgroupDeliveryTimeoutProperty | undefined;
|
|
2366
|
-
}
|
|
2367
|
-
declare class MaxCacheDurationProperty {
|
|
2368
|
-
readonly durationMs: bigint;
|
|
2369
|
-
static readonly TYPE = TrackPropertyType.MaxCacheDuration;
|
|
2370
|
-
constructor(durationMs: bigint);
|
|
2371
|
-
toKeyValuePair(): KeyValuePair;
|
|
2372
|
-
static fromKeyValuePair(pair: KeyValuePair): MaxCacheDurationProperty | undefined;
|
|
2373
|
-
}
|
|
2374
|
-
declare class ImmutablePropertiesTrackProperty {
|
|
2375
|
-
readonly properties: KeyValuePair[];
|
|
2376
|
-
static readonly TYPE = TrackPropertyType.ImmutableProperties;
|
|
2377
|
-
constructor(properties: KeyValuePair[]);
|
|
2378
|
-
toKeyValuePair(): KeyValuePair;
|
|
2379
|
-
static fromKeyValuePair(pair: KeyValuePair): ImmutablePropertiesTrackProperty | undefined;
|
|
2380
|
-
}
|
|
2381
|
-
declare class DefaultPublisherPriorityProperty {
|
|
2382
|
-
readonly priority: number;
|
|
2383
|
-
static readonly TYPE = TrackPropertyType.DefaultPublisherPriority;
|
|
2384
|
-
constructor(priority: number);
|
|
2385
|
-
toKeyValuePair(): KeyValuePair;
|
|
2386
|
-
static fromKeyValuePair(pair: KeyValuePair): DefaultPublisherPriorityProperty | undefined;
|
|
2387
|
-
}
|
|
2388
|
-
declare class DefaultPublisherGroupOrderProperty {
|
|
2389
|
-
readonly order: GroupOrder;
|
|
2390
|
-
static readonly TYPE = TrackPropertyType.DefaultPublisherGroupOrder;
|
|
2391
|
-
constructor(order: GroupOrder);
|
|
2392
|
-
toKeyValuePair(): KeyValuePair;
|
|
2393
|
-
static fromKeyValuePair(pair: KeyValuePair): DefaultPublisherGroupOrderProperty | undefined;
|
|
2394
|
-
}
|
|
2395
|
-
declare class DynamicGroupsProperty {
|
|
2396
|
-
readonly enabled: boolean;
|
|
2397
|
-
static readonly TYPE = TrackPropertyType.DynamicGroups;
|
|
2398
|
-
constructor(enabled: boolean);
|
|
2399
|
-
toKeyValuePair(): KeyValuePair;
|
|
2400
|
-
static fromKeyValuePair(pair: KeyValuePair): DynamicGroupsProperty | undefined;
|
|
2401
|
-
}
|
|
2402
|
-
declare class UnknownTrackProperty {
|
|
2403
|
-
readonly kvp: KeyValuePair;
|
|
2404
|
-
constructor(kvp: KeyValuePair);
|
|
2405
|
-
toKeyValuePair(): KeyValuePair;
|
|
2406
|
-
}
|
|
2407
|
-
type TrackProperty = ObjectDeliveryTimeoutProperty | SubgroupDeliveryTimeoutProperty | MaxCacheDurationProperty | ImmutablePropertiesTrackProperty | DefaultPublisherPriorityProperty | DefaultPublisherGroupOrderProperty | DynamicGroupsProperty | UnknownTrackProperty;
|
|
2408
|
-
declare namespace TrackProperty {
|
|
2409
|
-
function fromKeyValuePair(pair: KeyValuePair): TrackProperty;
|
|
2410
|
-
function toKeyValuePair(ext: TrackProperty): KeyValuePair;
|
|
2411
|
-
function deserializeAll(buf: BaseByteBuffer): TrackProperty[];
|
|
2412
|
-
function serializeInto(exts: TrackProperty[], payload: ByteBuffer): void;
|
|
2413
|
-
function isObjectDeliveryTimeout(ext: TrackProperty): ext is ObjectDeliveryTimeoutProperty;
|
|
2414
|
-
function isSubgroupDeliveryTimeout(ext: TrackProperty): ext is SubgroupDeliveryTimeoutProperty;
|
|
2415
|
-
function isMaxCacheDuration(ext: TrackProperty): ext is MaxCacheDurationProperty;
|
|
2416
|
-
function isImmutableProperties(ext: TrackProperty): ext is ImmutablePropertiesTrackProperty;
|
|
2417
|
-
function isDefaultPublisherPriority(ext: TrackProperty): ext is DefaultPublisherPriorityProperty;
|
|
2418
|
-
function isDefaultPublisherGroupOrder(ext: TrackProperty): ext is DefaultPublisherGroupOrderProperty;
|
|
2419
|
-
function isDynamicGroups(ext: TrackProperty): ext is DynamicGroupsProperty;
|
|
2420
|
-
function isUnknown(ext: TrackProperty): ext is UnknownTrackProperty;
|
|
2421
|
-
}
|
|
2422
|
-
//#endregion
|
|
2423
|
-
//#region src/model/control/fetch_ok.d.ts
|
|
2424
|
-
/**
|
|
2425
|
-
* FETCH_OK (0x18) keeps a body of its own rather than folding into REQUEST_OK, but like
|
|
2426
|
-
* every other response it carries no Request ID: the request stream it arrives on
|
|
2427
|
-
* identifies the request (§10.1).
|
|
2428
|
-
*/
|
|
2429
|
-
declare class FetchOk {
|
|
2430
|
-
readonly endOfTrack: boolean;
|
|
2431
|
-
/** The last Location the response covers, inclusive. Object 2^64-1 is all of that group. */
|
|
2432
|
-
readonly endLocation: Location;
|
|
2433
|
-
readonly parameters: MessageParameter[];
|
|
2434
|
-
readonly trackProperties: TrackProperty[];
|
|
2435
|
-
constructor(endOfTrack: boolean, /** The last Location the response covers, inclusive. Object 2^64-1 is all of that group. */
|
|
2436
|
-
|
|
2437
|
-
endLocation: Location, parameters: MessageParameter[], trackProperties?: TrackProperty[]);
|
|
2438
|
-
getType(): ControlMessageType;
|
|
2439
|
-
serialize(): FrozenByteBuffer;
|
|
2440
|
-
static parsePayload(buf: BaseByteBuffer): FetchOk;
|
|
2441
|
-
}
|
|
2442
|
-
//#endregion
|
|
2443
|
-
//#region src/model/control/goaway.d.ts
|
|
2444
|
-
/** §10.4: a longer New Session URI is a protocol violation. */
|
|
2445
|
-
declare const MAX_NEW_SESSION_URI_LENGTH = 8192;
|
|
2446
|
-
/**
|
|
2447
|
-
* GOAWAY (0x10) winds down a session, or — on a request stream — migrates that one
|
|
2448
|
-
* request.
|
|
2449
|
-
*/
|
|
2450
|
-
declare class GoAway {
|
|
2451
|
-
newSessionUri?: string | undefined;
|
|
2452
|
-
/**
|
|
2453
|
-
* Milliseconds the sender waits for graceful closure; 0 means no specific timeout.
|
|
2454
|
-
* On the control stream the sender closes the session with `GOAWAY_TIMEOUT` after it,
|
|
2455
|
-
* on a request stream it resets the stream with `GOING_AWAY`.
|
|
2456
|
-
*/
|
|
2457
|
-
readonly timeout: bigint;
|
|
2458
|
-
constructor(newSessionUri?: string, timeout?: bigint);
|
|
2459
|
-
getType(): ControlMessageType;
|
|
2460
|
-
serialize(): FrozenByteBuffer;
|
|
2461
|
-
static parsePayload(buf: BaseByteBuffer): GoAway;
|
|
2462
|
-
}
|
|
2463
|
-
//#endregion
|
|
2464
|
-
//#region src/model/control/subscribe.d.ts
|
|
2465
|
-
declare class Subscribe {
|
|
2466
|
-
requestId: bigint;
|
|
2467
|
-
fullTrackName: FullTrackName;
|
|
2468
|
-
parameters: MessageParameter[];
|
|
2469
|
-
constructor(requestId: bigint, fullTrackName: FullTrackName, parameters: MessageParameter[]);
|
|
2470
|
-
getType(): ControlMessageType;
|
|
2471
|
-
serialize(): FrozenByteBuffer;
|
|
2472
|
-
static parsePayload(buf: BaseByteBuffer): Subscribe;
|
|
2473
|
-
}
|
|
2474
|
-
//#endregion
|
|
2475
|
-
//#region src/model/control/publish_done.d.ts
|
|
2476
|
-
declare class PublishDone {
|
|
2477
|
-
readonly statusCode: PublishDoneStatusCode;
|
|
2478
|
-
readonly streamCount: bigint;
|
|
2479
|
-
readonly errorReason: ReasonPhrase;
|
|
2480
|
-
/**
|
|
2481
|
-
* The Stream Count a publisher sends when it cannot name the exact number of streams
|
|
2482
|
-
* it opened. Receivers fall back on a timeout to end the subscription.
|
|
2483
|
-
*/
|
|
2484
|
-
static readonly UNKNOWN_STREAM_COUNT: bigint;
|
|
2485
|
-
constructor(statusCode: PublishDoneStatusCode, streamCount: bigint, errorReason: ReasonPhrase);
|
|
2486
|
-
static new(statusCode: PublishDoneStatusCode, streamCount: bigint, errorReason: ReasonPhrase): PublishDone;
|
|
2487
|
-
getType(): ControlMessageType;
|
|
2488
|
-
serialize(): FrozenByteBuffer;
|
|
2489
|
-
static parsePayload(buf: BaseByteBuffer): PublishDone;
|
|
2490
|
-
}
|
|
2491
|
-
//#endregion
|
|
2492
|
-
//#region src/model/control/publish.d.ts
|
|
2493
|
-
declare class Publish {
|
|
2494
|
-
readonly requestId: bigint;
|
|
2495
|
-
readonly fullTrackName: FullTrackName;
|
|
2496
|
-
readonly trackAlias: bigint;
|
|
2497
|
-
readonly parameters: MessageParameter[];
|
|
2498
|
-
readonly trackProperties: TrackProperty[];
|
|
2499
|
-
constructor(requestId: bigint, fullTrackName: FullTrackName, trackAlias: bigint, parameters: MessageParameter[], trackProperties?: TrackProperty[]);
|
|
2500
|
-
getType(): ControlMessageType;
|
|
2501
|
-
serialize(): FrozenByteBuffer;
|
|
2502
|
-
static parsePayload(buf: BaseByteBuffer): Publish;
|
|
2503
|
-
}
|
|
2504
|
-
//#endregion
|
|
2505
|
-
//#region src/model/control/subscribe_ok.d.ts
|
|
2506
|
-
/**
|
|
2507
|
-
* SUBSCRIBE_OK (0x4) keeps a body of its own rather than folding into REQUEST_OK, but
|
|
2508
|
-
* like every other response it carries no Request ID: the request stream it arrives on
|
|
2509
|
-
* identifies the request (§10.1).
|
|
2510
|
-
*/
|
|
2511
|
-
declare class SubscribeOk {
|
|
2512
|
-
trackAlias: bigint;
|
|
2513
|
-
parameters: MessageParameter[];
|
|
2514
|
-
trackProperties: TrackProperty[];
|
|
2515
|
-
private constructor();
|
|
2516
|
-
static create(trackAlias: bigint, parameters: MessageParameter[], trackProperties?: TrackProperty[]): SubscribeOk;
|
|
2517
|
-
getType(): ControlMessageType;
|
|
2518
|
-
serialize(): FrozenByteBuffer;
|
|
2519
|
-
static parsePayload(buf: BaseByteBuffer): SubscribeOk;
|
|
2520
|
-
}
|
|
2521
|
-
//#endregion
|
|
2522
|
-
//#region src/model/control/request_update.d.ts
|
|
2523
|
-
declare class RequestUpdate {
|
|
2524
|
-
requestId: bigint;
|
|
2525
|
-
parameters: MessageParameter[];
|
|
2526
|
-
constructor(requestId: bigint, parameters: MessageParameter[]);
|
|
2527
|
-
getType(): ControlMessageType;
|
|
2528
|
-
serialize(): FrozenByteBuffer;
|
|
2529
|
-
static parsePayload(buf: BaseByteBuffer): RequestUpdate;
|
|
2530
|
-
equals(other: RequestUpdate): boolean;
|
|
2531
|
-
}
|
|
2532
|
-
//#endregion
|
|
2533
|
-
//#region src/model/control/track_status.d.ts
|
|
2534
|
-
declare class TrackStatus {
|
|
2535
|
-
requestId: bigint;
|
|
2536
|
-
trackAlias: bigint;
|
|
2537
|
-
fullTrackName: FullTrackName;
|
|
2538
|
-
subscriberPriority: number;
|
|
2539
|
-
groupOrder: GroupOrder;
|
|
2540
|
-
forward: boolean;
|
|
2541
|
-
locationFilter: LocationFilter;
|
|
2542
|
-
subscribeParameters: MessageParameter[];
|
|
2543
|
-
constructor(requestId: bigint, trackAlias: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, locationFilter: LocationFilter, subscribeParameters: MessageParameter[]);
|
|
2544
|
-
getType(): ControlMessageType;
|
|
2545
|
-
serialize(): FrozenByteBuffer;
|
|
2546
|
-
static parsePayload(buf: BaseByteBuffer): TrackStatus;
|
|
2547
|
-
}
|
|
2548
|
-
//#endregion
|
|
2549
|
-
//#region src/model/control/subscribe_namespace.d.ts
|
|
2550
|
-
declare class SubscribeNamespace {
|
|
2551
|
-
readonly requestId: bigint;
|
|
2552
|
-
readonly trackNamespacePrefix: Tuple;
|
|
2553
|
-
readonly parameters: MessageParameter[];
|
|
2554
|
-
constructor(requestId: bigint, trackNamespacePrefix: Tuple, parameters: MessageParameter[]);
|
|
2555
|
-
getType(): ControlMessageType;
|
|
2556
|
-
serialize(): FrozenByteBuffer;
|
|
2557
|
-
static parsePayload(buf: BaseByteBuffer): SubscribeNamespace;
|
|
2558
|
-
}
|
|
2559
|
-
//#endregion
|
|
2560
|
-
//#region src/model/control/subscribe_tracks.d.ts
|
|
2561
|
-
/**
|
|
2562
|
-
* SUBSCRIBE_TRACKS (0x51) asks for a PUBLISH for every track under a matching
|
|
2563
|
-
* namespace prefix, present and future (§10.19).
|
|
2564
|
-
*
|
|
2565
|
-
* Shares SUBSCRIBE_NAMESPACE's wire shape but has its own prefix-overlap space: the
|
|
2566
|
-
* two types may hold the same prefix, two of the same type may not.
|
|
2567
|
-
*/
|
|
2568
|
-
declare class SubscribeTracks {
|
|
2569
|
-
readonly requestId: bigint;
|
|
2570
|
-
readonly trackNamespacePrefix: Tuple;
|
|
2571
|
-
readonly parameters: MessageParameter[];
|
|
2572
|
-
constructor(requestId: bigint, trackNamespacePrefix: Tuple, parameters: MessageParameter[]);
|
|
2573
|
-
getType(): ControlMessageType;
|
|
2574
|
-
serialize(): FrozenByteBuffer;
|
|
2575
|
-
static parsePayload(buf: BaseByteBuffer): SubscribeTracks;
|
|
2576
|
-
}
|
|
2577
|
-
//#endregion
|
|
2578
|
-
//#region src/model/control/request_ok.d.ts
|
|
2579
|
-
/**
|
|
2580
|
-
* @public
|
|
2581
|
-
* REQUEST_OK (0x7) answers PUBLISH, REQUEST_UPDATE, TRACK_STATUS, SUBSCRIBE_NAMESPACE,
|
|
2582
|
-
* SUBSCRIBE_TRACKS and PUBLISH_NAMESPACE. There is one wire type; the per-request-type
|
|
2583
|
-
* names (PUBLISH_OK, TRACK_STATUS_OK, ...) are shorthands for logging, not distinct
|
|
2584
|
-
* messages. SUBSCRIBE_OK (0x4) and FETCH_OK (0x18) do keep bodies of their own.
|
|
2585
|
-
*
|
|
2586
|
-
* It carries no Request ID: the request stream it arrives on identifies the request.
|
|
2587
|
-
*/
|
|
2588
|
-
declare class RequestOk {
|
|
2589
|
-
readonly parameters: MessageParameter[];
|
|
2590
|
-
/**
|
|
2591
|
-
* Track Properties, which the trailing bytes of the payload carry with no
|
|
2592
|
-
* count of their own. Populated only in TRACK_STATUS_OK; empty for every other request
|
|
2593
|
-
* type — see {@link RequestOk.validateTrackProperties}.
|
|
2594
|
-
*/
|
|
2595
|
-
readonly trackProperties: TrackProperty[];
|
|
2596
|
-
constructor(parameters?: MessageParameter[], trackProperties?: TrackProperty[]);
|
|
2597
|
-
getType(): ControlMessageType;
|
|
2598
|
-
/**
|
|
2599
|
-
* Track Properties may only be non-empty when this REQUEST_OK answers a TRACK_STATUS
|
|
2600
|
-
* request (§10.5). A receiver that sees them in any other REQUEST_OK — PUBLISH_OK,
|
|
2601
|
-
* REQUEST_UPDATE_OK, SUBSCRIBE_NAMESPACE_OK or PUBLISH_NAMESPACE_OK — MUST close the
|
|
2602
|
-
* session with a PROTOCOL_VIOLATION.
|
|
2603
|
-
*
|
|
2604
|
-
* @throws :{@link ProtocolViolationError} If Track Properties are present and this
|
|
2605
|
-
* REQUEST_OK does not answer a TRACK_STATUS.
|
|
2606
|
-
*/
|
|
2607
|
-
validateTrackProperties(answersTrackStatus: boolean): void;
|
|
2608
|
-
serialize(): FrozenByteBuffer;
|
|
2609
|
-
/**
|
|
2610
|
-
* Parses a REQUEST_OK body. `buf` must hold exactly the payload: whatever follows the
|
|
2611
|
-
* parameters is read as Track Properties, so trailing bytes from a longer buffer would
|
|
2612
|
-
* be parsed as properties.
|
|
2613
|
-
*/
|
|
2614
|
-
static parsePayload(buf: BaseByteBuffer): RequestOk;
|
|
2615
|
-
}
|
|
2616
|
-
//#endregion
|
|
2617
|
-
//#region src/model/control/request_error.d.ts
|
|
2618
|
-
/**
|
|
2619
|
-
* REQUEST_ERROR (0x5) refuses any request type. It carries no Request ID: the request
|
|
2620
|
-
* stream it arrives on identifies the request (§10.1).
|
|
2621
|
-
*/
|
|
2622
|
-
declare class RequestError {
|
|
2623
|
-
readonly errorCode: RequestErrorCode;
|
|
2624
|
-
readonly retryInterval: bigint;
|
|
2625
|
-
readonly reasonPhrase: ReasonPhrase;
|
|
2626
|
-
/** Present exactly when {@link RequestError.errorCode} is `REDIRECT` (§10.6.2). */
|
|
2627
|
-
readonly redirect: Redirect | undefined;
|
|
2628
|
-
constructor(errorCode: RequestErrorCode, retryInterval: bigint, reasonPhrase: ReasonPhrase, redirect?: Redirect);
|
|
2629
|
-
/** A REQUEST_ERROR that redirects the request elsewhere (§10.6.1). */
|
|
2630
|
-
static redirect(retryInterval: bigint, reasonPhrase: ReasonPhrase, redirect: Redirect): RequestError;
|
|
2631
|
-
getType(): ControlMessageType;
|
|
2632
|
-
serialize(): FrozenByteBuffer;
|
|
2633
|
-
static parsePayload(buf: BaseByteBuffer): RequestError;
|
|
2634
|
-
}
|
|
2635
|
-
//#endregion
|
|
2636
|
-
//#region src/model/control/control_message.d.ts
|
|
2637
|
-
type ControlMessage = Publish | PublishSkipped | PublishDone | PublishNamespace | Namespace | NamespaceDone | Setup | Fetch | FetchOk | GoAway | Subscribe | RequestError | SubscribeOk | RequestUpdate | TrackStatus | SubscribeNamespace | SubscribeTracks | RequestOk;
|
|
2638
|
-
declare namespace ControlMessage {
|
|
2639
|
-
function deserialize(buf: FrozenByteBuffer): ControlMessage;
|
|
2640
|
-
function serialize(msg: ControlMessage): FrozenByteBuffer;
|
|
2641
|
-
}
|
|
2642
|
-
//#endregion
|
|
2643
|
-
//#region src/model/error/stream_reset.d.ts
|
|
2644
|
-
/**
|
|
2645
|
-
* Copyright 2026 The MOQtail Authors
|
|
2646
|
-
*
|
|
2647
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2648
|
-
* you may not use this file except in compliance with the License.
|
|
2649
|
-
* You may obtain a copy of the License at
|
|
2650
|
-
*
|
|
2651
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2652
|
-
*
|
|
2653
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2654
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2655
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2656
|
-
* See the License for the specific language governing permissions and
|
|
2657
|
-
* limitations under the License.
|
|
2658
|
-
*/
|
|
2659
|
-
/**
|
|
2660
|
-
* @public
|
|
2661
|
-
* Codes carried when resetting a request stream or sending STOP_SENDING on one.
|
|
2662
|
-
*
|
|
2663
|
-
* A separate registry from {@link (RequestErrorCode:enum)}, which disagrees with it on
|
|
2664
|
-
* the same names: `GOING_AWAY` is `0x4` here but `0x6` there.
|
|
2665
|
-
*/
|
|
2666
|
-
declare enum StreamResetCode {
|
|
2667
|
-
InternalError = 0,
|
|
2668
|
-
Cancelled = 1,
|
|
2669
|
-
DeliveryTimeout = 2,
|
|
2670
|
-
SessionClosed = 3,
|
|
2671
|
-
GoingAway = 4,
|
|
2672
|
-
TooFarBehind = 5,
|
|
2673
|
-
UnknownObjectStatus = 6,
|
|
2674
|
-
ExpiredAuthToken = 7,
|
|
2675
|
-
ExcessiveLoad = 9,
|
|
2676
|
-
MalformedTrack = 18
|
|
2677
|
-
}
|
|
2678
|
-
declare namespace StreamResetCode {
|
|
2679
|
-
/**
|
|
2680
|
-
* Converts a numeric application error code to a StreamResetCode. The code is a
|
|
2681
|
-
* `number` because that is what the transport reports it as
|
|
2682
|
-
* (`WebTransportError.streamErrorCode`, an `unsigned long`).
|
|
2683
|
-
*
|
|
2684
|
-
* @throws :{@link InvalidEnumValue} if the code is not a defined stream reset code.
|
|
2685
|
-
*/
|
|
2686
|
-
function tryFrom(code: number): StreamResetCode;
|
|
2687
|
-
}
|
|
2688
|
-
//#endregion
|
|
2689
|
-
//#region src/model/catalog/cmsf.d.ts
|
|
2690
|
-
/**
|
|
2691
|
-
* Copyright 2026 The MOQtail Authors
|
|
2692
|
-
*
|
|
2693
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2694
|
-
* you may not use this file except in compliance with the License.
|
|
2695
|
-
* You may obtain a copy of the License at
|
|
2696
|
-
*
|
|
2697
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2698
|
-
*
|
|
2699
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2700
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2701
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2702
|
-
* See the License for the specific language governing permissions and
|
|
2703
|
-
* limitations under the License.
|
|
2704
|
-
*/
|
|
2705
|
-
interface CMSFTrack {
|
|
2706
|
-
name: string;
|
|
2707
|
-
packaging: 'cmaf' | 'chunk-per-object' | 'timeline';
|
|
2708
|
-
codec?: string;
|
|
2709
|
-
role: 'video' | 'audio' | 'timeline';
|
|
2710
|
-
depends?: string[];
|
|
2711
|
-
mimeType?: string;
|
|
2712
|
-
width?: number;
|
|
2713
|
-
height?: number;
|
|
2714
|
-
timescale?: number;
|
|
2715
|
-
bitrate?: number;
|
|
2716
|
-
initData?: string;
|
|
2717
|
-
}
|
|
2718
|
-
interface CMSF {
|
|
2719
|
-
version: string;
|
|
2720
|
-
tracks: CMSFTrack[];
|
|
2721
|
-
}
|
|
2722
|
-
declare class CMSFCatalog {
|
|
2723
|
-
#private;
|
|
2724
|
-
private constructor();
|
|
2725
|
-
static from(payload: ArrayBufferLike): CMSFCatalog;
|
|
2726
|
-
getByTrackName(trackName: string): CMSFTrack | undefined;
|
|
2727
|
-
getTracks(role?: CMSF['tracks'][number]['role']): CMSFTrack[];
|
|
2728
|
-
getVideo(index?: number): CMSFTrack | undefined;
|
|
2729
|
-
getAudio(index?: number): CMSFTrack | undefined;
|
|
2730
|
-
getTimeline(index?: number): CMSFTrack | undefined;
|
|
2731
|
-
getCodecString(trackName: string): string | undefined;
|
|
2732
|
-
getRole(trackName: string): "video" | "audio" | "timeline" | undefined;
|
|
2733
|
-
getPackaging(trackName: string): "timeline" | "cmaf" | "chunk-per-object" | undefined;
|
|
2734
|
-
isCMAF(trackName: string): boolean;
|
|
2735
|
-
getTimescale(trackName: string): number | undefined;
|
|
2736
|
-
getInitData(trackName: string): Uint8Array<ArrayBuffer> | undefined;
|
|
2737
|
-
private extractTrackName;
|
|
2738
|
-
}
|
|
2739
|
-
//#endregion
|
|
2740
|
-
//#region src/model/error/constant.d.ts
|
|
2741
|
-
/**
|
|
2742
|
-
* Copyright 2025 The MOQtail Authors
|
|
2743
|
-
*
|
|
2744
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2745
|
-
* you may not use this file except in compliance with the License.
|
|
2746
|
-
* You may obtain a copy of the License at
|
|
2747
|
-
*
|
|
2748
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2749
|
-
*
|
|
2750
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2751
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2752
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2753
|
-
* See the License for the specific language governing permissions and
|
|
2754
|
-
* limitations under the License.
|
|
2755
|
-
*/
|
|
2756
|
-
declare enum TerminationCode {
|
|
2757
|
-
NO_ERROR = 0,
|
|
2758
|
-
INTERNAL_ERROR = 1,
|
|
2759
|
-
UNAUTHORIZED = 2,
|
|
2760
|
-
PROTOCOL_VIOLATION = 3,
|
|
2761
|
-
INVALID_REQUEST_ID = 4,
|
|
2762
|
-
DUPLICATE_TRACK_ALIAS = 5,
|
|
2763
|
-
KEY_VALUE_FORMATTING_ERROR = 6,
|
|
2764
|
-
INVALID_PATH = 8,
|
|
2765
|
-
MALFORMED_PATH = 9,
|
|
2766
|
-
GOAWAY_TIMEOUT = 16,
|
|
2767
|
-
CONTROL_MESSAGE_TIMEOUT = 17,
|
|
2768
|
-
DATA_STREAM_TIMEOUT = 18,
|
|
2769
|
-
AUTH_TOKEN_CACHE_OVERFLOW = 19,
|
|
2770
|
-
DUPLICATE_AUTH_TOKEN_ALIAS = 20,
|
|
2771
|
-
MALFORMED_AUTH_TOKEN = 22,
|
|
2772
|
-
UNKNOWN_AUTH_TOKEN_ALIAS = 23,
|
|
2773
|
-
EXPIRED_AUTH_TOKEN = 24,
|
|
2774
|
-
INVALID_AUTHORITY = 25,
|
|
2775
|
-
MALFORMED_AUTHORITY = 26,
|
|
2776
|
-
TOO_MANY_REQUEST_UPDATES = 27
|
|
2777
|
-
}
|
|
2778
|
-
declare namespace TerminationCode {
|
|
2779
|
-
/**
|
|
2780
|
-
* Tries to convert a number to a TerminationCode enum member.
|
|
2781
|
-
*
|
|
2782
|
-
* @param code - The numeric code to convert.
|
|
2783
|
-
* @returns The corresponding TerminationCode member, or throws InvalidTypeError if the code is not valid.
|
|
2784
|
-
*/
|
|
2785
|
-
function tryFrom(code: number): TerminationCode;
|
|
2786
|
-
}
|
|
2787
|
-
//#endregion
|
|
2788
|
-
//#region src/model/property/timestamp.d.ts
|
|
2789
|
-
declare class Timestamp {
|
|
2790
|
-
readonly timestamp: bigint;
|
|
2791
|
-
static readonly TYPE = LOCPropertyId.Timestamp;
|
|
2792
|
-
constructor(timestamp: bigint);
|
|
2793
|
-
toKeyValuePair(): KeyValuePair;
|
|
2794
|
-
static fromKeyValuePair(pair: KeyValuePair): Timestamp | undefined;
|
|
2795
|
-
}
|
|
2796
|
-
//#endregion
|
|
2797
|
-
//#region src/model/property/timescale.d.ts
|
|
2798
|
-
declare class Timescale {
|
|
2799
|
-
readonly timescale: bigint;
|
|
2800
|
-
static readonly TYPE = LOCPropertyId.Timescale;
|
|
2801
|
-
constructor(timescale: bigint);
|
|
2802
|
-
toKeyValuePair(): KeyValuePair;
|
|
2803
|
-
static fromKeyValuePair(pair: KeyValuePair): Timescale | undefined;
|
|
2804
|
-
}
|
|
2805
|
-
//#endregion
|
|
2806
|
-
//#region src/model/property/video_frame_marking.d.ts
|
|
2807
|
-
declare class VideoFrameMarking {
|
|
2808
|
-
readonly value: bigint;
|
|
2809
|
-
static readonly TYPE = LOCPropertyId.VideoFrameMarking;
|
|
2810
|
-
constructor(value: bigint);
|
|
2811
|
-
toKeyValuePair(): KeyValuePair;
|
|
2812
|
-
static fromKeyValuePair(pair: KeyValuePair): VideoFrameMarking | undefined;
|
|
2813
|
-
}
|
|
2814
|
-
//#endregion
|
|
2815
|
-
//#region src/model/property/audio_level.d.ts
|
|
2816
|
-
declare class AudioLevel {
|
|
2817
|
-
readonly audioLevel: bigint;
|
|
2818
|
-
static readonly TYPE = LOCPropertyId.AudioLevel;
|
|
2819
|
-
constructor(audioLevel: bigint);
|
|
2820
|
-
toKeyValuePair(): KeyValuePair;
|
|
2821
|
-
static fromKeyValuePair(pair: KeyValuePair): AudioLevel | undefined;
|
|
2822
|
-
}
|
|
2823
|
-
//#endregion
|
|
2824
|
-
//#region src/model/property/video_config.d.ts
|
|
2825
|
-
declare class VideoConfig {
|
|
2826
|
-
readonly config: Uint8Array;
|
|
2827
|
-
static readonly TYPE = LOCPropertyId.VideoConfig;
|
|
2828
|
-
constructor(config: Uint8Array);
|
|
2829
|
-
toKeyValuePair(): KeyValuePair;
|
|
2830
|
-
static fromKeyValuePair(pair: KeyValuePair): VideoConfig | undefined;
|
|
2831
|
-
}
|
|
2832
|
-
//#endregion
|
|
2833
|
-
//#region src/model/property/loc.d.ts
|
|
2834
|
-
type LOCProperty = Timestamp | Timescale | VideoFrameMarking | AudioLevel | VideoConfig;
|
|
2835
|
-
declare namespace LOCProperty {
|
|
2836
|
-
function fromKeyValuePair(pair: KeyValuePair): LOCProperty | undefined;
|
|
2837
|
-
function toKeyValuePair(header: LOCProperty): KeyValuePair;
|
|
2838
|
-
function isTimestamp(header: LOCProperty): header is Timestamp;
|
|
2839
|
-
function isTimescale(header: LOCProperty): header is Timescale;
|
|
2840
|
-
function isVideoFrameMarking(header: LOCProperty): header is VideoFrameMarking;
|
|
2841
|
-
function isAudioLevel(header: LOCProperty): header is AudioLevel;
|
|
2842
|
-
function isVideoConfig(header: LOCProperty): header is VideoConfig;
|
|
2843
|
-
}
|
|
2844
|
-
declare class LOCProperties {
|
|
2845
|
-
private kvps;
|
|
2846
|
-
addTimestamp(timestamp: bigint | number): this;
|
|
2847
|
-
addTimescale(timescale: bigint | number): this;
|
|
2848
|
-
addVideoFrameMarking(marking: bigint | number): this;
|
|
2849
|
-
addAudioLevel(audioLevel: bigint | number): this;
|
|
2850
|
-
addVideoConfig(config: Uint8Array): this;
|
|
2851
|
-
addRaw(pair: KeyValuePair): this;
|
|
2852
|
-
build(): KeyValuePair[];
|
|
2853
|
-
static fromKeyValuePairs(kvps: KeyValuePair[]): LOCProperty[];
|
|
2854
|
-
}
|
|
2855
|
-
//#endregion
|
|
2856
|
-
//#region src/model/property/object_property.d.ts
|
|
2857
|
-
declare class ImmutablePropertiesObjectProperty {
|
|
2858
|
-
readonly properties: KeyValuePair[];
|
|
2859
|
-
static readonly TYPE = TrackPropertyType.ImmutableProperties;
|
|
2860
|
-
constructor(properties: KeyValuePair[]);
|
|
2861
|
-
toKeyValuePair(): KeyValuePair;
|
|
2862
|
-
static fromKeyValuePair(pair: KeyValuePair): ImmutablePropertiesObjectProperty | undefined;
|
|
2863
|
-
}
|
|
2864
|
-
declare class PriorGroupIdGapProperty {
|
|
2865
|
-
readonly gap: bigint;
|
|
2866
|
-
static readonly TYPE = TrackPropertyType.PriorGroupIdGap;
|
|
2867
|
-
constructor(gap: bigint);
|
|
2868
|
-
toKeyValuePair(): KeyValuePair;
|
|
2869
|
-
static fromKeyValuePair(pair: KeyValuePair): PriorGroupIdGapProperty | undefined;
|
|
2870
|
-
}
|
|
2871
|
-
declare class PriorObjectIdGapProperty {
|
|
2872
|
-
readonly gap: bigint;
|
|
2873
|
-
static readonly TYPE = TrackPropertyType.PriorObjectIdGap;
|
|
2874
|
-
constructor(gap: bigint);
|
|
2875
|
-
toKeyValuePair(): KeyValuePair;
|
|
2876
|
-
static fromKeyValuePair(pair: KeyValuePair): PriorObjectIdGapProperty | undefined;
|
|
2877
|
-
}
|
|
2878
|
-
declare class UnknownObjectProperty {
|
|
2879
|
-
readonly kvp: KeyValuePair;
|
|
2880
|
-
constructor(kvp: KeyValuePair);
|
|
2881
|
-
toKeyValuePair(): KeyValuePair;
|
|
2882
|
-
}
|
|
2883
|
-
type ObjectProperty = ImmutablePropertiesObjectProperty | PriorGroupIdGapProperty | PriorObjectIdGapProperty | UnknownObjectProperty;
|
|
2884
|
-
declare namespace ObjectProperty {
|
|
2885
|
-
function fromKeyValuePair(pair: KeyValuePair): ObjectProperty;
|
|
2886
|
-
function toKeyValuePair(ext: ObjectProperty): KeyValuePair;
|
|
2887
|
-
function deserializeAll(buf: BaseByteBuffer): ObjectProperty[];
|
|
2888
|
-
function serializeInto(exts: ObjectProperty[], payload: ByteBuffer): void;
|
|
2889
|
-
function isImmutableProperties(ext: ObjectProperty): ext is ImmutablePropertiesObjectProperty;
|
|
2890
|
-
function isPriorGroupIdGap(ext: ObjectProperty): ext is PriorGroupIdGapProperty;
|
|
2891
|
-
function isPriorObjectIdGap(ext: ObjectProperty): ext is PriorObjectIdGapProperty;
|
|
2892
|
-
function isUnknown(ext: ObjectProperty): ext is UnknownObjectProperty;
|
|
2893
|
-
}
|
|
2894
|
-
//#endregion
|
|
2895
|
-
//#region src/model/parameter/setup/path.d.ts
|
|
2896
|
-
declare class Path implements Parameter {
|
|
2897
|
-
readonly moqtPath: string;
|
|
2898
|
-
static readonly TYPE = SetupOptionType.Path;
|
|
2899
|
-
constructor(moqtPath: string);
|
|
2900
|
-
toKeyValuePair(): KeyValuePair;
|
|
2901
|
-
static fromKeyValuePair(pair: KeyValuePair): Path | undefined;
|
|
2902
|
-
}
|
|
2903
|
-
//#endregion
|
|
2904
|
-
//#region src/model/parameter/setup/max_auth_token_cache_size.d.ts
|
|
2905
|
-
declare class MaxAuthTokenCacheSize implements Parameter {
|
|
2906
|
-
readonly maxSize: bigint;
|
|
2907
|
-
static readonly TYPE = SetupOptionType.MaxAuthTokenCacheSize;
|
|
2908
|
-
constructor(maxSize: bigint);
|
|
2909
|
-
toKeyValuePair(): KeyValuePair;
|
|
2910
|
-
static fromKeyValuePair(pair: KeyValuePair): MaxAuthTokenCacheSize | undefined;
|
|
2911
|
-
}
|
|
2912
|
-
//#endregion
|
|
2913
|
-
//#region src/model/parameter/setup/authority.d.ts
|
|
2914
|
-
/**
|
|
2915
|
-
* Raw-QUIC only: the authority component of the `moqt://` URI, carried in SETUP because
|
|
2916
|
-
* there is no HTTP CONNECT to carry it.
|
|
2917
|
-
*
|
|
2918
|
-
* Client-only; MUST NOT be sent by a server or over WebTransport. moqtail-ts always
|
|
2919
|
-
* connects over WebTransport, so its own handshake never sends this — see
|
|
2920
|
-
* `MOQtailClient.new`.
|
|
2921
|
-
*/
|
|
2922
|
-
declare class Authority implements Parameter {
|
|
2923
|
-
readonly authority: string;
|
|
2924
|
-
static readonly TYPE = SetupOptionType.Authority;
|
|
2925
|
-
constructor(authority: string);
|
|
2926
|
-
toKeyValuePair(): KeyValuePair;
|
|
2927
|
-
static fromKeyValuePair(pair: KeyValuePair): Authority | undefined;
|
|
2928
|
-
}
|
|
2929
|
-
//#endregion
|
|
2930
|
-
//#region src/model/parameter/setup/max_filter_ranges.d.ts
|
|
2931
|
-
/**
|
|
2932
|
-
* Limits the total number of Ranges the peer may have across all Range filter parameters
|
|
2933
|
-
* of a single subscription or fetch. Zero, the default when absent, means the peer may
|
|
2934
|
-
* not send Range filters at all.
|
|
2935
|
-
*/
|
|
2936
|
-
declare class MaxFilterRanges implements Parameter {
|
|
2937
|
-
readonly value: bigint;
|
|
2938
|
-
static readonly TYPE = SetupOptionType.MaxFilterRanges;
|
|
2939
|
-
constructor(value: bigint);
|
|
2940
|
-
toKeyValuePair(): KeyValuePair;
|
|
2941
|
-
static fromKeyValuePair(pair: KeyValuePair): MaxFilterRanges | undefined;
|
|
2942
|
-
}
|
|
2943
|
-
//#endregion
|
|
2944
|
-
//#region src/model/parameter/setup/moqt_implementation.d.ts
|
|
2945
|
-
/**
|
|
2946
|
-
* Free-form implementation identification string, e.g. for logging and debugging.
|
|
2947
|
-
* Either peer may send it.
|
|
2948
|
-
*/
|
|
2949
|
-
declare class MoqtImplementation implements Parameter {
|
|
2950
|
-
readonly info: string;
|
|
2951
|
-
static readonly TYPE = SetupOptionType.MoqtImplementation;
|
|
2952
|
-
constructor(info: string);
|
|
2953
|
-
toKeyValuePair(): KeyValuePair;
|
|
2954
|
-
static fromKeyValuePair(pair: KeyValuePair): MoqtImplementation | undefined;
|
|
2955
|
-
}
|
|
2956
|
-
//#endregion
|
|
2957
|
-
//#region src/model/parameter/setup/max_request_updates.d.ts
|
|
2958
|
-
/**
|
|
2959
|
-
* Maximum number of outstanding REQUEST_UPDATEs per request stream: an update counts
|
|
2960
|
-
* until its REQUEST_OK or REQUEST_ERROR arrives. Zero, the default when absent, means
|
|
2961
|
-
* no limit. Receiving one past the limit closes the session with TOO_MANY_REQUEST_UPDATES.
|
|
2962
|
-
*/
|
|
2963
|
-
declare class MaxRequestUpdates implements Parameter {
|
|
2964
|
-
readonly value: bigint;
|
|
2965
|
-
static readonly TYPE = SetupOptionType.MaxRequestUpdates;
|
|
2966
|
-
constructor(value: bigint);
|
|
2967
|
-
toKeyValuePair(): KeyValuePair;
|
|
2968
|
-
static fromKeyValuePair(pair: KeyValuePair): MaxRequestUpdates | undefined;
|
|
2969
|
-
}
|
|
2970
|
-
//#endregion
|
|
2971
|
-
//#region src/model/parameter/setup/ssts_algorithms.d.ts
|
|
2972
|
-
/**
|
|
2973
|
-
* The sender-side track switching (SSTS) algorithms this endpoint supports.
|
|
2974
|
-
*
|
|
2975
|
-
* PROVISIONAL: sender-side track switching is not an adopted extension, so
|
|
2976
|
-
* this option has no codepoint in the registry the conformance fixture tracks
|
|
2977
|
-
* (`dev/conformance/draft22`) and is never asserted against it. An empty list
|
|
2978
|
-
* — or the absence of the option — prohibits the use of SSTS.
|
|
2979
|
-
*/
|
|
2980
|
-
declare class SstsAlgorithms implements Parameter {
|
|
2981
|
-
readonly algorithms: bigint[];
|
|
2982
|
-
static readonly TYPE = SetupOptionType.SstsAlgorithms;
|
|
2983
|
-
constructor(algorithms: bigint[]);
|
|
2984
|
-
toKeyValuePair(): KeyValuePair;
|
|
2985
|
-
static fromKeyValuePair(pair: KeyValuePair): SstsAlgorithms | undefined;
|
|
2986
|
-
}
|
|
2987
|
-
//#endregion
|
|
2988
|
-
//#region src/model/parameter/setup_option.d.ts
|
|
2989
|
-
type SetupOption = Path | MaxAuthTokenCacheSize | AuthorizationToken | Authority | MaxFilterRanges | MoqtImplementation | MaxRequestUpdates | SstsAlgorithms;
|
|
2990
|
-
declare namespace SetupOption {
|
|
2991
|
-
function fromKeyValuePair(pair: KeyValuePair): SetupOption | undefined;
|
|
2992
|
-
function toKeyValuePair(param: SetupOption): KeyValuePair;
|
|
2993
|
-
function isPath(param: SetupOption): param is Path;
|
|
2994
|
-
function isMaxAuthTokenCacheSize(param: SetupOption): param is MaxAuthTokenCacheSize;
|
|
2995
|
-
function isAuthorizationToken(param: SetupOption): param is AuthorizationToken;
|
|
2996
|
-
function isAuthority(param: SetupOption): param is Authority;
|
|
2997
|
-
function isMaxFilterRanges(param: SetupOption): param is MaxFilterRanges;
|
|
2998
|
-
function isMaxRequestUpdates(param: SetupOption): param is MaxRequestUpdates;
|
|
2999
|
-
function isMoqtImplementation(param: SetupOption): param is MoqtImplementation;
|
|
3000
|
-
function isSstsAlgorithms(param: SetupOption): param is SstsAlgorithms;
|
|
3001
|
-
}
|
|
3002
|
-
/** Throws if `params` carries AUTHORITY, which MUST NOT be sent over WebTransport. */
|
|
3003
|
-
declare function assertNoAuthorityOverWebTransport(params: KeyValuePair[]): void;
|
|
3004
|
-
declare class SetupOptions {
|
|
3005
|
-
private kvps;
|
|
3006
|
-
addMaxAuthTokenCacheSize(maxSize: bigint | number): this;
|
|
3007
|
-
addPath(moqtPath: string): this;
|
|
3008
|
-
addAuthorizationToken(auth: AuthorizationToken): this;
|
|
3009
|
-
addMaxFilterRanges(value: bigint | number): this;
|
|
3010
|
-
addMaxRequestUpdates(value: bigint | number): this;
|
|
3011
|
-
addMoqtImplementation(info: string): this;
|
|
3012
|
-
addSstsAlgorithms(algorithms: (bigint | number)[]): this;
|
|
3013
|
-
addRaw(pair: KeyValuePair): this;
|
|
3014
|
-
build(): KeyValuePair[];
|
|
3015
|
-
static fromKeyValuePairs(kvps: KeyValuePair[]): SetupOption[];
|
|
3016
|
-
}
|
|
3017
|
-
//#endregion
|
|
3018
|
-
//#region src/model/parameter/message/combined_filter.d.ts
|
|
3019
|
-
/**
|
|
3020
|
-
* The object filter a request's Range Filters add up to.
|
|
3021
|
-
*
|
|
3022
|
-
* Ranges within one filter are OR'd, filters sharing a SetID are AND'd, and the
|
|
3023
|
-
* SetIDs are OR'd with each other. No filter at all passes every Object.
|
|
3024
|
-
*/
|
|
3025
|
-
declare class CombinedFilter {
|
|
3026
|
-
#private;
|
|
3027
|
-
/** How many Ranges the filters hold, which is what a range limit counts. */
|
|
3028
|
-
readonly rangeCount: number;
|
|
3029
|
-
/**
|
|
3030
|
-
* Builds the filter from every Range Filter in `params`; anything else, and a
|
|
3031
|
-
* zero-length removal, is ignored.
|
|
3032
|
-
*
|
|
3033
|
-
* @throws :{@link InvalidFilterError} For a filter that cannot be applied: one
|
|
3034
|
-
* that repeats a Type, SetID and Property Type already given, one with an odd
|
|
3035
|
-
* Property Type, a priority above 255 or a bound past 2^64-1, or a track filter,
|
|
3036
|
-
* which selects tracks rather than Objects.
|
|
3037
|
-
*/
|
|
3038
|
-
constructor(params: readonly MessageParameter[]);
|
|
3039
|
-
/** Whether the filter passes everything. */
|
|
3040
|
-
get isEmpty(): boolean;
|
|
3041
|
-
/**
|
|
3042
|
-
* Whether `obj` passes.
|
|
3043
|
-
*
|
|
3044
|
-
* @param subgroupId - The Subgroup ID `obj` travels in. It is passed in because an
|
|
3045
|
-
* Object whose Subgroup ID is its subgroup's first Object ID does not know it
|
|
3046
|
-
* itself. `null` — a datagram — has no subgroup, so no subgroup filter passes it.
|
|
3047
|
-
*/
|
|
3048
|
-
matches(obj: MoqtObject, subgroupId?: bigint | null): boolean;
|
|
3049
|
-
}
|
|
3050
|
-
//#endregion
|
|
3051
|
-
export { PropertyRange as $, isVarInt as $n, Expires as $t, RequestError as A, LocationFilterType as An, RequestIdError as At, GoAway as B, ObjectDatagramType as Bn, NewGroupRequest as Bt, Timestamp as C, MAX_FULL_TRACK_NAME_LENGTH as Cn, InvalidTypeError as Ct, CMSFTrack as D, FetchObjectContext as Dn, MOQtailError as Dt, CMSFCatalog as E, FetchObject as En, LengthExceedsMaxError as Et, RequestUpdate as F, TrackStatusCode as Fn, FillParameters as Ft, DynamicGroupsProperty as G, ReasonPhrase as Gn, resolveTransportUrl as Gt, FetchOk as H, ObjectStatus as Hn, Redirect as Ht, SubscribeOk as I, FetchHeader as In, SwitchFrom as It, ObjectDeliveryTimeoutProperty as J, Location as Jn, greaseValue as Jt, ImmutablePropertiesTrackProperty as K, Tuple as Kn, GREASE_BASE as Kt, Publish as L, Datagram as Ln, LocationFilter as Lt, SubscribeTracks as M, RequestErrorCode as Mn, TimeoutError as Mt, SubscribeNamespace as N, SUPPORTED_VERSIONS as Nn, TrackNameError as Nt, StreamResetCode as O, ControlMessageType as On, NotEnoughBytesError as Ot, TrackStatus as P, SwitchMode as Pn, VarIntOverflowError as Pt, LOCPropertyId as Q, isBytes as Qn, Forward as Qt, PublishDone as R, DEFAULT_PUBLISHER_PRIORITY as Rn, SubscriberPriority as Rt, Timescale as S, FullTrackName as Sn, InvalidEnumValue as St, CMSF as T, EndOfRangeKind as Tn, KeyValueFormattingError as Tt, DefaultPublisherGroupOrderProperty as U, SubgroupHeaderType as Un, MoqtFragment as Ut, MAX_NEW_SESSION_URI_LENGTH as V, ObjectForwardingPreference as Vn, LargestObject as Vt, DefaultPublisherPriorityProperty as W, MAX_REASON_PHRASE_LEN as Wn, MoqtUrl as Wt, TrackProperty as X, deserializeKvpList as Xn, GroupOrderParam as Xt, SubgroupDeliveryTimeoutProperty as Y, KeyValuePair as Yn, isGrease as Yt, UnknownTrackProperty as Z, deserializeKvpListUntilEmpty as Zn, IncludeProperties as Zt, LOCProperties as _, Header as _n, RangeFilter as _t, SstsAlgorithms as a, AuthorizationToken as an, Setup as at, AudioLevel as b, MoqtObject as bn, CastingError as bt, MaxFilterRanges as c, SetupOptionType as cn, PublishNamespace as ct, Path as d, setupOptionTypeFromNumber as dn, applyMessageParameterUpdate as dt, SubgroupDeliveryTimeout as en, serializeKvpList as er, PropertyRanges as et, ImmutablePropertiesObjectProperty as f, tokenAliasTypeFromNumber as fn, deserializeMessageParameterKvps as ft, UnknownObjectProperty as g, FrozenByteBuffer as gn, RangeDelta as gt, PriorObjectIdGapProperty as h, ByteBuffer as hn, Range as ht, assertNoAuthorityOverWebTransport as i, AuthTokenVariant as in, Fetch as it, RequestOk as j, PublishDoneStatusCode as jn, TerminationError as jt, ControlMessage as k, GroupOrder as kn, ProtocolViolationError as kt, Authority as l, TokenAliasType as ln, MessageParameter as lt, PriorGroupIdGapProperty as m, BaseByteBuffer as mn, InvalidFilterError as mt, SetupOption as n, ObjectDeliveryTimeout as nn, isApplicationSpecificProperty as nt, MaxRequestUpdates as o, Parameter as on, NamespaceDone as ot, ObjectProperty as p, PublishSkipped as pn, serializeMessageParameterKvps as pt, MaxCacheDurationProperty as q, TupleField as qn, GREASE_STEP as qt, SetupOptions as r, FillTimeout as rn, locPropertyIdFromNumber as rt, MoqtImplementation as s, MessageParameterType as sn, Namespace as st, CombinedFilter as t, RendezvousTimeout as tn, TrackPropertyType as tt, MaxAuthTokenCacheSize as u, messageParameterTypeFromNumber as un, MessageParameters as ut, LOCProperty as v, RequestIdMap as vn, RangeFilterKind as vt, TerminationCode as w, MAX_NAMESPACE_TUPLE_COUNT as wn, InvalidUTF8Error as wt, VideoFrameMarking as x, SubgroupObject as xn, InternalError as xt, VideoConfig as y, SubgroupHeader as yn, encodeRanges as yt, Subscribe as z, FetchHeaderType as zn, SwitchingSetAssignment as zt };
|