@moq/net 0.4.7 → 0.22.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 +7 -1
- package/announce.d.ts +1 -1
- package/announce.d.ts.map +1 -1
- package/announce.js +1 -2
- package/announce.js.map +1 -1
- package/announced.d.ts +51 -47
- package/announced.d.ts.map +1 -1
- package/announced.js +183 -32
- package/announced.js.map +1 -1
- package/announced.test-util.d.ts +2 -0
- package/announced.test-util.d.ts.map +1 -0
- package/announced.test-util.js +27 -0
- package/announced.test-util.js.map +1 -0
- package/auth.d.ts +64 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +20 -0
- package/auth.js.map +1 -0
- package/auth_gate.d.ts +2 -0
- package/auth_gate.d.ts.map +1 -0
- package/auth_gate.js +24 -0
- package/auth_gate.js.map +1 -0
- package/auth_session.d.ts +49 -0
- package/auth_session.d.ts.map +1 -0
- package/auth_session.js +1097 -0
- package/auth_session.js.map +1 -0
- package/bandwidth.d.ts +129 -25
- package/bandwidth.d.ts.map +1 -1
- package/bandwidth.js +410 -139
- package/bandwidth.js.map +1 -1
- package/bandwidth_api.d.ts +1 -1
- package/bandwidth_api.d.ts.map +1 -1
- package/bandwidth_api.js +1 -2
- package/bandwidth_api.js.map +1 -1
- package/broadcast.d.ts +64 -38
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +556 -173
- package/broadcast.js.map +1 -1
- package/cache.d.ts +103 -0
- package/cache.d.ts.map +1 -0
- package/cache.js +254 -0
- package/cache.js.map +1 -0
- package/claim.test-util.d.ts +5 -0
- package/claim.test-util.d.ts.map +1 -0
- package/claim.test-util.js +13 -0
- package/claim.test-util.js.map +1 -0
- package/connection/accept.d.ts +21 -13
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +97 -130
- package/connection/accept.js.map +1 -1
- package/connection/browser.d.ts.map +1 -1
- package/connection/browser.js +28 -20
- package/connection/browser.js.map +1 -1
- package/connection/connect.d.ts +120 -24
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +535 -217
- package/connection/connect.js.map +1 -1
- package/connection/dials.d.ts +45 -0
- package/connection/dials.d.ts.map +1 -0
- package/connection/dials.js +109 -0
- package/connection/dials.js.map +1 -0
- package/connection/endpoint.d.ts +60 -0
- package/connection/endpoint.d.ts.map +1 -0
- package/connection/endpoint.js +114 -0
- package/connection/endpoint.js.map +1 -0
- package/connection/forward.d.ts +7 -1
- package/connection/forward.d.ts.map +1 -1
- package/connection/forward.js +265 -81
- package/connection/forward.js.map +1 -1
- package/connection/goaway.d.ts +16 -9
- package/connection/goaway.d.ts.map +1 -1
- package/connection/goaway.js +22 -95
- package/connection/goaway.js.map +1 -1
- package/connection/handshake.d.ts +34 -8
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +97 -21
- package/connection/handshake.js.map +1 -1
- package/connection/index.d.ts +4 -7
- package/connection/index.d.ts.map +1 -1
- package/connection/index.js +1 -3
- package/connection/index.js.map +1 -1
- package/connection/liveness.d.ts +14 -0
- package/connection/liveness.d.ts.map +1 -0
- package/connection/liveness.js +30 -0
- package/connection/liveness.js.map +1 -0
- package/connection/pool.d.ts +142 -63
- package/connection/pool.d.ts.map +1 -1
- package/connection/pool.js +281 -118
- package/connection/pool.js.map +1 -1
- package/connection/reload.d.ts +60 -12
- package/connection/reload.d.ts.map +1 -1
- package/connection/reload.js +859 -234
- package/connection/reload.js.map +1 -1
- package/connection/session.d.ts +91 -0
- package/connection/session.d.ts.map +1 -0
- package/connection/session.js +2 -0
- package/connection/session.js.map +1 -0
- package/connection/stats.d.ts +20 -11
- package/connection/stats.d.ts.map +1 -1
- package/connection/stats.js +64 -9
- package/connection/stats.js.map +1 -1
- package/connection/ticker.d.ts +4 -0
- package/connection/ticker.d.ts.map +1 -0
- package/connection/ticker.js +66 -0
- package/connection/ticker.js.map +1 -0
- package/connection/tokens.d.ts +2 -0
- package/connection/tokens.d.ts.map +1 -0
- package/connection/tokens.js +404 -0
- package/connection/tokens.js.map +1 -0
- package/connection/transport.d.ts.map +1 -1
- package/connection/transport.js +4 -5
- package/connection/transport.js.map +1 -1
- package/connection/withdrawal.d.ts +2 -0
- package/connection/withdrawal.d.ts.map +1 -0
- package/connection/withdrawal.js +23 -0
- package/connection/withdrawal.js.map +1 -0
- package/consume.js +213 -47
- package/consume.js.map +1 -1
- package/cover.d.ts +59 -0
- package/cover.d.ts.map +1 -0
- package/cover.js +375 -0
- package/cover.js.map +1 -0
- package/datagram.d.ts +70 -11
- package/datagram.d.ts.map +1 -1
- package/datagram.js +317 -2
- package/datagram.js.map +1 -1
- package/datagram_stream.d.ts +18 -0
- package/datagram_stream.d.ts.map +1 -0
- package/datagram_stream.js +67 -0
- package/datagram_stream.js.map +1 -0
- package/defined.test-util.d.ts +2 -0
- package/defined.test-util.d.ts.map +1 -0
- package/defined.test-util.js +7 -0
- package/defined.test-util.js.map +1 -0
- package/delivered.d.ts +75 -0
- package/delivered.d.ts.map +1 -0
- package/delivered.js +228 -0
- package/delivered.js.map +1 -0
- package/demand.d.ts +173 -0
- package/demand.d.ts.map +1 -0
- package/demand.js +582 -0
- package/demand.js.map +1 -0
- package/drops.d.ts +93 -0
- package/drops.d.ts.map +1 -0
- package/drops.js +283 -0
- package/drops.js.map +1 -0
- package/error.d.ts +120 -21
- package/error.d.ts.map +1 -1
- package/error.js +230 -38
- package/error.js.map +1 -1
- package/errors.d.ts +2 -2
- package/errors.d.ts.map +1 -1
- package/errors.js +2 -3
- package/errors.js.map +1 -1
- package/fill.d.ts +174 -0
- package/fill.d.ts.map +1 -0
- package/fill.js +760 -0
- package/fill.js.map +1 -0
- package/flate/decoder.d.ts +2 -0
- package/flate/decoder.d.ts.map +1 -0
- package/flate/decoder.js +63 -0
- package/flate/decoder.js.map +1 -0
- package/flate/encoder.d.ts +2 -0
- package/flate/encoder.d.ts.map +1 -0
- package/flate/encoder.js +64 -0
- package/flate/encoder.js.map +1 -0
- package/flate/group.d.ts +34 -0
- package/flate/group.d.ts.map +1 -0
- package/flate/group.js +140 -0
- package/flate/group.js.map +1 -0
- package/frame.d.ts +80 -0
- package/frame.d.ts.map +1 -0
- package/frame.js +296 -0
- package/frame.js.map +1 -0
- package/frame.test-util.d.ts +5 -0
- package/frame.test-util.d.ts.map +1 -0
- package/frame.test-util.js +9 -0
- package/frame.test-util.js.map +1 -0
- package/group.d.ts +108 -45
- package/group.d.ts.map +1 -1
- package/group.js +1616 -308
- package/group.js.map +1 -1
- package/group_api.d.ts +7 -0
- package/group_api.d.ts.map +1 -0
- package/group_api.js +7 -0
- package/group_api.js.map +1 -0
- package/hop.d.ts +62 -76
- package/hop.d.ts.map +1 -1
- package/hop.js +92 -65
- package/hop.js.map +1 -1
- package/identity.d.ts +39 -0
- package/identity.d.ts.map +1 -0
- package/identity.js +47 -0
- package/identity.js.map +1 -0
- package/ietf/active_count.d.ts +2 -0
- package/ietf/active_count.d.ts.map +1 -0
- package/ietf/active_count.js +30 -0
- package/ietf/active_count.js.map +1 -0
- package/ietf/aliases.js +69 -36
- package/ietf/aliases.js.map +1 -1
- package/ietf/cluster.d.ts +3 -3
- package/ietf/cluster.js +14 -55
- package/ietf/cluster.js.map +1 -1
- package/ietf/connection.d.ts +1 -31
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +305 -144
- package/ietf/connection.js.map +1 -1
- package/ietf/datagram.d.ts +60 -0
- package/ietf/datagram.d.ts.map +1 -0
- package/ietf/datagram.js +152 -0
- package/ietf/datagram.js.map +1 -0
- package/ietf/error.d.ts +3 -3
- package/ietf/error.js +82 -101
- package/ietf/error.js.map +1 -1
- package/ietf/fetch.d.ts +93 -37
- package/ietf/fetch.d.ts.map +1 -1
- package/ietf/fetch.js +172 -94
- package/ietf/fetch.js.map +1 -1
- package/ietf/filter.d.ts +21 -31
- package/ietf/filter.d.ts.map +1 -1
- package/ietf/filter.js +140 -172
- package/ietf/filter.js.map +1 -1
- package/ietf/goaway.d.ts +12 -10
- package/ietf/goaway.d.ts.map +1 -1
- package/ietf/goaway.js +22 -36
- package/ietf/goaway.js.map +1 -1
- package/ietf/hidden.js +1 -2
- package/ietf/hidden.js.map +1 -1
- package/ietf/index.d.ts +8 -20
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +4 -15
- package/ietf/index.js.map +1 -1
- package/ietf/join.d.ts +7 -0
- package/ietf/join.d.ts.map +1 -0
- package/ietf/join.js +234 -0
- package/ietf/join.js.map +1 -0
- package/ietf/message.d.ts +18 -2
- package/ietf/message.d.ts.map +1 -1
- package/ietf/message.js +60 -41
- package/ietf/message.js.map +1 -1
- package/ietf/message.test-util.d.ts +6 -0
- package/ietf/message.test-util.d.ts.map +1 -0
- package/ietf/message.test-util.js +13 -0
- package/ietf/message.test-util.js.map +1 -0
- package/ietf/namespace.d.ts +19 -5
- package/ietf/namespace.d.ts.map +1 -1
- package/ietf/namespace.js +78 -27
- package/ietf/namespace.js.map +1 -1
- package/ietf/object.d.ts +195 -33
- package/ietf/object.d.ts.map +1 -1
- package/ietf/object.js +405 -179
- package/ietf/object.js.map +1 -1
- package/ietf/parameters.d.ts +25 -45
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +260 -473
- package/ietf/parameters.js.map +1 -1
- package/ietf/priority.d.ts +17 -2
- package/ietf/priority.d.ts.map +1 -1
- package/ietf/priority.js +19 -5
- package/ietf/priority.js.map +1 -1
- package/ietf/properties.d.ts +6 -5
- package/ietf/properties.d.ts.map +1 -1
- package/ietf/properties.js +78 -49
- package/ietf/properties.js.map +1 -1
- package/ietf/publish.d.ts +25 -33
- package/ietf/publish.d.ts.map +1 -1
- package/ietf/publish.js +45 -140
- package/ietf/publish.js.map +1 -1
- package/ietf/publish_namespace.d.ts +49 -72
- package/ietf/publish_namespace.d.ts.map +1 -1
- package/ietf/publish_namespace.js +66 -185
- package/ietf/publish_namespace.js.map +1 -1
- package/ietf/publisher.js +1800 -601
- package/ietf/publisher.js.map +1 -1
- package/ietf/range.d.ts +2 -0
- package/ietf/range.d.ts.map +1 -0
- package/ietf/range.js +222 -0
- package/ietf/range.js.map +1 -0
- package/ietf/request.d.ts +6 -30
- package/ietf/request.d.ts.map +1 -1
- package/ietf/request.js +41 -79
- package/ietf/request.js.map +1 -1
- package/ietf/request_stream.d.ts +1 -6
- package/ietf/request_stream.d.ts.map +1 -1
- package/ietf/request_stream.js +306 -17
- package/ietf/request_stream.js.map +1 -1
- package/ietf/session.d.ts +41 -0
- package/ietf/session.d.ts.map +1 -0
- package/ietf/session.js +65 -0
- package/ietf/session.js.map +1 -0
- package/ietf/setup.d.ts +5 -30
- package/ietf/setup.d.ts.map +1 -1
- package/ietf/setup.js +6 -118
- package/ietf/setup.js.map +1 -1
- package/ietf/setup_options.d.ts +31 -0
- package/ietf/setup_options.d.ts.map +1 -0
- package/ietf/setup_options.js +138 -0
- package/ietf/setup_options.js.map +1 -0
- package/ietf/solicit.js +4 -15
- package/ietf/solicit.js.map +1 -1
- package/ietf/subscribe.d.ts +52 -45
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +118 -240
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscribe_namespace.d.ts +16 -79
- package/ietf/subscribe_namespace.d.ts.map +1 -1
- package/ietf/subscribe_namespace.js +30 -202
- package/ietf/subscribe_namespace.js.map +1 -1
- package/ietf/subscriber.js +1839 -537
- package/ietf/subscriber.js.map +1 -1
- package/ietf/token.js +105 -28
- package/ietf/token.js.map +1 -1
- package/ietf/track.d.ts +27 -24
- package/ietf/track.d.ts.map +1 -1
- package/ietf/track.js +48 -62
- package/ietf/track.js.map +1 -1
- package/ietf/version.d.ts +13 -42
- package/ietf/version.d.ts.map +1 -1
- package/ietf/version.js +22 -49
- package/ietf/version.js.map +1 -1
- package/implementation.d.ts +2 -0
- package/implementation.d.ts.map +1 -0
- package/implementation.js +5 -0
- package/implementation.js.map +1 -0
- package/index.d.ts +34 -19
- package/index.d.ts.map +1 -1
- package/index.js +19 -7
- package/index.js.map +1 -1
- package/internal.d.ts +1515 -67
- package/internal.d.ts.map +1 -1
- package/internal.js +557 -80
- package/internal.js.map +1 -1
- package/ledger.d.ts +23 -0
- package/ledger.d.ts.map +1 -0
- package/ledger.js +247 -0
- package/ledger.js.map +1 -0
- package/listing.d.ts +132 -0
- package/listing.d.ts.map +1 -0
- package/listing.js +486 -0
- package/listing.js.map +1 -0
- package/lite/announce.d.ts +127 -66
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +384 -159
- package/lite/announce.js.map +1 -1
- package/lite/announce_stream.d.ts +2 -0
- package/lite/announce_stream.d.ts.map +1 -0
- package/lite/announce_stream.js +92 -0
- package/lite/announce_stream.js.map +1 -0
- package/lite/answer.d.ts +22 -0
- package/lite/answer.d.ts.map +1 -0
- package/lite/answer.js +301 -0
- package/lite/answer.js.map +1 -0
- package/lite/auth.d.ts +45 -0
- package/lite/auth.d.ts.map +1 -0
- package/lite/auth.js +204 -0
- package/lite/auth.js.map +1 -0
- package/lite/compat.d.ts +31 -0
- package/lite/compat.d.ts.map +1 -0
- package/lite/compat.js +86 -0
- package/lite/compat.js.map +1 -0
- package/lite/connection.d.ts +1 -45
- package/lite/connection.d.ts.map +1 -1
- package/lite/connection.js +360 -78
- package/lite/connection.js.map +1 -1
- package/lite/datagram-end.d.ts +26 -0
- package/lite/datagram-end.d.ts.map +1 -0
- package/lite/datagram-end.js +30 -0
- package/lite/datagram-end.js.map +1 -0
- package/lite/datagram.d.ts +73 -8
- package/lite/datagram.d.ts.map +1 -1
- package/lite/datagram.js +144 -10
- package/lite/datagram.js.map +1 -1
- package/lite/duration.d.ts +6 -0
- package/lite/duration.d.ts.map +1 -0
- package/lite/duration.js +14 -0
- package/lite/duration.js.map +1 -0
- package/lite/error.d.ts +9 -0
- package/lite/error.d.ts.map +1 -0
- package/lite/error.js +24 -0
- package/lite/error.js.map +1 -0
- package/lite/fills.d.ts +162 -0
- package/lite/fills.d.ts.map +1 -0
- package/lite/fills.js +486 -0
- package/lite/fills.js.map +1 -0
- package/lite/fit.d.ts +49 -0
- package/lite/fit.d.ts.map +1 -0
- package/lite/fit.js +305 -0
- package/lite/fit.js.map +1 -0
- package/lite/goaway.d.ts +2 -2
- package/lite/goaway.d.ts.map +1 -1
- package/lite/goaway.js +5 -14
- package/lite/goaway.js.map +1 -1
- package/lite/group.d.ts +67 -16
- package/lite/group.d.ts.map +1 -1
- package/lite/group.js +108 -31
- package/lite/group.js.map +1 -1
- package/lite/identity.d.ts +25 -0
- package/lite/identity.d.ts.map +1 -0
- package/lite/identity.js +79 -0
- package/lite/identity.js.map +1 -0
- package/lite/index.d.ts +14 -13
- package/lite/index.d.ts.map +1 -1
- package/lite/index.js +2 -2
- package/lite/index.js.map +1 -1
- package/lite/message.d.ts +10 -2
- package/lite/message.d.ts.map +1 -1
- package/lite/message.js +28 -45
- package/lite/message.js.map +1 -1
- package/lite/priority.d.ts +9 -2
- package/lite/priority.d.ts.map +1 -1
- package/lite/priority.js +11 -106
- package/lite/priority.js.map +1 -1
- package/lite/probe.d.ts +2 -2
- package/lite/probe.d.ts.map +1 -1
- package/lite/probe.js +9 -1
- package/lite/probe.js.map +1 -1
- package/lite/publisher.d.ts +10 -1
- package/lite/publisher.d.ts.map +1 -1
- package/lite/publisher.js +2548 -438
- package/lite/publisher.js.map +1 -1
- package/lite/routed.d.ts +59 -0
- package/lite/routed.d.ts.map +1 -0
- package/lite/routed.js +564 -0
- package/lite/routed.js.map +1 -0
- package/lite/session.d.ts +2 -28
- package/lite/session.d.ts.map +1 -1
- package/lite/session.js +0 -100
- package/lite/session.js.map +1 -1
- package/lite/setup.d.ts +32 -5
- package/lite/setup.d.ts.map +1 -1
- package/lite/setup.js +95 -22
- package/lite/setup.js.map +1 -1
- package/lite/stream.d.ts +5 -11
- package/lite/stream.d.ts.map +1 -1
- package/lite/stream.js +5 -2
- package/lite/stream.js.map +1 -1
- package/lite/subscribe.d.ts +478 -78
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +1373 -143
- package/lite/subscribe.js.map +1 -1
- package/lite/subscriber.d.ts +7 -44
- package/lite/subscriber.d.ts.map +1 -1
- package/lite/subscriber.js +3290 -516
- package/lite/subscriber.js.map +1 -1
- package/lite/track.d.ts +27 -12
- package/lite/track.d.ts.map +1 -1
- package/lite/track.js +116 -38
- package/lite/track.js.map +1 -1
- package/lite/tracks.d.ts +55 -0
- package/lite/tracks.d.ts.map +1 -0
- package/lite/tracks.js +114 -0
- package/lite/tracks.js.map +1 -0
- package/lite/version.d.ts +132 -24
- package/lite/version.d.ts.map +1 -1
- package/lite/version.js +378 -34
- package/lite/version.js.map +1 -1
- package/meta.d.ts +77 -0
- package/meta.d.ts.map +1 -0
- package/meta.js +130 -0
- package/meta.js.map +1 -0
- package/meta_api.d.ts +7 -0
- package/meta_api.d.ts.map +1 -0
- package/meta_api.js +7 -0
- package/meta_api.js.map +1 -0
- package/mint.d.ts +28 -0
- package/mint.d.ts.map +1 -0
- package/mint.js +66 -0
- package/mint.js.map +1 -0
- package/open.d.ts +63 -0
- package/open.d.ts.map +1 -0
- package/open.js +250 -0
- package/open.js.map +1 -0
- package/origin.d.ts +394 -142
- package/origin.d.ts.map +1 -1
- package/origin.js +2533 -687
- package/origin.js.map +1 -1
- package/package.json +8 -13
- package/path.d.ts +51 -51
- package/path.d.ts.map +1 -1
- package/path.js +210 -58
- package/path.js.map +1 -1
- package/payload.d.ts +33 -0
- package/payload.d.ts.map +1 -0
- package/payload.js +65 -0
- package/payload.js.map +1 -0
- package/prefix.d.ts +152 -0
- package/prefix.d.ts.map +1 -0
- package/prefix.js +349 -0
- package/prefix.js.map +1 -0
- package/priority.d.ts +8 -0
- package/priority.d.ts.map +1 -0
- package/priority.js +185 -0
- package/priority.js.map +1 -0
- package/queue.d.ts +2 -0
- package/queue.d.ts.map +1 -0
- package/queue.js +46 -0
- package/queue.js.map +1 -0
- package/ranges.d.ts +36 -0
- package/ranges.d.ts.map +1 -0
- package/ranges.js +312 -0
- package/ranges.js.map +1 -0
- package/rescale.d.ts +24 -0
- package/rescale.d.ts.map +1 -0
- package/rescale.js +39 -0
- package/rescale.js.map +1 -0
- package/resume.d.ts +55 -0
- package/resume.d.ts.map +1 -0
- package/resume.js +4173 -0
- package/resume.js.map +1 -0
- package/resume.test-util.d.ts +2 -0
- package/resume.test-util.d.ts.map +1 -0
- package/resume.test-util.js +25 -0
- package/resume.test-util.js.map +1 -0
- package/skips.d.ts +48 -0
- package/skips.d.ts.map +1 -0
- package/skips.js +182 -0
- package/skips.js.map +1 -0
- package/stream.d.ts +78 -40
- package/stream.d.ts.map +1 -1
- package/stream.js +236 -93
- package/stream.js.map +1 -1
- package/subscription.test-util.d.ts +2 -0
- package/subscription.test-util.d.ts.map +1 -0
- package/subscription.test-util.js +49 -0
- package/subscription.test-util.js.map +1 -0
- package/tail.d.ts +23 -14
- package/tail.d.ts.map +1 -1
- package/tail.js +224 -98
- package/tail.js.map +1 -1
- package/time.d.ts +41 -102
- package/time.d.ts.map +1 -1
- package/time.js +129 -92
- package/time.js.map +1 -1
- package/timed.d.ts +21 -0
- package/timed.d.ts.map +1 -0
- package/timed.js +2 -0
- package/timed.js.map +1 -0
- package/track.d.ts +578 -246
- package/track.d.ts.map +1 -1
- package/track.js +7306 -772
- package/track.js.map +1 -1
- package/track_api.d.ts +7 -0
- package/track_api.d.ts.map +1 -0
- package/track_api.js +7 -0
- package/track_api.js.map +1 -0
- package/util/abort.d.ts +1 -0
- package/util/abort.d.ts.map +1 -1
- package/util/abort.js +23 -2
- package/util/abort.js.map +1 -1
- package/util/announce.d.ts +4 -0
- package/util/announce.d.ts.map +1 -0
- package/util/announce.js +11 -0
- package/util/announce.js.map +1 -0
- package/util/bigint.d.ts +3 -0
- package/util/bigint.d.ts.map +1 -0
- package/util/bigint.js +8 -0
- package/util/bigint.js.map +1 -0
- package/util/change.d.ts +12 -0
- package/util/change.d.ts.map +1 -0
- package/util/change.js +18 -0
- package/util/change.js.map +1 -0
- package/util/deadline.d.ts +2 -0
- package/util/deadline.d.ts.map +1 -0
- package/util/deadline.js +108 -0
- package/util/deadline.js.map +1 -0
- package/util/decode_error.d.ts +3 -0
- package/util/decode_error.d.ts.map +1 -0
- package/util/decode_error.js +11 -0
- package/util/decode_error.js.map +1 -0
- package/util/demand.d.ts +8 -0
- package/util/demand.d.ts.map +1 -0
- package/util/demand.js +24 -0
- package/util/demand.js.map +1 -0
- package/util/given_up.d.ts +2 -0
- package/util/given_up.d.ts.map +1 -0
- package/util/given_up.js +101 -0
- package/util/given_up.js.map +1 -0
- package/util/hex.d.ts +6 -0
- package/util/hex.d.ts.map +1 -1
- package/util/hex.js +19 -5
- package/util/hex.js.map +1 -1
- package/util/key.d.ts +15 -0
- package/util/key.d.ts.map +1 -0
- package/util/key.js +38 -0
- package/util/key.js.map +1 -0
- package/util/limits.d.ts +2 -0
- package/util/limits.d.ts.map +1 -0
- package/util/limits.js +76 -0
- package/util/limits.js.map +1 -0
- package/util/observed.d.ts +23 -0
- package/util/observed.d.ts.map +1 -0
- package/util/observed.js +122 -0
- package/util/observed.js.map +1 -0
- package/util/sorted.d.ts +2 -0
- package/util/sorted.d.ts.map +1 -0
- package/util/sorted.js +149 -0
- package/util/sorted.js.map +1 -0
- package/util/timeout.d.ts +2 -1
- package/util/timeout.d.ts.map +1 -1
- package/util/timeout.js +13 -10
- package/util/timeout.js.map +1 -1
- package/util/timer.d.ts +2 -0
- package/util/timer.d.ts.map +1 -0
- package/util/timer.js +19 -0
- package/util/timer.js.map +1 -0
- package/util/u64.js +0 -1
- package/util/utf8.d.ts +2 -0
- package/util/utf8.d.ts.map +1 -1
- package/util/utf8.js +7 -2
- package/util/utf8.js.map +1 -1
- package/util/varint.d.ts.map +1 -1
- package/util/varint.js +8 -2
- package/util/varint.js.map +1 -1
- package/util/watch.d.ts +8 -0
- package/util/watch.d.ts.map +1 -0
- package/util/watch.js +38 -0
- package/util/watch.js.map +1 -0
- package/util/yield.d.ts +2 -0
- package/util/yield.d.ts.map +1 -0
- package/util/yield.js +31 -0
- package/util/yield.js.map +1 -0
- package/varint.d.ts +0 -29
- package/varint.d.ts.map +1 -1
- package/varint.js +7 -29
- package/varint.js.map +1 -1
- package/varint_api.d.ts +7 -0
- package/varint_api.d.ts.map +1 -0
- package/varint_api.js +7 -0
- package/varint_api.js.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +4 -0
- package/version.js.map +1 -0
- package/window.d.ts +570 -0
- package/window.d.ts.map +1 -0
- package/window.js +1677 -0
- package/window.js.map +1 -0
- package/wire.d.ts +150 -35
- package/wire.d.ts.map +1 -1
- package/wire.js +27 -1
- package/wire.js.map +1 -1
- package/connection/established.d.ts +0 -53
- package/connection/established.d.ts.map +0 -1
- package/connection/established.js +0 -3
- package/connection/established.js.map +0 -1
- package/ietf/adapter.d.ts +0 -75
- package/ietf/adapter.d.ts.map +0 -1
- package/ietf/adapter.js +0 -700
- package/ietf/adapter.js.map +0 -1
- package/lite/datagram_stream.d.ts +0 -8
- package/lite/datagram_stream.d.ts.map +0 -1
- package/lite/datagram_stream.js +0 -44
- package/lite/datagram_stream.js.map +0 -1
- package/lite/fetch.d.ts +0 -28
- package/lite/fetch.d.ts.map +0 -1
- package/lite/fetch.js +0 -79
- package/lite/fetch.js.map +0 -1
- package/util/log.d.ts +0 -5
- package/util/log.d.ts.map +0 -1
- package/util/log.js +0 -17
- package/util/log.js.map +0 -1
- package/zod.d.ts +0 -13
- package/zod.d.ts.map +0 -1
- package/zod.js +0 -19
- package/zod.js.map +0 -1
package/track.d.ts
CHANGED
|
@@ -1,109 +1,304 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Track role handles: a live stream of groups
|
|
2
|
+
* Track role handles: a live stream of groups within a broadcast.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
import { Duration, Instant } from "@moq/clock";
|
|
6
7
|
import { type GetPromise, type Getter } from "@moq/signals";
|
|
7
|
-
import type
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
export
|
|
8
|
+
import { type Requests } from "./fill.ts";
|
|
9
|
+
import type { Info as FrameInfo, Producer as FrameProducer } from "./frame.ts";
|
|
10
|
+
import { type Frame, type Consumer as GroupConsumer, Producer as GroupProducer } from "./group.ts";
|
|
11
|
+
import { Timescale } from "./time.ts";
|
|
12
|
+
export { FillGroups, Requests } from "./fill.ts";
|
|
13
|
+
export { rescale, rescaleIn } from "./rescale.ts";
|
|
14
|
+
/** What {@link Ordered.nextItem} returns next. Mirrors the Rust `track::Item`. */
|
|
15
|
+
export type Item =
|
|
16
|
+
/** A group, with a higher key than any group or gap returned before. */
|
|
17
|
+
{
|
|
18
|
+
kind: "group";
|
|
19
|
+
group: GroupConsumer;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Groups `[start, end)` this reader gave up on, which it will not return, with what a read of
|
|
23
|
+
* them would have ended with. `group` is absent, so `item?.group` reads a group or nothing.
|
|
24
|
+
* `landed` is when the latest of those groups landed here, undefined when none did or the cache
|
|
25
|
+
* has since evicted it: a reader timing arrivals learns when what it never read came in, such
|
|
26
|
+
* as a join's backlog skipped as stale.
|
|
27
|
+
*/
|
|
28
|
+
| {
|
|
29
|
+
kind: "gap";
|
|
30
|
+
start: bigint;
|
|
31
|
+
end: bigint;
|
|
32
|
+
error: Error;
|
|
33
|
+
landed?: Instant;
|
|
34
|
+
group?: never;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A position within a track: a group's key and a frame's index inside it.
|
|
38
|
+
*
|
|
39
|
+
* As a track's end it is exclusive: `{ group: 90, frame: 0 }` ends before group 90, and
|
|
40
|
+
* `{ group: 89, frame: 5 }` ends group 89 after its frames 0 to 4. Mirrors the Rust
|
|
41
|
+
* `track::Position`.
|
|
42
|
+
*/
|
|
43
|
+
export interface Position {
|
|
15
44
|
/** The group's sequence number within the track. */
|
|
16
|
-
group:
|
|
45
|
+
group: bigint;
|
|
17
46
|
/** The frame's index within that group. */
|
|
18
47
|
frame: number;
|
|
19
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* How a track's frames are compressed, mirroring the Rust `track::Compression`: `"deflate"` makes
|
|
51
|
+
* each group one DEFLATE stream (draft-lcurley-moq-flate), which suits small, repetitive frames
|
|
52
|
+
* like JSON.
|
|
53
|
+
*/
|
|
54
|
+
export type Compression = "none" | "deflate";
|
|
20
55
|
/**
|
|
21
56
|
* A track's immutable publisher properties, fixed for the lifetime of the track.
|
|
22
57
|
*
|
|
23
|
-
* A producer declares these once
|
|
24
|
-
*
|
|
58
|
+
* A producer declares these once from an {@link InfoInit} (when created);
|
|
59
|
+
* a consumer awaits them via {@link Subscriber.info}
|
|
25
60
|
* (resolved from the wire TRACK_INFO on lite-05+). They map 1:1 onto TRACK_INFO.
|
|
26
61
|
*/
|
|
27
62
|
export interface Info {
|
|
63
|
+
/** How frame payloads are compressed per group on lite-07; other sessions receive plain frames. */
|
|
64
|
+
compression: Compression;
|
|
28
65
|
/**
|
|
29
|
-
* Units per second for this track's frame timestamps
|
|
30
|
-
*
|
|
31
|
-
*
|
|
66
|
+
* Units per second for this track's frame timestamps, or `null` for a scale-less (untimed)
|
|
67
|
+
* track, whose frames carry no time: each one's timestamp is {@link Timestamp.unscaled} at
|
|
68
|
+
* its group's key.
|
|
69
|
+
*
|
|
70
|
+
* A timed track declares its scale, such as {@link Timescale | Timescale.MILLI}, or
|
|
71
|
+
* {@link Timescale | Timescale.MICRO} for media that needs sub-millisecond timing. Reported in
|
|
72
|
+
* TRACK_INFO on Lite05+ and as the ID_TIMESCALE (0x40B70) property on moq-transport. A track
|
|
73
|
+
* received without one (moq-lite before Lite05, or moq-transport without ID_TIMESCALE) is untimed,
|
|
74
|
+
* and stays untimed when served onward.
|
|
32
75
|
*/
|
|
33
|
-
timescale: Timescale;
|
|
76
|
+
timescale: Timescale | null;
|
|
34
77
|
/**
|
|
35
|
-
* Publisher Max Age:
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
78
|
+
* Publisher Max Age: how long, in milliseconds, a superseded group stays fresh, or `null` for
|
|
79
|
+
* no publisher limit. It is stale once either clock reaches the budget: the wall-clock time
|
|
80
|
+
* since its successor arrived at this hop, or how far its successor's first timestamp trails
|
|
81
|
+
* the live edge. The newest group is never stale, and an untimed track is judged by the wall
|
|
82
|
+
* clock alone. Reported in TRACK_INFO (Lite05+) so relays re-serve with the same bound. A
|
|
83
|
+
* track received without one has no limit; zero serves only the live edge.
|
|
84
|
+
* This clamps each subscriber budget. A freshness bound, not retention: a hop's cache bounds
|
|
85
|
+
* the bytes it keeps with its own window.
|
|
40
86
|
*/
|
|
41
|
-
maxAge:
|
|
42
|
-
/** Tie-break priority between subscriptions of equal subscriber priority (
|
|
87
|
+
maxAge: Duration | null;
|
|
88
|
+
/** Tie-break priority between subscriptions of equal subscriber priority (`-128..=127`, higher first). */
|
|
43
89
|
priority: number;
|
|
90
|
+
/** When a reader asks for a new group: on a live join, on a {@link Subscriber.refresh}, or both. See {@link Refresh}. */
|
|
91
|
+
refresh: Refresh;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* When a reader of a track asks its publisher for a new group, which TRACK_INFO carries on
|
|
95
|
+
* lite-07. Mirrors the Rust `track::Refresh`.
|
|
96
|
+
*
|
|
97
|
+
* A track opting in starts each group with an independent frame (a snapshot or a keyframe)
|
|
98
|
+
* that the frames after it build on, so a new group is something the publisher can make on
|
|
99
|
+
* request. A request asks for a group starting past the newest one; every hop judges it
|
|
100
|
+
* against its own cache, which holds the same group, and requests made while one is pending
|
|
101
|
+
* coalesce into it. The reader still receives the cached group while the new one is pending.
|
|
102
|
+
*
|
|
103
|
+
* A live join asks when the newest group outweighs {@link Refresh.ratio} (any join without one).
|
|
104
|
+
* {@link Subscriber.refresh} asks regardless of the ratio on a track with an {@link Refresh.interval},
|
|
105
|
+
* and like a join otherwise. Either request waits out the interval: it takes effect only once
|
|
106
|
+
* the newest group arrived at least that long ago, so the interval caps how often the
|
|
107
|
+
* publisher makes groups however many readers ask. A track with no group asks for its first at
|
|
108
|
+
* once. Both `null` (the default) asks for nothing.
|
|
109
|
+
*/
|
|
110
|
+
export interface Refresh {
|
|
111
|
+
/**
|
|
112
|
+
* How many times its first frame a group's later bytes may grow before a live join asks for
|
|
113
|
+
* a new group, or `null` to judge no ratio: then any join asks, if the track sets an interval.
|
|
114
|
+
* `0` asks on any join once a delta follows the first frame. An integer in `0..2^32`.
|
|
115
|
+
*/
|
|
116
|
+
ratio: number | null;
|
|
117
|
+
/**
|
|
118
|
+
* How long after the newest group arrived a request may ask for another, or `null` for at
|
|
119
|
+
* once. Measured on each hop's own clock from when the group reached it (or, at the
|
|
120
|
+
* publisher, was created), as {@link Info.maxAge} expiry measures it. A request made sooner
|
|
121
|
+
* waits until then. Carried as milliseconds like {@link Info.maxAge}.
|
|
122
|
+
*/
|
|
123
|
+
interval: Duration | null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* What an author supplies to create a track: any {@link Info} field. `compression` defaults to
|
|
127
|
+
* `"none"`, `timescale` to `null`, `refresh` to never, `priority` to `0`, and `maxAge` to
|
|
128
|
+
* zero. A received {@link Info} serves onward unchanged.
|
|
129
|
+
*/
|
|
130
|
+
export interface InfoInit extends Partial<Omit<Info, "refresh">> {
|
|
131
|
+
/**
|
|
132
|
+
* When a reader asks for a new group; see {@link Info.refresh}. An omitted field is `null`.
|
|
133
|
+
* The interval is rounded up to a whole millisecond like {@link maxAge}.
|
|
134
|
+
*/
|
|
135
|
+
refresh?: Partial<Refresh>;
|
|
136
|
+
/**
|
|
137
|
+
* The publisher max age; see {@link Info.maxAge}. Omitted is zero, so readers get only the
|
|
138
|
+
* live edge; `null` sets no publisher limit (the wire omits it). A track whose readers reach
|
|
139
|
+
* back for superseded groups sets it explicitly. Rounded up to a whole millisecond; a
|
|
140
|
+
* negative or non-finite value, or one past `Number.MAX_SAFE_INTEGER`, is refused.
|
|
141
|
+
*/
|
|
142
|
+
maxAge?: Duration | null;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* A span of a track to deliver: from where {@link Range.start} places it through the group
|
|
146
|
+
* containing `end`, a time in the track's timescale (a bare group start on a track without one).
|
|
147
|
+
* Mirrors the Rust `Range`.
|
|
148
|
+
*
|
|
149
|
+
* Every range names whole groups: a subscription always starts at a group's first frame, since a
|
|
150
|
+
* group is the unit of decodability, and an end includes its group. `{ start: 2n, end: 6n }`
|
|
151
|
+
* delivers every group from the one containing time 2 through the one containing time 6. An end
|
|
152
|
+
* before a time start is empty. Each end resolves at the hop that serves it, once, when the range
|
|
153
|
+
* is placed.
|
|
154
|
+
*
|
|
155
|
+
* Each range carries its own priority and group order, so one subscription can ask for the live
|
|
156
|
+
* edge urgently and backfill history in the background. Changing only those on a range already
|
|
157
|
+
* live keeps where it started, both here and upstream.
|
|
158
|
+
*/
|
|
159
|
+
export interface Range {
|
|
160
|
+
/** Where delivery starts; see {@link Start}. Omitted for the oldest group. */
|
|
161
|
+
start?: Start;
|
|
162
|
+
/** Where delivery stops, as a time including its group, or onward when omitted. */
|
|
163
|
+
end?: bigint;
|
|
164
|
+
/**
|
|
165
|
+
* Delivery priority relative to this session's other ranges (`-128..=127`, higher first).
|
|
166
|
+
* Defaults to `0`.
|
|
167
|
+
*
|
|
168
|
+
* A group several ranges ask for goes out at the highest of their priorities. moq-lite before
|
|
169
|
+
* 07 and moq-transport carry one priority per subscription: the highest among its ranges.
|
|
170
|
+
*/
|
|
171
|
+
priority?: number;
|
|
172
|
+
/**
|
|
173
|
+
* Which of this range's groups comes first, as the publisher sends them. Defaults to
|
|
174
|
+
* `"descending"`. {@link Subscriber.recvGroup} returns the groups it holds in the order of its
|
|
175
|
+
* most urgent ranges: newest first if any range at the highest priority asks for it.
|
|
176
|
+
*
|
|
177
|
+
* Carried by moq-lite 07 and moq-transport (fixed at subscribe time there, which takes the order
|
|
178
|
+
* of the most urgent ranges); older moq-lite versions are served newest first whatever this
|
|
179
|
+
* says. A relay serving ranges of both orders at one priority from one upstream subscription asks
|
|
180
|
+
* newest first, keeping its live subscribers fresh, and still serves each subscriber in its own
|
|
181
|
+
* order.
|
|
182
|
+
*/
|
|
183
|
+
order?: Order;
|
|
44
184
|
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Where a {@link Range} starts, the `Start` Anchor on the moq-lite wire. Mirrors the Rust `Start`:
|
|
187
|
+
*
|
|
188
|
+
* - omitted, the oldest group the publisher still holds: a floor for history, whose groups are
|
|
189
|
+
* delivered in full, bounded only by how long the publisher keeps them ({@link Info.maxAge}).
|
|
190
|
+
* - a time, the group containing it: the newest one starting at or before it, unless that group
|
|
191
|
+
* ended whole at or before the time ({@link GroupProducer.finishAt}): a time past a whole group's
|
|
192
|
+
* span lies in a pause no group contains, so the range starts at the next group. A floor for
|
|
193
|
+
* history, like an omitted start: its groups never go stale. A time resolves at the hop that
|
|
194
|
+
* serves it, from the starts of the groups it holds. When none does, a hop whose fill handler
|
|
195
|
+
* serves its history asks it for the group containing the time (see {@link FillGroups.floor}),
|
|
196
|
+
* reading nothing until it answers; otherwise, or when the handler can't tell, it reaches back to
|
|
197
|
+
* the oldest group. While no group is held at all it waits for one, reading only the groups from
|
|
198
|
+
* its time meanwhile. A relay copy that can't tell which group contains a time asks its upstream
|
|
199
|
+
* and waits for the answer.
|
|
200
|
+
* - `{ live }`, a live join `min` behind the live edge, whose groups go stale `max` behind it; see
|
|
201
|
+
* {@link Live}.
|
|
202
|
+
*/
|
|
203
|
+
export type Start = bigint | {
|
|
204
|
+
live: Live;
|
|
54
205
|
};
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
206
|
+
/**
|
|
207
|
+
* A live join: where it starts behind the live edge, and how long its groups stay worth
|
|
208
|
+
* delivering. Mirrors the fields of the Rust `Start::Live`. Each is rounded up to a whole
|
|
209
|
+
* millisecond, as the wire carries it; a negative or non-finite one, or one past
|
|
210
|
+
* `Number.MAX_SAFE_INTEGER` milliseconds after rounding, is refused. moq-lite before 07 and
|
|
211
|
+
* moq-transport cannot carry a live join, so it goes out as an omitted start there, under the one
|
|
212
|
+
* subscription-wide max age those wires carry instead.
|
|
213
|
+
*
|
|
214
|
+
* Only a group reached through a live join alone can go stale. A group several ranges cover takes
|
|
215
|
+
* the largest `max` among them, and never goes stale while any history range covers it.
|
|
216
|
+
*/
|
|
217
|
+
export interface Live {
|
|
218
|
+
/**
|
|
219
|
+
* How far behind the live edge to join: the group containing the live edge minus this lag, so a
|
|
220
|
+
* player's buffer arrives full instead of filling in real time, and zero starts at the latest
|
|
221
|
+
* group; `null` sets no lag limit, so the join reaches back past every group and takes each one
|
|
222
|
+
* `max` still allows. The hop serving it measures the live edge in media time, from the newest frame it holds,
|
|
223
|
+
* rounded up to whole ticks, and on a scale-less track by arrival on its own clock. It resolves
|
|
224
|
+
* that time as a time start would, so a publisher looks it up in its history; `max` does not
|
|
225
|
+
* move it. A relay copy forwards each join to its upstream as its own range and starts it where
|
|
226
|
+
* that range's answer does. A range resolves once, so a live edge that moves later moves nothing
|
|
227
|
+
* already started.
|
|
228
|
+
*/
|
|
229
|
+
min: Duration | null;
|
|
230
|
+
/**
|
|
231
|
+
* How long a superseded group stays worth delivering, measured from the live edge by the same
|
|
232
|
+
* two clocks as {@link Info.maxAge}: it is skipped once its successor arrived this long ago or
|
|
233
|
+
* starts this far behind the live edge, and never past the publisher's {@link Info.maxAge}.
|
|
234
|
+
* Omitted means `0`, skipping a superseded group at once, timed or not; `null` sets no
|
|
235
|
+
* subscriber limit, so the publisher's {@link Info.maxAge} alone bounds it. A larger budget
|
|
236
|
+
* tolerates that much reordering before giving up, and never adds delay. Read in order, see
|
|
237
|
+
* {@link Ordered} for where a long one can block. A `max` below `min` skips the join's own
|
|
238
|
+
* oldest groups.
|
|
239
|
+
*
|
|
240
|
+
* Changing only `max` on a range already live, with {@link Subscriber.update}, keeps where it
|
|
241
|
+
* joined, both here and upstream. Enforced at both ends: the publisher skips what the most
|
|
242
|
+
* tolerant subscriber's budget convicts, and each subscriber applies its own again as it reads.
|
|
243
|
+
*/
|
|
244
|
+
max?: Duration | null;
|
|
61
245
|
}
|
|
62
246
|
/**
|
|
63
247
|
* Per-subscription options, requested when a subscription opens and adjustable later via
|
|
64
248
|
* {@link Subscriber.update}. Mirrors the Rust `Subscription`.
|
|
249
|
+
* The obsolete `delay`, `maxAge`, and `maxDelay` fields are refused at runtime: a live range's
|
|
250
|
+
* {@link Live.max} replaces them.
|
|
65
251
|
*/
|
|
66
252
|
export interface Subscription {
|
|
67
|
-
/** Delivery priority relative to this session's other subscriptions (`0..=255`). Defaults to `0`. */
|
|
68
|
-
priority?: number;
|
|
69
|
-
/**
|
|
70
|
-
* Maximum age (milliseconds) of a non-latest group before it is skipped. Defaults to `0`.
|
|
71
|
-
* Rounded up to a whole millisecond, so a value derived from a measurement is never
|
|
72
|
-
* shortened. A negative or non-finite value, or one past `Number.MAX_SAFE_INTEGER`
|
|
73
|
-
* after rounding, is refused.
|
|
74
|
-
*/
|
|
75
|
-
maxAge?: Milli;
|
|
76
253
|
/**
|
|
77
|
-
* The
|
|
254
|
+
* The spans of the track to deliver; see {@link Range}.
|
|
255
|
+
*
|
|
256
|
+
* Defaults to one range from `{ live: { min: Duration.ZERO } }`: the latest group, skipping each
|
|
257
|
+
* the moment a newer one arrives. An empty list asks for nothing. A range whose start is a time
|
|
258
|
+
* or omitted is history, delivered in full; a live join's {@link Live.max} skips what inside it
|
|
259
|
+
* has gone stale. A read whose ranges all end finishes once nothing in them is left to deliver,
|
|
260
|
+
* as in Rust, while one left open follows the live edge.
|
|
78
261
|
*
|
|
79
|
-
* A
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* off).
|
|
262
|
+
* A request to the publisher, aggregated across every live subscriber as the union of their
|
|
263
|
+
* ranges, and this subscriber's read filter: it reads only the groups its own ranges cover,
|
|
264
|
+
* whatever another subscriber widens the union to.
|
|
83
265
|
*/
|
|
84
|
-
|
|
266
|
+
ranges?: Range[];
|
|
85
267
|
}
|
|
86
268
|
/**
|
|
87
|
-
*
|
|
269
|
+
* Which of a subscription's groups comes first, as the publisher sends its pending groups and
|
|
270
|
+
* {@link Subscriber.recvGroup} hands out the groups it holds: `"descending"` (newest first, so
|
|
271
|
+
* congestion sheds the backlog rather than the live edge) or `"ascending"` (oldest first, draining
|
|
272
|
+
* a backlog in sequence order).
|
|
88
273
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
274
|
+
* An order only: it never decides whether a group is delivered. A history range
|
|
275
|
+
* delivers every group it covers, and a live join skips what its {@link Live.max} judges stale, so
|
|
276
|
+
* an ascending subscriber that wants a backlog drains it from a history range or a `max` that
|
|
277
|
+
* covers it.
|
|
93
278
|
*/
|
|
94
|
-
export
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
279
|
+
export type Order = "ascending" | "descending";
|
|
280
|
+
/** Constructors for {@link Subscription}. */
|
|
281
|
+
export declare const Subscription: {
|
|
282
|
+
/**
|
|
283
|
+
* The default subscription, used when none is passed: one range joining at the latest group at
|
|
284
|
+
* priority `0`, newest first, which skips a superseded group at once. Mirrors the Rust
|
|
285
|
+
* `Subscription::default()`.
|
|
286
|
+
*/
|
|
287
|
+
default(): Subscription;
|
|
288
|
+
};
|
|
289
|
+
/** Options for {@link Consumer.info}. */
|
|
290
|
+
export interface InfoOptions {
|
|
291
|
+
/** Abandons the lookup, rejecting with the signal's reason; aborting after it resolves has no effect. */
|
|
292
|
+
signal?: AbortSignal;
|
|
293
|
+
}
|
|
294
|
+
/** Options for {@link Subscriber.refresh}. */
|
|
295
|
+
export interface RefreshOptions {
|
|
296
|
+
/**
|
|
297
|
+
* Withdraws this caller's request if it is not sent yet, rejecting with the signal's reason.
|
|
298
|
+
* An already-aborted signal rejects before anything is asked, and aborting after it resolves
|
|
299
|
+
* has no effect.
|
|
300
|
+
*/
|
|
301
|
+
signal?: AbortSignal;
|
|
107
302
|
}
|
|
108
303
|
/** Options for {@link Consumer.fetchGroup}. */
|
|
109
304
|
export interface FetchGroupOptions {
|
|
@@ -130,16 +325,53 @@ export declare class Consumer {
|
|
|
130
325
|
/**
|
|
131
326
|
* Open a live subscription to the track.
|
|
132
327
|
*
|
|
133
|
-
*
|
|
134
|
-
* {@link
|
|
135
|
-
*
|
|
136
|
-
* latest group
|
|
328
|
+
* It reads only the groups its {@link Subscription.ranges} cover. A live range's
|
|
329
|
+
* {@link Live.max} is what asks for data: delivery skips every group it reached that the max
|
|
330
|
+
* convicts. Without options this is {@link Subscription.default}, one live range whose max of
|
|
331
|
+
* zero delivers only the latest group; a larger max reaches back over what it can still use,
|
|
332
|
+
* and a history range (a key start) delivers every group the publisher's {@link Info.maxAge}
|
|
333
|
+
* still considers fresh.
|
|
137
334
|
*/
|
|
138
335
|
subscribe(options?: Subscription): Subscriber;
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
336
|
+
/**
|
|
337
|
+
* Fetch the track's immutable publisher properties without subscribing. It waits for as long
|
|
338
|
+
* as the publisher takes to answer: abort `options.signal` to give up.
|
|
339
|
+
*/
|
|
340
|
+
info(options?: InfoOptions): Promise<Info>;
|
|
341
|
+
/** Fetch a single group by key without holding a live subscription. */
|
|
342
|
+
fetchGroup(key: bigint, options?: FetchGroupOptions): Promise<GroupConsumer>;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* A watch-only view of a track's subscriber demand, from {@link Producer.demand}. Mirrors the
|
|
346
|
+
* Rust `Demand`.
|
|
347
|
+
*
|
|
348
|
+
* Lets a publisher gate work (on-demand capture or encoding) on whether anyone is subscribed,
|
|
349
|
+
* and open a group when a reader asks for one, without the ability to write groups or close the
|
|
350
|
+
* track. The consumer wire watches it to tear an idle upstream subscription down instead of
|
|
351
|
+
* downloading to nobody.
|
|
352
|
+
*/
|
|
353
|
+
export declare class Demand {
|
|
354
|
+
#private;
|
|
355
|
+
/** The track name. */
|
|
356
|
+
readonly name: string;
|
|
357
|
+
private constructor();
|
|
358
|
+
/**
|
|
359
|
+
* Whether anyone subscribes to the open track, or holds an info lookup on it, such as a relay
|
|
360
|
+
* answering a downstream TRACK. Watch it (`effect.get` / `.peek()`) to follow demand.
|
|
361
|
+
*/
|
|
362
|
+
get wanted(): Getter<boolean>;
|
|
363
|
+
/**
|
|
364
|
+
* Whether a subscriber asks for a new group: the first group of a track with none written, or
|
|
365
|
+
* a live join or {@link Subscriber.refresh} judged by {@link Info.refresh}, once its interval
|
|
366
|
+
* has passed. The next group appended clears it, so a publisher waits for it to turn true,
|
|
367
|
+
* opens a group (a keyframe or a snapshot), and waits again.
|
|
368
|
+
*/
|
|
369
|
+
get refresh(): Getter<boolean>;
|
|
370
|
+
/**
|
|
371
|
+
* Settles once the track's outcome is final: `null` once its declared end is reached and
|
|
372
|
+
* settled, or on a clean release, else the abort {@link Error}. Never because readers left.
|
|
373
|
+
*/
|
|
374
|
+
get closed(): GetPromise<Error | null>;
|
|
143
375
|
}
|
|
144
376
|
/**
|
|
145
377
|
* The write side of a track, mirroring the Rust `Producer`.
|
|
@@ -148,121 +380,180 @@ export declare class Consumer {
|
|
|
148
380
|
* subscription the publisher serves from it) gets an independent
|
|
149
381
|
* {@link Subscriber} that receives a full copy of the groups, each with its own
|
|
150
382
|
* read cursor. Groups are mirrored into every live subscriber and retained for the
|
|
151
|
-
*
|
|
383
|
+
* idle cache window so a late subscriber can replay groups within its media budget.
|
|
152
384
|
*
|
|
153
|
-
* Obtained from
|
|
154
|
-
*
|
|
385
|
+
* Obtained from `Broadcast.Producer.createTrack`, or constructed directly for an in-process
|
|
386
|
+
* track.
|
|
155
387
|
*/
|
|
156
388
|
export declare class Producer {
|
|
157
389
|
#private;
|
|
158
390
|
/** The track name. */
|
|
159
391
|
readonly name: string;
|
|
160
|
-
|
|
392
|
+
/**
|
|
393
|
+
* An in-process track named `name`, committing its immutable {@link Info} from `info`; an
|
|
394
|
+
* omitted `maxAge` is zero, the live edge only (see {@link InfoInit.maxAge}), so `{}` takes
|
|
395
|
+
* every default.
|
|
396
|
+
*/
|
|
397
|
+
constructor(name: string, info: InfoInit);
|
|
161
398
|
/**
|
|
162
399
|
* Resolve this track's immutable publisher properties, committed at accept time.
|
|
163
400
|
* Rejects if the track is closed before the properties are known.
|
|
164
401
|
*/
|
|
165
402
|
info(): Promise<Info>;
|
|
166
403
|
/**
|
|
167
|
-
* Publisher priority from the committed {@link Info}, or the default
|
|
404
|
+
* Publisher priority from the committed {@link Info}, or the default while its info is pending.
|
|
168
405
|
*
|
|
169
406
|
* Higher is served first. Hang publishers set this from `Catalog.PRIORITY` so
|
|
170
407
|
* audio outranks video on the wire and in the bandwidth allocator.
|
|
171
408
|
*/
|
|
172
409
|
get priority(): number;
|
|
410
|
+
/** The timescale from the committed {@link Info}: `null` when scale-less, undefined while its info is pending. */
|
|
411
|
+
get timescale(): Timescale | null | undefined;
|
|
173
412
|
/**
|
|
174
|
-
* Settles once the track
|
|
413
|
+
* Settles once the track's outcome is final: `null` once its declared end is reached and
|
|
414
|
+
* settled (every group below it finished) or on a clean
|
|
415
|
+
* release, else the abort {@link Error}. The producer stays open after a settled end, serving its cache.
|
|
175
416
|
* Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
|
|
176
417
|
*/
|
|
177
418
|
get closed(): GetPromise<Error | null>;
|
|
178
|
-
/**
|
|
179
|
-
* The aggregate subscription across live subscribers, or `undefined` when there are none.
|
|
180
|
-
* The wire layer watches this to emit SUBSCRIBE_UPDATE.
|
|
181
|
-
*/
|
|
419
|
+
/** The aggregate subscription across live subscribers, or `undefined` when there are none. */
|
|
182
420
|
get subscription(): Getter<Subscription | undefined>;
|
|
183
|
-
/** Commit the immutable publisher properties, resolving {@link info}. Returns `this`. */
|
|
184
|
-
accept(info?: Partial<Info>): this;
|
|
185
421
|
/**
|
|
186
422
|
* An independent {@link Subscriber} reading this track's groups.
|
|
187
423
|
*
|
|
188
|
-
*
|
|
189
|
-
* {@link
|
|
190
|
-
*
|
|
191
|
-
* latest group
|
|
424
|
+
* It reads only the groups its {@link Subscription.ranges} cover. A live range's
|
|
425
|
+
* {@link Live.max} is what asks for data: delivery skips every group it reached that the max
|
|
426
|
+
* convicts. Without options this is {@link Subscription.default}, one live range whose max of
|
|
427
|
+
* zero delivers only the latest group; a larger max reaches back over what it can still use,
|
|
428
|
+
* and a history range (a key start) delivers every group the publisher's {@link Info.maxAge}
|
|
429
|
+
* still considers fresh.
|
|
192
430
|
*/
|
|
193
431
|
subscribe(options?: Subscription): Subscriber;
|
|
432
|
+
/** A watch-only view of this track's subscriber demand. */
|
|
433
|
+
demand(): Demand;
|
|
194
434
|
/**
|
|
195
|
-
*
|
|
435
|
+
* Open a {@link Requests} handle serving the groups readers miss: ones their ranges name that
|
|
436
|
+
* the cache no longer holds, or never did, below the newest group written, and the groups a
|
|
437
|
+
* fetch ({@link Consumer.fetchGroup}, or a peer's bounded read of named groups) asks for past
|
|
438
|
+
* it. A handler that may still produce such a group leaves it unanswered while keeping the
|
|
439
|
+
* fill: the group written answers it. Most producers never need one; a publisher backed by
|
|
440
|
+
* storage opens one to serve its history. Mirrors the Rust `Producer::requests`.
|
|
196
441
|
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
/** Resolves once the track has no subscribers (or has closed). Await it to react to demand ending. */
|
|
203
|
-
unused(): Promise<void>;
|
|
204
|
-
/** Append a new group with the next sequence number. */
|
|
205
|
-
appendGroup(): GroupProducer;
|
|
206
|
-
/**
|
|
207
|
-
* Insert an existing group into the track.
|
|
442
|
+
* While one is open, each run of misses queues a {@link FillGroups}, which readers missing the same
|
|
443
|
+
* groups share; with none open, a miss is given up and {@link Consumer.fetchGroup} of an
|
|
444
|
+
* uncached group fails with `NotFound`. A reader only asks for what its budget still wants,
|
|
445
|
+
* so a reader at the live edge never asks. The track stays one track: answered groups land
|
|
446
|
+
* in its cache, and every reader of it sees them.
|
|
208
447
|
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* entry is already gone, so a long-evicted sequence is accepted as new.
|
|
448
|
+
* A handle is also the only way to create a group below the newest one
|
|
449
|
+
* ({@link Requests.createGroup}), so the last one closing skips every start below the newest
|
|
450
|
+
* group this producer never produced, except those a fill already handed out still answers.
|
|
213
451
|
*/
|
|
214
|
-
|
|
452
|
+
requests(): Requests;
|
|
453
|
+
/** The track's largest location: its newest group at the newest frame, or undefined before any. */
|
|
454
|
+
largest(): Position | undefined;
|
|
215
455
|
/**
|
|
216
|
-
*
|
|
456
|
+
* Create the next group, after every group this track holds, whose first frame is `frame`: the
|
|
457
|
+
* group starts at its timestamp. Mirrors the Rust `append_group`.
|
|
458
|
+
*
|
|
459
|
+
* A timed track converts the timestamp into its timescale, rounding down, as {@link writeFrame}
|
|
460
|
+
* does; a scale-less track takes {@link Timestamp.unscaled} at the group's key. A timestamp that
|
|
461
|
+
* doesn't match the track, or at or before a group this track holds, throws
|
|
462
|
+
* {@link TimestampMismatch}, like a rewound frame, before any group exists.
|
|
463
|
+
*
|
|
464
|
+
* Appending says the producer will not go back, so it skips every start below the new group
|
|
465
|
+
* that it never produced or dropped, from just past its previous append (from 0 before the
|
|
466
|
+
* first, even after {@link Requests.createGroup}): consecutive appends name the span between
|
|
467
|
+
* their starts. A drop given there stays a drop. The skipped starts are then final: creating one
|
|
468
|
+
* throws {@link Skipped}.
|
|
217
469
|
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
470
|
+
* The same broadcast, track, and group start always name the same content, and nothing
|
|
471
|
+
* checks it: the broadcast remembers nothing of an earlier producer of the name. A recreated
|
|
472
|
+
* track, or a restarted publisher keeping its identity, keeps its starts moving forward, as
|
|
473
|
+
* its media time does, or uses a new track name or identity. Reusing a start only corrupts
|
|
474
|
+
* this broadcast for its readers. Datagram keys name no cached content and are exempt.
|
|
475
|
+
*
|
|
476
|
+
* Its later frames must match the track's {@link Info.timescale}: a scaled timestamp on every
|
|
477
|
+
* frame of a timed track, and on a scale-less one {@link Timestamp.unscaled} at the group's
|
|
478
|
+
* start, or the write throws {@link TimestampMismatch}.
|
|
226
479
|
*/
|
|
227
|
-
|
|
480
|
+
appendGroup(frame: Frame): GroupProducer;
|
|
228
481
|
/**
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
* Preserves the supplied sequence (advancing the shared counter if needed) so a relay can
|
|
232
|
-
* forward a datagram without renumbering it. The size limits of {@link appendDatagram}
|
|
233
|
-
* apply. Most origin publishers want {@link appendDatagram} instead.
|
|
482
|
+
* {@link appendGroup} with its first frame streamed: the group exists once this returns, and
|
|
483
|
+
* {@link FrameProducer.finish} hands it back to write the rest. Mirrors the Rust `append_frame`.
|
|
234
484
|
*/
|
|
235
|
-
|
|
485
|
+
appendFrame(info: FrameInfo): FrameProducer;
|
|
236
486
|
/**
|
|
237
487
|
* Declare the track's exclusive end, possibly ahead of the live edge, mirroring the Rust
|
|
238
488
|
* `finish_at`.
|
|
239
489
|
*
|
|
240
|
-
* `
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
490
|
+
* `end` is the first position that will never be produced: a track whose last group is
|
|
491
|
+
* 89 finishes at `{ group: 90, frame: 0 }`, and `{ group: 89, frame: 5 }` also caps group
|
|
492
|
+
* 89 at frames 0 to 4. Groups and frames below it are still accepted; anything
|
|
493
|
+
* at or past it is refused. Unlike {@link close} it is not terminal: call `close()` once
|
|
494
|
+
* the remaining groups are written. Readers end once the live edge reaches the end's
|
|
495
|
+
* group, independently of closure. Throws if the track is closed, already has an end, or
|
|
496
|
+
* `end` would orphan a group or frame already produced or sit at or below a group
|
|
497
|
+
* {@link Requests.dropGroups} gave up. Use {@link finish} to end at the live edge, or past it
|
|
498
|
+
* when {@link Requests.dropGroups} gave up a higher group.
|
|
245
499
|
*/
|
|
246
|
-
finishAt(
|
|
500
|
+
finishAt(end: Position): void;
|
|
247
501
|
/**
|
|
248
|
-
*
|
|
502
|
+
* Declare the track's end after the highest key written, or after the highest group
|
|
503
|
+
* {@link Requests.dropGroups} gave up above it, returning it as {@link Finished}. The keys
|
|
504
|
+
* between the highest key written and that drop that were never produced are skipped, so a
|
|
505
|
+
* track that wrote groups 0 to 5 and dropped 8 and 9 ends at 10, with 6 and 7 skipped. A
|
|
506
|
+
* no-op once an end is declared or the track closed, so a cleanup path can finish whatever
|
|
507
|
+
* the track's state. A track that closed first keeps its outcome and declares no end, so its
|
|
508
|
+
* readers' `finished()` rejects.
|
|
249
509
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
*
|
|
510
|
+
* Not terminal: groups below the end may still be written. Readers end once the live edge
|
|
511
|
+
* reaches it.
|
|
512
|
+
*/
|
|
513
|
+
finish(): Finished;
|
|
514
|
+
/**
|
|
515
|
+
* Release this producer. Idempotent.
|
|
516
|
+
*
|
|
517
|
+
* With an end declared ({@link finish} or {@link finishAt}), the track ends
|
|
518
|
+
* there and its subscribers drain to it. Without one, subscribers end with a `Cancel`
|
|
519
|
+
* {@link StreamError}: nothing finished it. The only way to stop a track, mirroring a dropped
|
|
520
|
+
* Rust `track::Producer`; refuse a request with an error through `Request.reject` instead.
|
|
521
|
+
*/
|
|
522
|
+
close(): void;
|
|
523
|
+
/**
|
|
524
|
+
* Append a group holding one frame at its timestamp, which is where the group starts, as
|
|
525
|
+
* {@link appendGroup} does: on a scale-less track, {@link Timestamp.unscaled} at the group's
|
|
526
|
+
* key. A timestamp at or before a group this track holds, or that doesn't match the track,
|
|
527
|
+
* throws {@link TimestampMismatch} before any group exists. The group closes after its
|
|
528
|
+
* frame, since nothing says where it ends. Mirrors the Rust `write_frame`.
|
|
256
529
|
*/
|
|
257
|
-
close(abort?: Error): void;
|
|
258
|
-
/** Append a frame as its own single-frame group. */
|
|
259
530
|
writeFrame(frame: Frame): void;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* A track its producer finished: its end is declared unless it closed first, and it can still
|
|
534
|
+
* take an older group below that end through {@link Finished.requests}, be read, or be closed,
|
|
535
|
+
* but not append. {@link Producer.finish} returns it,
|
|
536
|
+
* mirroring the Rust `track::Finished`; the producer itself still refuses a group at or past the
|
|
537
|
+
* end.
|
|
538
|
+
*
|
|
539
|
+
* @public
|
|
540
|
+
*/
|
|
541
|
+
export interface Finished {
|
|
542
|
+
/** The track name. */
|
|
543
|
+
readonly name: string;
|
|
544
|
+
/** Settles once the track's outcome is final; see {@link Producer.closed}. */
|
|
545
|
+
readonly closed: GetPromise<Error | null>;
|
|
546
|
+
/** The track's info, once accepted. */
|
|
547
|
+
info(): Promise<Info>;
|
|
548
|
+
/**
|
|
549
|
+
* Serve the groups readers miss below the end, or create an older one that arrived late with
|
|
550
|
+
* {@link Requests.createGroup}; see {@link Producer.requests}.
|
|
551
|
+
*/
|
|
552
|
+
requests(): Requests;
|
|
553
|
+
/** Subscribe to this in-process track; see {@link Producer.subscribe}. */
|
|
554
|
+
subscribe(options?: Subscription): Subscriber;
|
|
555
|
+
/** Release the track; see {@link Producer.close}. */
|
|
556
|
+
close(): void;
|
|
266
557
|
}
|
|
267
558
|
/**
|
|
268
559
|
* The read side of a live track subscription, mirroring the Rust `Subscriber`.
|
|
@@ -279,8 +570,9 @@ export declare class Subscriber {
|
|
|
279
570
|
/**
|
|
280
571
|
* Resolve this track's immutable publisher properties.
|
|
281
572
|
*
|
|
282
|
-
* Resolves once the wire layer commits the
|
|
283
|
-
*
|
|
573
|
+
* Resolves once the wire layer commits the properties it received (TRACK_INFO on
|
|
574
|
+
* lite-05+, SUBSCRIBE_OK on moq-transport) or an untimed default (older lite drafts),
|
|
575
|
+
* so awaiting it never yields a placeholder. Rejects if
|
|
284
576
|
* the track is closed before the properties are known (e.g. a rejected subscription).
|
|
285
577
|
*/
|
|
286
578
|
info(): Promise<Info>;
|
|
@@ -288,42 +580,39 @@ export declare class Subscriber {
|
|
|
288
580
|
get closed(): GetPromise<Error | null>;
|
|
289
581
|
/** This subscriber's current options, including defaults and the last {@link update}. */
|
|
290
582
|
get subscription(): Getter<Subscription | undefined>;
|
|
291
|
-
/** Return the latest group sequence observed on this track, if any. */
|
|
292
|
-
latest(): number | undefined;
|
|
293
|
-
/**
|
|
294
|
-
* The track's exclusive final boundary: the end {@link Producer.finishAt} declared, which
|
|
295
|
-
* can be ahead of the live edge, or one past the highest sequence produced once the
|
|
296
|
-
* producer closes cleanly (0 for a track that produced none). Groups and datagrams share
|
|
297
|
-
* the sequence namespace, so this can exceed `latest() + 1`. Undefined until declared,
|
|
298
|
-
* and after an abort that declared none.
|
|
299
|
-
*/
|
|
300
|
-
final(): number | undefined;
|
|
301
583
|
/**
|
|
302
|
-
* Resolve with the track's exclusive
|
|
303
|
-
* `finished`.
|
|
584
|
+
* Resolve with the track's exclusive end once it is known, mirroring the Rust `finished`.
|
|
304
585
|
*
|
|
305
586
|
* Resolves as soon as the end is declared, which may be ahead of the live edge, so it
|
|
306
587
|
* says nothing about every group having arrived: read until the cursor returns
|
|
307
588
|
* `undefined` for that. Rejects with the abort, or if the track closes without an end.
|
|
308
589
|
*/
|
|
309
|
-
finished(): Promise<
|
|
590
|
+
finished(): Promise<Position>;
|
|
310
591
|
/**
|
|
311
|
-
* The
|
|
592
|
+
* The lowest group this subscriber's ranges name, as resolved here: undefined while one reaches back to the oldest group still around, or a
|
|
593
|
+
* live join still waits on the first group from the live feed.
|
|
312
594
|
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
* reads as `undefined` once the newest group has been evicted or received: what is
|
|
316
|
-
* left can no longer say where the edge is.
|
|
595
|
+
* Where a reader that waits on each group in key starts, rather than at whatever arrives
|
|
596
|
+
* first, which newest-first delivery makes the latest. Mirrors the Rust `Subscriber::floor`.
|
|
317
597
|
*/
|
|
318
|
-
|
|
319
|
-
/** Limit subsequent reads to these groups and return this reader for chaining. */
|
|
320
|
-
withGroups(groups: Groups): this;
|
|
598
|
+
floor(): bigint | undefined;
|
|
321
599
|
/**
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
600
|
+
* Whether the publisher declared every start in `[start, end)` skipped, never to be produced,
|
|
601
|
+
* so no group can arrive there; see {@link Ordered.isSkipped}. Mirrors the Rust
|
|
602
|
+
* `Subscriber::is_skipped`.
|
|
325
603
|
*/
|
|
326
|
-
|
|
604
|
+
isSkipped(start: bigint, end: bigint): boolean;
|
|
605
|
+
/**
|
|
606
|
+
* The largest location: the current one at first, then each newer
|
|
607
|
+
* one (skipping any in between), and `undefined` once the track ends.
|
|
608
|
+
*
|
|
609
|
+
* The largest is the track's newest group at the newest frame (0 while empty), as
|
|
610
|
+
* the publisher reported it and its feed delivered since, so it can name a frame before its
|
|
611
|
+
* group arrives. A largest past the cap or below the floor reports nothing: the cache does not
|
|
612
|
+
* stand in for it, so a cap moved below the largest stays pending. Moving the bounds wakes a
|
|
613
|
+
* pending read, which reports the largest once it is within them and newer than the last report.
|
|
614
|
+
*/
|
|
615
|
+
largest(): Promise<Position | undefined>;
|
|
327
616
|
/** Close the track (optionally with an error), closing any pending groups. Idempotent. */
|
|
328
617
|
close(abort?: Error): void;
|
|
329
618
|
/**
|
|
@@ -331,55 +620,62 @@ export declare class Subscriber {
|
|
|
331
620
|
*
|
|
332
621
|
* Groups may arrive out of order or with gaps due to network conditions; unlike
|
|
333
622
|
* {@link Ordered.nextGroup}, one that arrives after a newer group was already returned
|
|
334
|
-
* is still delivered. When several groups are buffered,
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
623
|
+
* is still delivered. When several groups are buffered, a backlog or a replayed cache,
|
|
624
|
+
* they come in the subscription's {@link Order}: newest first unless `"ascending"`, which
|
|
625
|
+
* reads them oldest first.
|
|
626
|
+
*
|
|
627
|
+
* Once the track closes cleanly, a reader with nothing left in range finishes. So does a
|
|
628
|
+
* read whose {@link Subscription.ranges} all end, once every group in them was handed out,
|
|
629
|
+
* dropped, skipped as stale, or will never arrive, while the track goes on, as in Rust;
|
|
630
|
+
* later reads return `undefined` immediately too, and widening the ranges with {@link update}
|
|
631
|
+
* reads on without replaying groups already returned.
|
|
632
|
+
* A group a live range reached whose presentation time is further behind the live edge than
|
|
633
|
+
* that range's {@link Live.max} is skipped. The default subscription's zero takes the live edge.
|
|
342
634
|
* The budget remains attached after return, so a pending frame read rejects if a stalled
|
|
343
635
|
* group becomes stale while newer data advances.
|
|
344
636
|
*
|
|
345
637
|
* The first call commits this track to arrival order: {@link ordered} throws afterwards.
|
|
346
638
|
*/
|
|
347
639
|
recvGroup(): Promise<GroupConsumer | undefined>;
|
|
348
|
-
/**
|
|
349
|
-
* Take the next buffered group without blocking, honoring the same cursor bounds as
|
|
350
|
-
* {@link recvGroup}.
|
|
351
|
-
*
|
|
352
|
-
* Returns `undefined` when nothing is deliverable right now, which is not by itself the
|
|
353
|
-
* end of the track: a group may still arrive, or one may be parked beyond the
|
|
354
|
-
* {@link setGroups} cap. Use it to drain what the retained window already holds, where
|
|
355
|
-
* waiting for a sequence nothing will republish would park forever.
|
|
356
|
-
*/
|
|
357
|
-
tryRecvGroup(): GroupConsumer | undefined;
|
|
358
|
-
/**
|
|
359
|
-
* Receive the next datagram in arrival order.
|
|
360
|
-
*
|
|
361
|
-
* Datagrams are a separate best-effort channel from groups (see
|
|
362
|
-
* {@link Producer.appendDatagram}); they share only the sequence namespace. A consumer
|
|
363
|
-
* that falls too far behind silently loses the oldest datagrams. Read this alongside
|
|
364
|
-
* {@link recvGroup} (e.g. in a separate loop) to receive both channels concurrently.
|
|
365
|
-
* The two cursors are independent: a datagram never moves the group cursor.
|
|
366
|
-
*/
|
|
367
|
-
recvDatagram(): Promise<Datagram | undefined>;
|
|
368
640
|
/**
|
|
369
641
|
* Read this track's groups in sequence order instead of arrival order.
|
|
370
642
|
*
|
|
371
643
|
* Both cursors draw from the same buffer, so a track is read one way or the other: this
|
|
372
644
|
* hands the subscription to the returned {@link Ordered} and leaves this handle inert.
|
|
373
|
-
* {@link recvGroup}
|
|
645
|
+
* {@link recvGroup} throw afterwards. Throws once a
|
|
374
646
|
* {@link recvGroup} call has already committed the track to arrival order.
|
|
375
647
|
*
|
|
376
|
-
* Datagrams come along: they are a separate cursor either way, so the choice of group
|
|
377
|
-
* order says nothing about them, and reading them commits nothing.
|
|
378
648
|
*/
|
|
379
649
|
ordered(): Ordered;
|
|
380
650
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
651
|
+
* Ask the publisher for a group starting after the newest one this node holds, judged by the
|
|
652
|
+
* track's {@link Info.refresh}, resolving once the request is sent. Mirrors the Rust
|
|
653
|
+
* `Subscriber::refresh`.
|
|
654
|
+
*
|
|
655
|
+
* The request is made now. It is sent once the newest group is old enough, when whatever
|
|
656
|
+
* serves this node's copy reads it: the session forwarding it upstream, or a local publisher
|
|
657
|
+
* watching {@link Demand.refresh}. Concurrent requests coalesce into one, and all of them
|
|
658
|
+
* resolve when it is sent. Aborting `options.signal` before then withdraws this caller's
|
|
659
|
+
* request and rejects with the signal's reason; one already sent stays sent. It resolves at
|
|
660
|
+
* once when there is nothing to send: a track that does not refresh, a ratio the newest group
|
|
661
|
+
* is under, a track with no group yet (whose first is already asked for), or a request
|
|
662
|
+
* already sent. It also resolves when a newer group lands first, which answers it. It rejects
|
|
663
|
+
* if the track closes before then. A resumed reader asks the copy serving it, and asks the next
|
|
664
|
+
* one if that copy closes first.
|
|
665
|
+
*
|
|
666
|
+
* The answer arrives like any other group: the first group this subscriber receives that
|
|
667
|
+
* starts after the newest held when it was called. A group already on its way when the
|
|
668
|
+
* request reached the publisher answers it, so across hops "made after this call" is best
|
|
669
|
+
* effort; a reader that needs that puts its own marker in the frame.
|
|
670
|
+
*/
|
|
671
|
+
refresh(options?: RefreshOptions): Promise<void>;
|
|
672
|
+
/**
|
|
673
|
+
* Update this subscription's options (e.g. a range's priority), triggering a SUBSCRIBE_UPDATE to the
|
|
674
|
+
* publisher. Replacing the ranges resolves them again, without redelivering a group read
|
|
675
|
+
* while they held it throughout; ranges replaced off a group may forget it, so ranges holding
|
|
676
|
+
* it again may hand it out again, as a new subscription would. An arrival reader can receive
|
|
677
|
+
* the unread groups it still holds that the new ranges take in. Changing only a live join's {@link Live.max} keeps where it joined.
|
|
678
|
+
* Mirrors the Rust `Subscriber::update`.
|
|
383
679
|
*/
|
|
384
680
|
update(options: Subscription): void;
|
|
385
681
|
}
|
|
@@ -388,16 +684,25 @@ export declare class Subscriber {
|
|
|
388
684
|
*
|
|
389
685
|
* Created by {@link Subscriber.ordered}, which takes the subscription over: the two
|
|
390
686
|
* cursors draw from one buffer, so a track is read one way or the other and never both.
|
|
391
|
-
* Every group this returns has a higher
|
|
392
|
-
*
|
|
687
|
+
* Every group this returns has a higher key than the last, so a late arrival is
|
|
688
|
+
* reported as a gap rather than delivered out of turn, as is every group the read gives up on
|
|
689
|
+
* (see {@link Ordered.nextGroup}).
|
|
393
690
|
*
|
|
394
|
-
*
|
|
691
|
+
* A live range's {@link Live.max} applies as this cursor reads, exactly as it does on the arrival cursor: a
|
|
395
692
|
* group is skipped once its reach, where its immediate successor begins, is that far
|
|
396
693
|
* behind the newest frame on the track. Nothing weaker convicts it, since the reach is
|
|
397
694
|
* the only proof that every frame it could still hold is past the budget, so a backlog
|
|
398
695
|
* inside the budget is still delivered whole, as a burst in order. The budget follows a
|
|
399
696
|
* group already handed out too: a stalled group's pending frame read rejects once newer
|
|
400
697
|
* content has pulled that far ahead.
|
|
698
|
+
*
|
|
699
|
+
* A history or VOD read asks a key range, which never goes stale. A subscribed track waits for a
|
|
700
|
+
* missing group the feed still owes, within the budget, or until it resolves without one.
|
|
701
|
+
* Local tracks skip missing groups. An unlimited or long budget
|
|
702
|
+
* only avoids blocking where the feed signals its gaps: moq-lite, whose publisher sends
|
|
703
|
+
* `SUBSCRIBE_DROP` for every group it won't deliver, or an ordered moq-transport FETCH.
|
|
704
|
+
* Over a moq-transport SUBSCRIBE, which signals no gaps, that wait can last until the
|
|
705
|
+
* track ends.
|
|
401
706
|
*/
|
|
402
707
|
export declare class Ordered {
|
|
403
708
|
#private;
|
|
@@ -410,55 +715,82 @@ export declare class Ordered {
|
|
|
410
715
|
get closed(): GetPromise<Error | null>;
|
|
411
716
|
/** This subscriber's current options, including defaults and the last {@link update}. */
|
|
412
717
|
get subscription(): Getter<Subscription | undefined>;
|
|
413
|
-
/** The
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
718
|
+
/** The largest location; see {@link Subscriber.largest}. */
|
|
719
|
+
largest(): Promise<Position | undefined>;
|
|
720
|
+
/** Resolve with the track's exclusive end once known; see {@link Subscriber.finished}. */
|
|
721
|
+
finished(): Promise<Position>;
|
|
722
|
+
/**
|
|
723
|
+
* Whether the publisher declared every start in `[start, end)` skipped, never to be produced
|
|
724
|
+
* (which {@link Producer.appendGroup} does between groups), so no group can arrive there: true
|
|
725
|
+
* for an empty range. Unlike the gaps, this ignores the ranges. A copy knows only the skips its
|
|
726
|
+
* wire forwarded.
|
|
727
|
+
*
|
|
728
|
+
* What tells a reader that nothing lies between two groups, or before a track's first. It
|
|
729
|
+
* knows only the skips recorded so far, so `false` means "not known skipped": a skip still in
|
|
730
|
+
* flight reads `false`, as does one a local producer's cache expired below its edge. Mirrors
|
|
731
|
+
* the Rust `Ordered::is_skipped`.
|
|
732
|
+
*/
|
|
733
|
+
isSkipped(start: bigint, end: bigint): boolean;
|
|
423
734
|
/** Update this subscription's options; see {@link Subscriber.update}. */
|
|
424
735
|
update(options: Subscription): void;
|
|
736
|
+
/** Ask for a group newer than the newest held; see {@link Subscriber.refresh}. */
|
|
737
|
+
refresh(options?: RefreshOptions): Promise<void>;
|
|
425
738
|
/** Close the track (optionally with an error), closing any pending groups. Idempotent. */
|
|
426
739
|
close(abort?: Error): void;
|
|
427
740
|
/**
|
|
428
|
-
* Return the next group with a strictly-greater sequence number than the last returned
|
|
741
|
+
* Return the next group with a strictly-greater sequence number than the last returned,
|
|
742
|
+
* passing any gap {@link nextItem} would report below it. Mirrors the Rust `next_group`.
|
|
429
743
|
*
|
|
430
|
-
* Late arrivals (
|
|
431
|
-
* group whose every frame is further behind the live edge than
|
|
432
|
-
*
|
|
433
|
-
* {@link
|
|
744
|
+
* Late arrivals (key at or below the last returned) are silently skipped, as is a
|
|
745
|
+
* group a live range reached whose every frame is further behind the live edge than its
|
|
746
|
+
* {@link Live.max} (the default
|
|
747
|
+
* subscription's zero keeps only what nothing newer has superseded). Like {@link Subscriber.recvGroup}, a read whose ranges all end
|
|
748
|
+
* finishes once nothing in them is left to deliver; on a local track that includes a key
|
|
749
|
+
* below a group the producer created, which this read hands out first. Later reads return `undefined`
|
|
750
|
+
* immediately too; widening the ranges with {@link update} reads on above the end the read
|
|
751
|
+
* passed (or the cap, when that was lower), so a group created below that end afterward is
|
|
752
|
+
* never handed out.
|
|
434
753
|
*/
|
|
435
754
|
nextGroup(): Promise<GroupConsumer | undefined>;
|
|
755
|
+
/**
|
|
756
|
+
* Take the next group as {@link nextGroup} would, without waiting: `undefined` when nothing
|
|
757
|
+
* is deliverable right now, which is not by itself the end of the track. Mirrors the Rust
|
|
758
|
+
* `poll_next_group`.
|
|
759
|
+
*/
|
|
760
|
+
tryNextGroup(): GroupConsumer | undefined;
|
|
761
|
+
/**
|
|
762
|
+
* The next group, as {@link nextGroup} returns it, or a gap this reader gave up on below it.
|
|
763
|
+
* Mirrors the Rust `next_item` and its `Item`.
|
|
764
|
+
*
|
|
765
|
+
* A gap is every group the publisher or a relay dropped, the transport evicted, a {@link Live.max}
|
|
766
|
+
* aged out, a fill could not find, or that landed after the read passed its key. It carries
|
|
767
|
+
* the keys it spans and is returned once, after any group the read still owes below it and
|
|
768
|
+
* before the next group above it, or when the track ends. Keys the publisher declared skipped
|
|
769
|
+
* were never groups, so they are no gap, and nor is a key a local track never produced.
|
|
770
|
+
* Unlike Rust, nor is a group a local track produces after the read moved past its key: the
|
|
771
|
+
* read keeps no record below where it is, so its memory stays bounded. A session-fed track
|
|
772
|
+
* reports such a key at the latest when the read passes it.
|
|
773
|
+
*/
|
|
774
|
+
nextItem(): Promise<Item | undefined>;
|
|
775
|
+
/**
|
|
776
|
+
* Take the next item as {@link nextItem} would, without waiting: `undefined` when nothing
|
|
777
|
+
* is ready right now, which is not by itself the end of the track. Mirrors the Rust
|
|
778
|
+
* `poll_next_item`.
|
|
779
|
+
*/
|
|
780
|
+
tryNextItem(): Item | undefined;
|
|
436
781
|
/**
|
|
437
782
|
* Read the next frame across groups, in sequence order, with its group and frame numbers.
|
|
438
783
|
*
|
|
439
784
|
* Rides the same cursor as {@link nextGroup} and shares this handle's contract: a
|
|
440
|
-
* buffered backlog is drained in full up to the point
|
|
441
|
-
*
|
|
785
|
+
* buffered backlog is drained in full up to the point a {@link Live.max} proves it useless.
|
|
786
|
+
* A group that fails is a gap this read continues past, so it throws only once the track
|
|
787
|
+
* itself ends with an error; read with {@link nextItem} and each group's own `readFrame` to
|
|
788
|
+
* learn why a group failed. Treat the returned frame bytes as read-only; they are shared with
|
|
789
|
+
* other consumers.
|
|
442
790
|
*/
|
|
443
791
|
readFrame(): Promise<({
|
|
444
|
-
group:
|
|
792
|
+
group: bigint;
|
|
445
793
|
frame: number;
|
|
446
794
|
} & Frame) | undefined>;
|
|
447
|
-
/** Read the next frame and decode it as a UTF-8 string. */
|
|
448
|
-
readString(): Promise<string | undefined>;
|
|
449
|
-
/** Read the next frame and parse it as JSON. */
|
|
450
|
-
readJson(): Promise<unknown | undefined>;
|
|
451
|
-
/** Read the next frame and decode it as a one-byte boolean, throwing on a malformed frame. */
|
|
452
|
-
readBool(): Promise<boolean | undefined>;
|
|
453
|
-
/**
|
|
454
|
-
* Receive the next datagram in arrival order.
|
|
455
|
-
*
|
|
456
|
-
* Datagrams are a separate best-effort channel from groups (see
|
|
457
|
-
* {@link Producer.appendDatagram}); they share only the sequence namespace, and
|
|
458
|
-
* neither cursor moves the other. Unordered by construction, so this behaves
|
|
459
|
-
* identically on either handle; it is here so a track carrying both channels needs
|
|
460
|
-
* one subscription rather than two.
|
|
461
|
-
*/
|
|
462
|
-
recvDatagram(): Promise<Datagram | undefined>;
|
|
463
795
|
}
|
|
464
796
|
//# sourceMappingURL=track.d.ts.map
|