moqtail 0.9.0 → 0.10.1
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 +8 -16
- package/dist/client.cjs +4324 -4248
- package/dist/client.d.cts +182 -93
- package/dist/client.d.ts +182 -93
- package/dist/client.js +4324 -4249
- package/dist/index.cjs +4810 -4665
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4542 -4448
- package/dist/logger-C6QS408Z.d.cts +34 -0
- package/dist/logger-C6QS408Z.d.ts +34 -0
- package/dist/model.cjs +2055 -1982
- package/dist/model.d.cts +83 -52
- package/dist/model.d.ts +83 -52
- package/dist/model.js +2021 -1953
- package/dist/{version_parameter-DXBOBueW.d.cts → setup_parameter-BOeGq6Mv.d.cts} +840 -759
- package/dist/{version_parameter-DXBOBueW.d.ts → setup_parameter-BOeGq6Mv.d.ts} +840 -759
- package/dist/util.cjs +45 -0
- package/dist/util.d.cts +2 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.js +41 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as ControlMessage, U as MoqtObject, y as Location, u as FullTrackName, _ as ObjectForwardingPreference, au as TrackExtension, ao as Subscribe, a4 as PublishDoneStatusCode, ae as RequestUpdate, F as Fetch, a2 as Publish, ad as RequestOk, aa as RequestError, a5 as PublishNamespace, p as FetchOk, aq as SubscribeOk, R as MessageParameter, ap as SubscribeNamespace, a8 as PublishOk, v as GroupOrder, q as FetchType, ak as SetupParameters, D as Datagram, r as FilterType, ay as Tuple, ac as RequestIdMap, a7 as PublishNamespaceDone, G as GoAway, an as SubgroupObject, al as SubgroupHeader, n as FetchObject, l as FetchHeader, a3 as PublishDone, ah as ServerSetup, a6 as PublishNamespaceCancel, X as NamespaceSubscribeOptions, aC as UnsubscribeNamespace, aw as TrackStatus, H as Header } from './setup_parameter-BOeGq6Mv.js';
|
|
2
|
+
import { L as LogLevel } from './logger-C6QS408Z.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Copyright 2025 The MOQtail Authors
|
|
@@ -170,7 +171,7 @@ declare class LiveTrackSource implements LiveObjectSource {
|
|
|
170
171
|
readonly stream: ReadableStream<MoqtObject>;
|
|
171
172
|
constructor(stream: ReadableStream<MoqtObject>);
|
|
172
173
|
get largestLocation(): Location | undefined;
|
|
173
|
-
onNewObject(listener: (obj: MoqtObject) => void): () => void;
|
|
174
|
+
onNewObject(listener: (obj: MoqtObject) => Promise<void> | void): () => void;
|
|
174
175
|
onDone(listener: () => void): () => void;
|
|
175
176
|
stop(): void;
|
|
176
177
|
}
|
|
@@ -260,6 +261,12 @@ type Track = {
|
|
|
260
261
|
* Optional compact numeric alias assigned during protocol negotiation.
|
|
261
262
|
*/
|
|
262
263
|
trackAlias?: bigint;
|
|
264
|
+
/**
|
|
265
|
+
* Track extensions advertised by the publisher.
|
|
266
|
+
* Set before calling `publish()` to include extensions in the PUBLISH message.
|
|
267
|
+
* Populated automatically on the subscriber side when SUBSCRIBE_OK or FETCH_OK is received.
|
|
268
|
+
*/
|
|
269
|
+
trackExtensions?: TrackExtension[];
|
|
263
270
|
};
|
|
264
271
|
|
|
265
272
|
/**
|
|
@@ -312,10 +319,10 @@ declare class SubscribePublication {
|
|
|
312
319
|
*/
|
|
313
320
|
done(statusCode: PublishDoneStatusCode): Promise<void>;
|
|
314
321
|
/**
|
|
315
|
-
* Updates the subscription parameters and locations based on a
|
|
316
|
-
* @param msg - The update message containing new
|
|
322
|
+
* Updates the subscription parameters and locations based on a RequestUpdate message.
|
|
323
|
+
* @param msg - The update message containing new request details.
|
|
317
324
|
*/
|
|
318
|
-
update(msg:
|
|
325
|
+
update(msg: RequestUpdate): void;
|
|
319
326
|
/**
|
|
320
327
|
* Publishes MOQT objects to the subscriber as they become available.
|
|
321
328
|
* Handles stream creation, object writing, and stream closure based on subscription parameters.
|
|
@@ -398,7 +405,7 @@ declare class PublishPublication {
|
|
|
398
405
|
}
|
|
399
406
|
|
|
400
407
|
/**
|
|
401
|
-
* Copyright
|
|
408
|
+
* Copyright 2026 The MOQtail Authors
|
|
402
409
|
*
|
|
403
410
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
404
411
|
* you may not use this file except in compliance with the License.
|
|
@@ -413,18 +420,18 @@ declare class PublishPublication {
|
|
|
413
420
|
* limitations under the License.
|
|
414
421
|
*/
|
|
415
422
|
|
|
416
|
-
declare class PublishNamespaceRequest implements PromiseLike<
|
|
423
|
+
declare class PublishNamespaceRequest implements PromiseLike<RequestOk | RequestError> {
|
|
417
424
|
readonly requestId: bigint;
|
|
418
425
|
readonly message: PublishNamespace;
|
|
419
426
|
private _resolve;
|
|
420
427
|
private _reject;
|
|
421
428
|
private promise;
|
|
422
429
|
constructor(requestId: bigint, message: PublishNamespace);
|
|
423
|
-
resolve(value:
|
|
430
|
+
resolve(value: RequestOk | RequestError | PromiseLike<RequestOk | RequestError>): void;
|
|
424
431
|
reject(reason?: any): void;
|
|
425
|
-
then<TResult1 =
|
|
426
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<
|
|
427
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<
|
|
432
|
+
then<TResult1 = RequestOk | RequestError, TResult2 = never>(onfulfilled?: ((value: RequestOk | RequestError) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
|
|
433
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<RequestOk | RequestError | TResult>;
|
|
434
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<RequestOk | RequestError>;
|
|
428
435
|
}
|
|
429
436
|
|
|
430
437
|
/**
|
|
@@ -443,7 +450,7 @@ declare class PublishNamespaceRequest implements PromiseLike<PublishNamespaceOk
|
|
|
443
450
|
* limitations under the License.
|
|
444
451
|
*/
|
|
445
452
|
|
|
446
|
-
declare class FetchRequest implements PromiseLike<FetchOk |
|
|
453
|
+
declare class FetchRequest implements PromiseLike<FetchOk | RequestError> {
|
|
447
454
|
readonly requestId: bigint;
|
|
448
455
|
readonly message: Fetch;
|
|
449
456
|
private _resolve;
|
|
@@ -454,11 +461,11 @@ declare class FetchRequest implements PromiseLike<FetchOk | FetchError> {
|
|
|
454
461
|
isActive: boolean;
|
|
455
462
|
isResolved: boolean;
|
|
456
463
|
constructor(message: Fetch);
|
|
457
|
-
resolve(value: FetchOk |
|
|
464
|
+
resolve(value: FetchOk | RequestError | PromiseLike<FetchOk | RequestError>): void;
|
|
458
465
|
reject(reason?: any): void;
|
|
459
|
-
then<TResult1 = FetchOk |
|
|
460
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<FetchOk |
|
|
461
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<FetchOk |
|
|
466
|
+
then<TResult1 = FetchOk | RequestError, TResult2 = never>(onfulfilled?: ((value: FetchOk | RequestError) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
|
|
467
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<FetchOk | RequestError | TResult>;
|
|
468
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<FetchOk | RequestError>;
|
|
462
469
|
}
|
|
463
470
|
|
|
464
471
|
/**
|
|
@@ -477,7 +484,7 @@ declare class FetchRequest implements PromiseLike<FetchOk | FetchError> {
|
|
|
477
484
|
* limitations under the License.
|
|
478
485
|
*/
|
|
479
486
|
|
|
480
|
-
declare class SubscribeRequest implements PromiseLike<SubscribeOk |
|
|
487
|
+
declare class SubscribeRequest implements PromiseLike<SubscribeOk | RequestError> {
|
|
481
488
|
#private;
|
|
482
489
|
requestId: bigint;
|
|
483
490
|
fullTrackName: FullTrackName;
|
|
@@ -486,25 +493,25 @@ declare class SubscribeRequest implements PromiseLike<SubscribeOk | SubscribeErr
|
|
|
486
493
|
endGroup: bigint | undefined;
|
|
487
494
|
priority: number;
|
|
488
495
|
forward: boolean;
|
|
489
|
-
subscribeParameters:
|
|
496
|
+
subscribeParameters: MessageParameter[];
|
|
490
497
|
largestLocation: Location | undefined;
|
|
491
498
|
streamsAccepted: bigint;
|
|
492
499
|
expectedStreams: bigint | undefined;
|
|
493
500
|
readonly controller: ReadableStreamDefaultController<MoqtObject>;
|
|
494
501
|
readonly stream: ReadableStream<MoqtObject>;
|
|
495
502
|
constructor(msg: Subscribe);
|
|
496
|
-
update(msg:
|
|
497
|
-
switch(newTrackName: FullTrackName, newParameters:
|
|
503
|
+
update(msg: RequestUpdate): void;
|
|
504
|
+
switch(newTrackName: FullTrackName, newParameters: MessageParameter[]): void;
|
|
498
505
|
unsubscribe(): void;
|
|
499
|
-
resolve(value: SubscribeOk |
|
|
506
|
+
resolve(value: SubscribeOk | RequestError | PromiseLike<SubscribeOk | RequestError>): void;
|
|
500
507
|
reject(reason?: any): void;
|
|
501
|
-
then<TResult1 = SubscribeOk |
|
|
502
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<SubscribeOk |
|
|
503
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<SubscribeOk |
|
|
508
|
+
then<TResult1 = SubscribeOk | RequestError, TResult2 = never>(onfulfilled?: ((value: SubscribeOk | RequestError) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
|
|
509
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<SubscribeOk | RequestError | TResult>;
|
|
510
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<SubscribeOk | RequestError>;
|
|
504
511
|
}
|
|
505
512
|
|
|
506
513
|
/**
|
|
507
|
-
* Copyright
|
|
514
|
+
* Copyright 2026 The MOQtail Authors
|
|
508
515
|
*
|
|
509
516
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
510
517
|
* you may not use this file except in compliance with the License.
|
|
@@ -519,18 +526,18 @@ declare class SubscribeRequest implements PromiseLike<SubscribeOk | SubscribeErr
|
|
|
519
526
|
* limitations under the License.
|
|
520
527
|
*/
|
|
521
528
|
|
|
522
|
-
declare class SubscribeNamespaceRequest implements PromiseLike<
|
|
529
|
+
declare class SubscribeNamespaceRequest implements PromiseLike<RequestOk | RequestError> {
|
|
523
530
|
readonly requestId: bigint;
|
|
524
531
|
readonly message: SubscribeNamespace;
|
|
525
532
|
private _resolve;
|
|
526
533
|
private _reject;
|
|
527
534
|
private promise;
|
|
528
535
|
constructor(msg: SubscribeNamespace);
|
|
529
|
-
resolve(value:
|
|
536
|
+
resolve(value: RequestOk | RequestError | PromiseLike<RequestOk | RequestError>): void;
|
|
530
537
|
reject(reason?: any): void;
|
|
531
|
-
then<TResult1 =
|
|
532
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<
|
|
533
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<
|
|
538
|
+
then<TResult1 = RequestOk | RequestError, TResult2 = never>(onfulfilled?: ((value: RequestOk | RequestError) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
|
|
539
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<RequestOk | RequestError | TResult>;
|
|
540
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<RequestOk | RequestError>;
|
|
534
541
|
}
|
|
535
542
|
|
|
536
543
|
/**
|
|
@@ -549,18 +556,18 @@ declare class SubscribeNamespaceRequest implements PromiseLike<SubscribeNamespac
|
|
|
549
556
|
* limitations under the License.
|
|
550
557
|
*/
|
|
551
558
|
|
|
552
|
-
declare class PublishRequest implements PromiseLike<PublishOk |
|
|
559
|
+
declare class PublishRequest implements PromiseLike<PublishOk | RequestError> {
|
|
553
560
|
readonly requestId: bigint;
|
|
554
561
|
readonly message: Publish;
|
|
555
562
|
private _resolve;
|
|
556
563
|
private _reject;
|
|
557
564
|
private promise;
|
|
558
565
|
constructor(msg: Publish);
|
|
559
|
-
resolve(value: PublishOk |
|
|
566
|
+
resolve(value: PublishOk | RequestError | PromiseLike<PublishOk | RequestError>): void;
|
|
560
567
|
reject(reason?: any): void;
|
|
561
|
-
then<TResult1 = PublishOk |
|
|
562
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<PublishOk |
|
|
563
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<PublishOk |
|
|
568
|
+
then<TResult1 = PublishOk | RequestError, TResult2 = never>(onfulfilled?: ((value: PublishOk | RequestError) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
|
|
569
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<PublishOk | RequestError | TResult>;
|
|
570
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<PublishOk | RequestError>;
|
|
564
571
|
}
|
|
565
572
|
|
|
566
573
|
/**
|
|
@@ -640,12 +647,12 @@ type MOQtailRequest = PublishRequest | PublishNamespaceRequest | SubscribeNamesp
|
|
|
640
647
|
type MOQtailClientOptions = {
|
|
641
648
|
/** Relay / server endpoint for the underlying {@link https://developer.mozilla.org/docs/Web/API/WebTransport | WebTransport} session (can be absolute {@link https://developer.mozilla.org/en-US/docs/Web/API/URL | URL} or string).*/
|
|
642
649
|
url: string | URL;
|
|
643
|
-
/** Ordered preference list of MOQT protocol version numbers (e.g. `0xff00000b`). */
|
|
644
|
-
supportedVersions: number[];
|
|
645
650
|
/** {@link SetupParameters} customizations; if omitted a default instance is built.*/
|
|
646
651
|
setupParameters?: SetupParameters;
|
|
647
652
|
/** Passed directly to the browser's {@link https://developer.mozilla.org/docs/Web/API/WebTransport | WebTransport} constructor for {@link https://developer.mozilla.org/docs/Web/API/WebTransportOptions | WebTransportOptions}. */
|
|
648
|
-
transportOptions?: WebTransportOptions
|
|
653
|
+
transportOptions?: WebTransportOptions & {
|
|
654
|
+
protocols?: string[];
|
|
655
|
+
};
|
|
649
656
|
/** Per *data* uni-stream idle timeout in milliseconds. */
|
|
650
657
|
dataStreamTimeoutMs?: number;
|
|
651
658
|
/** Control stream read timeout in milliseconds. */
|
|
@@ -661,9 +668,9 @@ type MOQtailClientOptions = {
|
|
|
661
668
|
/** Fired once when the session ends (normal or error). Receives the reason passed to {@link MOQtailClient.disconnect | disconnect}. */
|
|
662
669
|
onSessionTerminated?: (reason?: unknown) => void;
|
|
663
670
|
/** Invoked for each decoded datagram object/status arriving. */
|
|
664
|
-
onDatagramReceived?: (data:
|
|
671
|
+
onDatagramReceived?: (data: Datagram) => void;
|
|
665
672
|
/** Invoked after enqueuing each outbound datagram object/status. */
|
|
666
|
-
onDatagramSent?: (data:
|
|
673
|
+
onDatagramSent?: (data: Datagram) => void;
|
|
667
674
|
};
|
|
668
675
|
};
|
|
669
676
|
/**
|
|
@@ -703,8 +710,8 @@ type SubscribeOptions = {
|
|
|
703
710
|
forward: boolean;
|
|
704
711
|
/** {@link FilterType} variant controlling starting subset (e.g. {@link FilterType.LatestObject}). */
|
|
705
712
|
filterType: FilterType;
|
|
706
|
-
/** Optional extension
|
|
707
|
-
parameters?:
|
|
713
|
+
/** Optional extension parameters appended to the SUBSCRIBE control message. */
|
|
714
|
+
parameters?: MessageParameter[];
|
|
708
715
|
/** Required for {@link FilterType.AbsoluteStart} / {@link FilterType.AbsoluteRange}; earliest {@link Location} to include. */
|
|
709
716
|
startLocation?: Location;
|
|
710
717
|
/** Required for {@link FilterType.AbsoluteRange}; exclusive upper group boundary (coerced to bigint if number provided). */
|
|
@@ -737,8 +744,8 @@ type SubscribeUpdateOptions = {
|
|
|
737
744
|
priority: number;
|
|
738
745
|
/** Updated direction flag. */
|
|
739
746
|
forward: boolean;
|
|
740
|
-
/** Optional additional
|
|
741
|
-
parameters?:
|
|
747
|
+
/** Optional additional parameters; existing parameters persist if omitted. */
|
|
748
|
+
parameters?: MessageParameter[];
|
|
742
749
|
};
|
|
743
750
|
/**
|
|
744
751
|
* Parameters for {@link MOQtailClient.switch | switching} an existing SUBSCRIBE to a new track.
|
|
@@ -756,8 +763,8 @@ type SwitchOptions = {
|
|
|
756
763
|
fullTrackName: FullTrackName;
|
|
757
764
|
/** The original SUBSCRIBE request id (bigint) being updated. */
|
|
758
765
|
subscriptionRequestId: bigint;
|
|
759
|
-
/** Optional additional
|
|
760
|
-
parameters?:
|
|
766
|
+
/** Optional additional parameters; existing parameters persist if omitted. */
|
|
767
|
+
parameters?: MessageParameter[];
|
|
761
768
|
};
|
|
762
769
|
/**
|
|
763
770
|
* Options for {@link MOQtailClient.fetch | performing a FETCH} operation for historical or relative object ranges.
|
|
@@ -768,7 +775,7 @@ type SwitchOptions = {
|
|
|
768
775
|
* priority: 64,
|
|
769
776
|
* groupOrder: GroupOrder.Original,
|
|
770
777
|
* typeAndProps: {
|
|
771
|
-
* type: FetchType.
|
|
778
|
+
* type: FetchType.Standalone,
|
|
772
779
|
* props: { fullTrackName, startLocation, endLocation }
|
|
773
780
|
* }
|
|
774
781
|
* })
|
|
@@ -792,6 +799,13 @@ type SwitchOptions = {
|
|
|
792
799
|
* })
|
|
793
800
|
* ```
|
|
794
801
|
*/
|
|
802
|
+
/**
|
|
803
|
+
* Configuration for the early discard policy applied to incoming subgroup streams.
|
|
804
|
+
*/
|
|
805
|
+
type EarlyDiscardPolicyConfig = {
|
|
806
|
+
/** Cancel a subgroup QUIC stream if it has not fully completed within this many milliseconds. */
|
|
807
|
+
subgroupReceiveTimeout: number;
|
|
808
|
+
};
|
|
795
809
|
type FetchOptions = {
|
|
796
810
|
/** Request priority (0 = highest, 255 = lowest). Rounded & clamped. */
|
|
797
811
|
priority: number;
|
|
@@ -799,12 +813,12 @@ type FetchOptions = {
|
|
|
799
813
|
groupOrder: GroupOrder;
|
|
800
814
|
/**
|
|
801
815
|
* Discriminated union selecting the {@link FetchType} mode and its specific properties:
|
|
802
|
-
* -
|
|
816
|
+
* - Standalone: full explicit range on a {@link FullTrackName} with start/end {@link Location}s.
|
|
803
817
|
* - Relative / Absolute: join an existing {@link SubscribeRequest} (identified by `joiningRequestId`) with starting position `joiningStart`.
|
|
804
818
|
*/
|
|
805
819
|
typeAndProps: {
|
|
806
820
|
/** Standalone historical/segment fetch for a specific {@link FullTrackName}. */
|
|
807
|
-
type: FetchType.
|
|
821
|
+
type: FetchType.Standalone;
|
|
808
822
|
/** Properties for standalone fetch: explicit track and range. */
|
|
809
823
|
props: {
|
|
810
824
|
fullTrackName: FullTrackName;
|
|
@@ -828,8 +842,8 @@ type FetchOptions = {
|
|
|
828
842
|
joiningStart: bigint;
|
|
829
843
|
};
|
|
830
844
|
};
|
|
831
|
-
/** Optional
|
|
832
|
-
parameters?:
|
|
845
|
+
/** Optional parameters block. */
|
|
846
|
+
parameters?: MessageParameter[];
|
|
833
847
|
};
|
|
834
848
|
|
|
835
849
|
/**
|
|
@@ -860,8 +874,8 @@ type FetchOptions = {
|
|
|
860
874
|
*/
|
|
861
875
|
declare class SendDatagramStream {
|
|
862
876
|
#private;
|
|
863
|
-
readonly onDataSent?: (data:
|
|
864
|
-
constructor(writer: WritableStreamDefaultWriter<Uint8Array>, trackAlias: bigint, onDataSent?: (data:
|
|
877
|
+
readonly onDataSent?: (data: Datagram) => void;
|
|
878
|
+
constructor(writer: WritableStreamDefaultWriter<Uint8Array>, trackAlias: bigint, onDataSent?: (data: Datagram) => void);
|
|
865
879
|
/**
|
|
866
880
|
* Create a new datagram sender for a specific track.
|
|
867
881
|
*
|
|
@@ -870,7 +884,7 @@ declare class SendDatagramStream {
|
|
|
870
884
|
* @param onDataSent - Optional callback fired when datagram is sent
|
|
871
885
|
* @returns SendDatagramStream instance
|
|
872
886
|
*/
|
|
873
|
-
static new(writeStream: WritableStream<Uint8Array>, trackAlias: bigint, onDataSent?: (data:
|
|
887
|
+
static new(writeStream: WritableStream<Uint8Array>, trackAlias: bigint, onDataSent?: (data: Datagram) => void): Promise<SendDatagramStream>;
|
|
874
888
|
/**
|
|
875
889
|
* Create a datagram sender using an existing shared writer.
|
|
876
890
|
* Use this when multiple senders need to share a single writer.
|
|
@@ -880,13 +894,12 @@ declare class SendDatagramStream {
|
|
|
880
894
|
* @param onDataSent - Optional callback fired when datagram is sent
|
|
881
895
|
* @returns SendDatagramStream instance
|
|
882
896
|
*/
|
|
883
|
-
static fromWriter(writer: WritableStreamDefaultWriter<Uint8Array>, trackAlias: bigint, onDataSent?: (data:
|
|
897
|
+
static fromWriter(writer: WritableStreamDefaultWriter<Uint8Array>, trackAlias: bigint, onDataSent?: (data: Datagram) => void): SendDatagramStream;
|
|
884
898
|
/**
|
|
885
899
|
* Write a MoqtObject as a datagram.
|
|
886
|
-
* Converts to
|
|
900
|
+
* Converts to Datagram automatically based on object state.
|
|
887
901
|
*
|
|
888
902
|
* @param object - MoqtObject to send (must have Datagram forwarding preference)
|
|
889
|
-
* @throws ProtocolViolationError if object is not datagram-compatible
|
|
890
903
|
*/
|
|
891
904
|
write(object: MoqtObject): Promise<void>;
|
|
892
905
|
/**
|
|
@@ -903,8 +916,7 @@ declare class SendDatagramStream {
|
|
|
903
916
|
* Parallel to RecvStream but for datagram-based delivery.
|
|
904
917
|
*
|
|
905
918
|
* Automatically handles:
|
|
906
|
-
* -
|
|
907
|
-
* - DatagramStatus parsing (status-only objects)
|
|
919
|
+
* - Datagram parsing (both payload and status datagrams)
|
|
908
920
|
* - Track alias to full track name resolution
|
|
909
921
|
*
|
|
910
922
|
* @example
|
|
@@ -922,7 +934,7 @@ declare class SendDatagramStream {
|
|
|
922
934
|
declare class RecvDatagramStream {
|
|
923
935
|
#private;
|
|
924
936
|
readonly stream: ReadableStream<MoqtObject>;
|
|
925
|
-
readonly onDataReceived?: (data:
|
|
937
|
+
readonly onDataReceived?: (data: Datagram) => void;
|
|
926
938
|
private constructor();
|
|
927
939
|
/**
|
|
928
940
|
* Create a new datagram receiver.
|
|
@@ -932,7 +944,7 @@ declare class RecvDatagramStream {
|
|
|
932
944
|
* @param onDataReceived - Optional callback fired when datagram is received
|
|
933
945
|
* @returns RecvDatagramStream instance
|
|
934
946
|
*/
|
|
935
|
-
static new(readStream: ReadableStream<Uint8Array>, trackAliasResolver: (trackAlias: bigint) => FullTrackName, onDataReceived?: (data:
|
|
947
|
+
static new(readStream: ReadableStream<Uint8Array>, trackAliasResolver: (trackAlias: bigint) => FullTrackName, onDataReceived?: (data: Datagram) => void): Promise<RecvDatagramStream>;
|
|
936
948
|
/**
|
|
937
949
|
* Cancel the datagram reader.
|
|
938
950
|
*/
|
|
@@ -943,6 +955,22 @@ declare class RecvDatagramStream {
|
|
|
943
955
|
releaseLock(): void;
|
|
944
956
|
}
|
|
945
957
|
|
|
958
|
+
/**
|
|
959
|
+
* Copyright 2025 The MOQtail Authors
|
|
960
|
+
*
|
|
961
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
962
|
+
* you may not use this file except in compliance with the License.
|
|
963
|
+
* You may obtain a copy of the License at
|
|
964
|
+
*
|
|
965
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
966
|
+
*
|
|
967
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
968
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
969
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
970
|
+
* See the License for the specific language governing permissions and
|
|
971
|
+
* limitations under the License.
|
|
972
|
+
*/
|
|
973
|
+
|
|
946
974
|
/**
|
|
947
975
|
* @public
|
|
948
976
|
* Represents a Media Over QUIC Transport (MOQT) client session.
|
|
@@ -957,7 +985,7 @@ declare class RecvDatagramStream {
|
|
|
957
985
|
*
|
|
958
986
|
* ### Connect and Subscribe to a Track
|
|
959
987
|
* ```ts
|
|
960
|
-
* const client = await MOQtailClient.new({ url
|
|
988
|
+
* const client = await MOQtailClient.new({ url });
|
|
961
989
|
* const result = await client.subscribe({
|
|
962
990
|
* fullTrackName,
|
|
963
991
|
* filterType: FilterType.LatestObject,
|
|
@@ -965,7 +993,7 @@ declare class RecvDatagramStream {
|
|
|
965
993
|
* groupOrder: GroupOrder.Original,
|
|
966
994
|
* priority: 0
|
|
967
995
|
* });
|
|
968
|
-
* if (!(result instanceof
|
|
996
|
+
* if (!(result instanceof RequestError)) {
|
|
969
997
|
* for await (const object of result.stream) {
|
|
970
998
|
* // Consume MOQT objects
|
|
971
999
|
* }
|
|
@@ -974,9 +1002,9 @@ declare class RecvDatagramStream {
|
|
|
974
1002
|
*
|
|
975
1003
|
* ### Publish a namespace for Publishing
|
|
976
1004
|
* ```ts
|
|
977
|
-
* const client = await MOQtailClient.new({ url
|
|
1005
|
+
* const client = await MOQtailClient.new({ url });
|
|
978
1006
|
* const publishNamespaceResult = await client.publishNamespace(["camera", "main"]);
|
|
979
|
-
* if (!(publishNamespaceResult instanceof
|
|
1007
|
+
* if (!(publishNamespaceResult instanceof RequestError)) {
|
|
980
1008
|
* // Ready to publish objects under this namespace
|
|
981
1009
|
* }
|
|
982
1010
|
* ```
|
|
@@ -1070,7 +1098,7 @@ declare class MOQtailClient {
|
|
|
1070
1098
|
*/
|
|
1071
1099
|
onGoaway?: (msg: GoAway) => void;
|
|
1072
1100
|
/**
|
|
1073
|
-
* Fired if the underlying WebTransport session fails (ready
|
|
1101
|
+
* Fired if the underlying WebTransport session fails (ready -\> closed prematurely).
|
|
1074
1102
|
* Use to log or alert on transport errors.
|
|
1075
1103
|
* Lifecycle/error handler.
|
|
1076
1104
|
*/
|
|
@@ -1112,15 +1140,19 @@ declare class MOQtailClient {
|
|
|
1112
1140
|
*/
|
|
1113
1141
|
onError?: (er: unknown) => void;
|
|
1114
1142
|
/** Invoked for each decoded datagram object/status arriving. */
|
|
1115
|
-
onDatagramReceived?: (data:
|
|
1143
|
+
onDatagramReceived?: (data: Datagram) => void;
|
|
1116
1144
|
/** Invoked after enqueuing each outbound datagram object/status. */
|
|
1117
|
-
onDatagramSent?: (data:
|
|
1145
|
+
onDatagramSent?: (data: Datagram) => void;
|
|
1118
1146
|
/** Fired when an inbound PUBLISH control message is received. */
|
|
1119
1147
|
onPeerPublish?: (msg: Publish, stream: ReadableStream<MoqtObject>) => void;
|
|
1120
1148
|
/** Fired when an inbound PUBLISH_DONE control message is received. */
|
|
1121
1149
|
onPeerPublishDone?: (msg: PublishDone) => void;
|
|
1122
1150
|
/** Fired when an inbound SUBSCRIBE_NAMESPACE control message is received. */
|
|
1123
1151
|
onPeerSubscribeNamespace?: (msg: SubscribeNamespace) => void;
|
|
1152
|
+
/** Fired when a NAMESPACE message arrives on a SUBSCRIBE_NAMESPACE bi-stream (prefix + suffix). */
|
|
1153
|
+
onPeerNamespace?: (prefix: Tuple, suffix: Tuple) => void;
|
|
1154
|
+
/** Fired when a NAMESPACE_DONE message arrives on a SUBSCRIBE_NAMESPACE bi-stream (prefix + suffix). */
|
|
1155
|
+
onPeerNamespaceDone?: (prefix: Tuple, suffix: Tuple) => void;
|
|
1124
1156
|
/**
|
|
1125
1157
|
* Stream of all received MoqtObjects from datagrams across all tracks
|
|
1126
1158
|
* Consumer should filter by fullTrackName as needed
|
|
@@ -1143,6 +1175,16 @@ declare class MOQtailClient {
|
|
|
1143
1175
|
* Returns true if datagram support is currently active
|
|
1144
1176
|
*/
|
|
1145
1177
|
get isDatagramsEnabled(): boolean;
|
|
1178
|
+
/**
|
|
1179
|
+
* Sets the global log level for all moqtail-ts loggers.
|
|
1180
|
+
* @param level - The minimum {@link LogLevel} to output. Use `LogLevel.NONE` to silence all logs.
|
|
1181
|
+
*/
|
|
1182
|
+
static setLogLevel(level: LogLevel): void;
|
|
1183
|
+
/**
|
|
1184
|
+
* Restricts log output to the specified module names. Pass `null` to allow all modules.
|
|
1185
|
+
* @param modules - Array of module name strings, or `null` to enable all modules.
|
|
1186
|
+
*/
|
|
1187
|
+
static setLogEnabledModules(modules: string[] | null): void;
|
|
1146
1188
|
private constructor();
|
|
1147
1189
|
/**
|
|
1148
1190
|
* Establishes a new {@link MOQtailClient} session over WebTransport and performs the MOQT setup handshake.
|
|
@@ -1156,8 +1198,7 @@ declare class MOQtailClient {
|
|
|
1156
1198
|
* @example Minimal connection
|
|
1157
1199
|
* ```ts
|
|
1158
1200
|
* const client = await MOQtailClient.new({
|
|
1159
|
-
* url: 'https://relay.example.com/transport'
|
|
1160
|
-
* supportedVersions: [0xff00000b]
|
|
1201
|
+
* url: 'https://relay.example.com/transport'
|
|
1161
1202
|
* });
|
|
1162
1203
|
* ```
|
|
1163
1204
|
*
|
|
@@ -1165,7 +1206,6 @@ declare class MOQtailClient {
|
|
|
1165
1206
|
* ```ts
|
|
1166
1207
|
* const client = await MOQtailClient.new({
|
|
1167
1208
|
* url,
|
|
1168
|
-
* supportedVersions: [0xff00000b],
|
|
1169
1209
|
* setupParameters: new SetupParameters().addMaxRequestId(1000),
|
|
1170
1210
|
* transportOptions: { congestionControl: 'default' },
|
|
1171
1211
|
* dataStreamTimeoutMs: 5000,
|
|
@@ -1244,6 +1284,22 @@ declare class MOQtailClient {
|
|
|
1244
1284
|
* ```
|
|
1245
1285
|
*/
|
|
1246
1286
|
sendDatagram(trackAlias: bigint, object: MoqtObject): Promise<void>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Sets (or replaces) the early discard policy for incoming subgroup streams.
|
|
1289
|
+
*
|
|
1290
|
+
* When set, each incoming subgroup QUIC stream is given a deadline of `subgroupReceiveTimeout` ms to
|
|
1291
|
+
* complete. If the stream has not finished within that window it is cancelled — objects already
|
|
1292
|
+
* delivered to the subscription are kept, but no further objects arrive from that stream.
|
|
1293
|
+
*
|
|
1294
|
+
* The policy takes effect on the next stream accepted after this call. Passing a new config
|
|
1295
|
+
* replaces the previous one. Pass `undefined` to remove the policy.
|
|
1296
|
+
*
|
|
1297
|
+
* @example
|
|
1298
|
+
* ```ts
|
|
1299
|
+
* client.setEarlyDiscardPolicy({ subgroupReceiveTimeout: 2000 })
|
|
1300
|
+
* ```
|
|
1301
|
+
*/
|
|
1302
|
+
setEarlyDiscardPolicy(config: EarlyDiscardPolicyConfig | undefined): void;
|
|
1247
1303
|
/**
|
|
1248
1304
|
* Gracefully terminates this {@link MOQtailClient} session and releases underlying {@link https://developer.mozilla.org/docs/Web/API/WebTransport | WebTransport} resources.
|
|
1249
1305
|
*
|
|
@@ -1354,11 +1410,11 @@ declare class MOQtailClient {
|
|
|
1354
1410
|
* - `filterType: AbsoluteRange` lets you specify a start and end group, both of should be in the future; the stream waits for those objects. If the start location is \< the latest object
|
|
1355
1411
|
* observed at the publisher then it behaves as `filterType: LatestObject`.
|
|
1356
1412
|
*
|
|
1357
|
-
* The method returns either a {@link
|
|
1413
|
+
* The method returns either a {@link RequestError} (on refusal) or an object with the subscription `requestId` and a `ReadableStream` of {@link MoqtObject}s.
|
|
1358
1414
|
* Use the `requestId` for {@link MOQtailClient.unsubscribe} or {@link MOQtailClient.subscribeUpdate}. Use the `stream` to decode and display objects.
|
|
1359
1415
|
*
|
|
1360
1416
|
* @param args - {@link SubscribeOptions} describing the subscription window and relay forwarding behavior.
|
|
1361
|
-
* @returns Either a {@link
|
|
1417
|
+
* @returns Either a {@link RequestError} or `{ requestId, stream }` for consuming objects.
|
|
1362
1418
|
* @throws : {@link MOQtailError} If the client is destroyed.
|
|
1363
1419
|
* @throws : {@link ProtocolViolationError} If required fields are missing or inconsistent.
|
|
1364
1420
|
* @throws : {@link InternalError} On transport/protocol failure (disconnect is triggered before rethrow).
|
|
@@ -1372,7 +1428,7 @@ declare class MOQtailClient {
|
|
|
1372
1428
|
* groupOrder: GroupOrder.Original,
|
|
1373
1429
|
* priority: 32
|
|
1374
1430
|
* });
|
|
1375
|
-
* if (!(result instanceof
|
|
1431
|
+
* if (!(result instanceof RequestError)) {
|
|
1376
1432
|
* for await (const obj of result.stream) {
|
|
1377
1433
|
* // decode and display obj
|
|
1378
1434
|
* }
|
|
@@ -1392,7 +1448,7 @@ declare class MOQtailClient {
|
|
|
1392
1448
|
* });
|
|
1393
1449
|
* ```
|
|
1394
1450
|
*/
|
|
1395
|
-
subscribe(args: SubscribeOptions): Promise<
|
|
1451
|
+
subscribe(args: SubscribeOptions): Promise<RequestError | {
|
|
1396
1452
|
requestId: bigint;
|
|
1397
1453
|
stream: ReadableStream<MoqtObject>;
|
|
1398
1454
|
}>;
|
|
@@ -1417,7 +1473,7 @@ declare class MOQtailClient {
|
|
|
1417
1473
|
* @example Subscribe and later unsubscribe
|
|
1418
1474
|
* ```ts
|
|
1419
1475
|
* const sub = await client.subscribe({ fullTrackName, filterType: FilterType.LatestObject, forward: true, groupOrder: GroupOrder.Original, priority: 0 });
|
|
1420
|
-
* if (!(sub instanceof
|
|
1476
|
+
* if (!(sub instanceof RequestError)) {
|
|
1421
1477
|
* // ...consume objects...
|
|
1422
1478
|
* await client.unsubscribe(sub.requestId);
|
|
1423
1479
|
* }
|
|
@@ -1489,7 +1545,7 @@ declare class MOQtailClient {
|
|
|
1489
1545
|
* await client.switch({ subscriptionRequestId, fullTrackName: newTrackName });
|
|
1490
1546
|
* ```
|
|
1491
1547
|
*/
|
|
1492
|
-
switch(args: SwitchOptions): Promise<
|
|
1548
|
+
switch(args: SwitchOptions): Promise<RequestError | {
|
|
1493
1549
|
requestId: bigint;
|
|
1494
1550
|
stream: ReadableStream<MoqtObject>;
|
|
1495
1551
|
}>;
|
|
@@ -1497,7 +1553,7 @@ declare class MOQtailClient {
|
|
|
1497
1553
|
* One-shot retrieval of a bounded object span, optionally anchored to an existing subscription, returning a stream of {@link MoqtObject}s.
|
|
1498
1554
|
*
|
|
1499
1555
|
* Choose a fetch type via `typeAndProps.type`:
|
|
1500
|
-
* -
|
|
1556
|
+
* - Standalone: Historical slice of a specific {@link FullTrackName} independent of active subscriptions.
|
|
1501
1557
|
* - Relative: Range relative to the JOINING subscription's current (largest) location; use when you want "N groups back" from live.
|
|
1502
1558
|
* - Absolute: Absolute group/object offsets tied to an existing subscription (stable anchor) even if that subscription keeps forwarding.
|
|
1503
1559
|
*
|
|
@@ -1507,7 +1563,7 @@ declare class MOQtailClient {
|
|
|
1507
1563
|
* - typeAndProps: Discriminated union carrying parameters specific to each fetch mode (see examples).
|
|
1508
1564
|
* - parameters: Optional version-specific extension block.
|
|
1509
1565
|
*
|
|
1510
|
-
* Returns either a {@link
|
|
1566
|
+
* Returns either a {@link RequestError} (refusal / invalid request at protocol level) or `{ requestId, stream }` whose `stream`
|
|
1511
1567
|
* ends naturally after the bounded range completes (no explicit cancel needed for normal completion).
|
|
1512
1568
|
*
|
|
1513
1569
|
* Use cases:
|
|
@@ -1530,11 +1586,11 @@ declare class MOQtailClient {
|
|
|
1530
1586
|
* priority: 64,
|
|
1531
1587
|
* groupOrder: GroupOrder.Original,
|
|
1532
1588
|
* typeAndProps: {
|
|
1533
|
-
* type: FetchType.
|
|
1589
|
+
* type: FetchType.Standalone,
|
|
1534
1590
|
* props: { fullTrackName, startLocation, endLocation }
|
|
1535
1591
|
* }
|
|
1536
1592
|
* })
|
|
1537
|
-
* if (!(r instanceof
|
|
1593
|
+
* if (!(r instanceof RequestError)) {
|
|
1538
1594
|
* for await (const obj of r.stream as any) {
|
|
1539
1595
|
* // consume objects then stream ends automatically
|
|
1540
1596
|
* }
|
|
@@ -1544,7 +1600,7 @@ declare class MOQtailClient {
|
|
|
1544
1600
|
* @example Relative to live subscription (e.g. last 5 groups)
|
|
1545
1601
|
* ```ts
|
|
1546
1602
|
* const sub = await client.subscribe({ fullTrackName, filterType: FilterType.LatestObject, forward: true, groupOrder: GroupOrder.Original, priority: 0 })
|
|
1547
|
-
* if (!(sub instanceof
|
|
1603
|
+
* if (!(sub instanceof RequestError)) {
|
|
1548
1604
|
* const slice = await client.fetch({
|
|
1549
1605
|
* priority: 32,
|
|
1550
1606
|
* groupOrder: GroupOrder.Original,
|
|
@@ -1553,7 +1609,7 @@ declare class MOQtailClient {
|
|
|
1553
1609
|
* }
|
|
1554
1610
|
* ```
|
|
1555
1611
|
*/
|
|
1556
|
-
fetch(args: FetchOptions): Promise<
|
|
1612
|
+
fetch(args: FetchOptions): Promise<RequestError | {
|
|
1557
1613
|
requestId: bigint;
|
|
1558
1614
|
stream: ReadableStream<MoqtObject>;
|
|
1559
1615
|
}>;
|
|
@@ -1579,8 +1635,8 @@ declare class MOQtailClient {
|
|
|
1579
1635
|
*
|
|
1580
1636
|
* @example Cancel shortly after starting
|
|
1581
1637
|
* ```ts
|
|
1582
|
-
* const r = await client.fetch({ priority: 32, groupOrder: GroupOrder.Original, typeAndProps: { type: FetchType.
|
|
1583
|
-
* if (!(r instanceof
|
|
1638
|
+
* const r = await client.fetch({ priority: 32, groupOrder: GroupOrder.Original, typeAndProps: { type: FetchType.Standalone, props: { fullTrackName, startLocation, endLocation } } })
|
|
1639
|
+
* if (!(r instanceof RequestError)) {
|
|
1584
1640
|
* // user navigated away
|
|
1585
1641
|
* await client.fetchCancel(r.requestId)
|
|
1586
1642
|
* }
|
|
@@ -1596,7 +1652,7 @@ declare class MOQtailClient {
|
|
|
1596
1652
|
/**
|
|
1597
1653
|
* Proactively push a track to the relay/peer.
|
|
1598
1654
|
*/
|
|
1599
|
-
publish(fullTrackName: FullTrackName, forward: boolean, trackAlias: bigint, parameters?:
|
|
1655
|
+
publish(fullTrackName: FullTrackName, forward: boolean, trackAlias: bigint, parameters?: MessageParameter[], trackExtensions?: TrackExtension[]): Promise<RequestError | {
|
|
1600
1656
|
requestId: bigint;
|
|
1601
1657
|
trackAlias: bigint;
|
|
1602
1658
|
}>;
|
|
@@ -1623,9 +1679,9 @@ declare class MOQtailClient {
|
|
|
1623
1679
|
*
|
|
1624
1680
|
* Parameter semantics:
|
|
1625
1681
|
* - trackNamespace: Tuple representing the namespace prefix (e.g. ["camera","main"]). All tracks whose full names start with this tuple are considered within the announce scope.
|
|
1626
|
-
* - parameters: Optional {@link
|
|
1682
|
+
* - parameters: Optional {@link MessageParameters}; omitted =\> default instance.
|
|
1627
1683
|
*
|
|
1628
|
-
* Returns: {@link
|
|
1684
|
+
* Returns: {@link RequestOk} on success (namespace added to `announcedNamespaces`) or {@link RequestError} explaining refusal.
|
|
1629
1685
|
*
|
|
1630
1686
|
* Use cases:
|
|
1631
1687
|
* - Make a camera or sensor namespace available before any objects are pushed.
|
|
@@ -1643,18 +1699,18 @@ declare class MOQtailClient {
|
|
|
1643
1699
|
* @example Minimal announce
|
|
1644
1700
|
* ```ts
|
|
1645
1701
|
* const res = await client.publishNamespace(["camera","main"])
|
|
1646
|
-
* if (res instanceof
|
|
1702
|
+
* if (res instanceof RequestOk) {
|
|
1647
1703
|
* // ready to publish objects under tracks with this namespace prefix
|
|
1648
1704
|
* }
|
|
1649
1705
|
* ```
|
|
1650
1706
|
*
|
|
1651
1707
|
* @example PublishNamespace with parameters block
|
|
1652
1708
|
* ```ts
|
|
1653
|
-
* const params = new
|
|
1709
|
+
* const params = new MessageParameters().setSomeExtensionFlag(true)
|
|
1654
1710
|
* const resp = await client.publishNamespace(["room","1234"], params)
|
|
1655
1711
|
* ```
|
|
1656
1712
|
*/
|
|
1657
|
-
publishNamespace(trackNamespace: Tuple, parameters?:
|
|
1713
|
+
publishNamespace(trackNamespace: Tuple, parameters?: MessageParameter[]): Promise<RequestOk | RequestError>;
|
|
1658
1714
|
/**
|
|
1659
1715
|
* Withdraw a previously announced namespace so new subscribers no longer discover its tracks.
|
|
1660
1716
|
*
|
|
@@ -1716,10 +1772,43 @@ declare class MOQtailClient {
|
|
|
1716
1772
|
* ```
|
|
1717
1773
|
*/
|
|
1718
1774
|
publishNamespaceCancel(msg: PublishNamespaceCancel): Promise<void>;
|
|
1719
|
-
subscribeNamespace(trackNamespacePrefix: Tuple, parameters?:
|
|
1775
|
+
subscribeNamespace(trackNamespacePrefix: Tuple, subscribeOptions?: NamespaceSubscribeOptions, parameters?: MessageParameter[]): Promise<{
|
|
1776
|
+
response: RequestOk | RequestError;
|
|
1777
|
+
cancel: () => Promise<void>;
|
|
1778
|
+
}>;
|
|
1720
1779
|
unsubscribeNamespace(msg: UnsubscribeNamespace): Promise<void>;
|
|
1721
1780
|
}
|
|
1722
1781
|
|
|
1782
|
+
/**
|
|
1783
|
+
* Copyright 2026 The MOQtail Authors
|
|
1784
|
+
*
|
|
1785
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1786
|
+
* you may not use this file except in compliance with the License.
|
|
1787
|
+
* You may obtain a copy of the License at
|
|
1788
|
+
*
|
|
1789
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1790
|
+
*
|
|
1791
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1792
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1793
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1794
|
+
* See the License for the specific language governing permissions and
|
|
1795
|
+
* limitations under the License.
|
|
1796
|
+
*/
|
|
1797
|
+
|
|
1798
|
+
declare class TrackStatusRequest implements PromiseLike<RequestOk | RequestError> {
|
|
1799
|
+
readonly requestId: bigint;
|
|
1800
|
+
readonly message: TrackStatus;
|
|
1801
|
+
private _resolve;
|
|
1802
|
+
private _reject;
|
|
1803
|
+
private promise;
|
|
1804
|
+
constructor(msg: TrackStatus);
|
|
1805
|
+
resolve(value: RequestOk | RequestError | PromiseLike<RequestOk | RequestError>): void;
|
|
1806
|
+
reject(reason?: any): void;
|
|
1807
|
+
then<TResult1 = RequestOk | RequestError, TResult2 = never>(onfulfilled?: ((value: RequestOk | RequestError) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
|
|
1808
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<RequestOk | RequestError | TResult>;
|
|
1809
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<RequestOk | RequestError>;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1723
1812
|
/**
|
|
1724
1813
|
* Copyright 2025 The MOQtail Authors
|
|
1725
1814
|
*
|
|
@@ -1754,4 +1843,4 @@ declare class RecvStream {
|
|
|
1754
1843
|
static new(readStream: ReadableStream<Uint8Array>, partialDataTimeout?: number, onDataReceived?: (data: SubgroupObject | SubgroupHeader | FetchObject | FetchHeader) => void): Promise<RecvStream>;
|
|
1755
1844
|
}
|
|
1756
1845
|
|
|
1757
|
-
export { ControlStream, type FetchOptions, FetchPublication, FetchRequest, HybridTrackSource, type LiveObjectSource, LiveTrackSource, MOQtailClient, type MOQtailClientOptions, type MOQtailRequest, MemoryObjectCache, type ObjectCache, type PastObjectSource, PublishNamespaceRequest, PublishPublication, PublishRequest, RecvDatagramStream, RecvStream, RingBufferObjectCache, SendDatagramStream, SendStream, StaticTrackSource, SubscribeNamespaceRequest, type SubscribeOptions, SubscribePublication, SubscribeRequest, type SubscribeUpdateOptions, type SwitchOptions, type Track, type TrackSource };
|
|
1846
|
+
export { ControlStream, type EarlyDiscardPolicyConfig, type FetchOptions, FetchPublication, FetchRequest, HybridTrackSource, type LiveObjectSource, LiveTrackSource, MOQtailClient, type MOQtailClientOptions, type MOQtailRequest, MemoryObjectCache, type ObjectCache, type PastObjectSource, PublishNamespaceRequest, PublishPublication, PublishRequest, RecvDatagramStream, RecvStream, RingBufferObjectCache, SendDatagramStream, SendStream, StaticTrackSource, SubscribeNamespaceRequest, type SubscribeOptions, SubscribePublication, SubscribeRequest, type SubscribeUpdateOptions, type SwitchOptions, type Track, type TrackSource, TrackStatusRequest };
|