@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.
Files changed (664) hide show
  1. package/README.md +7 -1
  2. package/announce.d.ts +1 -1
  3. package/announce.d.ts.map +1 -1
  4. package/announce.js +1 -2
  5. package/announce.js.map +1 -1
  6. package/announced.d.ts +51 -47
  7. package/announced.d.ts.map +1 -1
  8. package/announced.js +183 -32
  9. package/announced.js.map +1 -1
  10. package/announced.test-util.d.ts +2 -0
  11. package/announced.test-util.d.ts.map +1 -0
  12. package/announced.test-util.js +27 -0
  13. package/announced.test-util.js.map +1 -0
  14. package/auth.d.ts +64 -0
  15. package/auth.d.ts.map +1 -0
  16. package/auth.js +20 -0
  17. package/auth.js.map +1 -0
  18. package/auth_gate.d.ts +2 -0
  19. package/auth_gate.d.ts.map +1 -0
  20. package/auth_gate.js +24 -0
  21. package/auth_gate.js.map +1 -0
  22. package/auth_session.d.ts +49 -0
  23. package/auth_session.d.ts.map +1 -0
  24. package/auth_session.js +1097 -0
  25. package/auth_session.js.map +1 -0
  26. package/bandwidth.d.ts +129 -25
  27. package/bandwidth.d.ts.map +1 -1
  28. package/bandwidth.js +410 -139
  29. package/bandwidth.js.map +1 -1
  30. package/bandwidth_api.d.ts +1 -1
  31. package/bandwidth_api.d.ts.map +1 -1
  32. package/bandwidth_api.js +1 -2
  33. package/bandwidth_api.js.map +1 -1
  34. package/broadcast.d.ts +64 -38
  35. package/broadcast.d.ts.map +1 -1
  36. package/broadcast.js +556 -173
  37. package/broadcast.js.map +1 -1
  38. package/cache.d.ts +103 -0
  39. package/cache.d.ts.map +1 -0
  40. package/cache.js +254 -0
  41. package/cache.js.map +1 -0
  42. package/claim.test-util.d.ts +5 -0
  43. package/claim.test-util.d.ts.map +1 -0
  44. package/claim.test-util.js +13 -0
  45. package/claim.test-util.js.map +1 -0
  46. package/connection/accept.d.ts +21 -13
  47. package/connection/accept.d.ts.map +1 -1
  48. package/connection/accept.js +97 -130
  49. package/connection/accept.js.map +1 -1
  50. package/connection/browser.d.ts.map +1 -1
  51. package/connection/browser.js +28 -20
  52. package/connection/browser.js.map +1 -1
  53. package/connection/connect.d.ts +120 -24
  54. package/connection/connect.d.ts.map +1 -1
  55. package/connection/connect.js +535 -217
  56. package/connection/connect.js.map +1 -1
  57. package/connection/dials.d.ts +45 -0
  58. package/connection/dials.d.ts.map +1 -0
  59. package/connection/dials.js +109 -0
  60. package/connection/dials.js.map +1 -0
  61. package/connection/endpoint.d.ts +60 -0
  62. package/connection/endpoint.d.ts.map +1 -0
  63. package/connection/endpoint.js +114 -0
  64. package/connection/endpoint.js.map +1 -0
  65. package/connection/forward.d.ts +7 -1
  66. package/connection/forward.d.ts.map +1 -1
  67. package/connection/forward.js +265 -81
  68. package/connection/forward.js.map +1 -1
  69. package/connection/goaway.d.ts +16 -9
  70. package/connection/goaway.d.ts.map +1 -1
  71. package/connection/goaway.js +22 -95
  72. package/connection/goaway.js.map +1 -1
  73. package/connection/handshake.d.ts +34 -8
  74. package/connection/handshake.d.ts.map +1 -1
  75. package/connection/handshake.js +97 -21
  76. package/connection/handshake.js.map +1 -1
  77. package/connection/index.d.ts +4 -7
  78. package/connection/index.d.ts.map +1 -1
  79. package/connection/index.js +1 -3
  80. package/connection/index.js.map +1 -1
  81. package/connection/liveness.d.ts +14 -0
  82. package/connection/liveness.d.ts.map +1 -0
  83. package/connection/liveness.js +30 -0
  84. package/connection/liveness.js.map +1 -0
  85. package/connection/pool.d.ts +142 -63
  86. package/connection/pool.d.ts.map +1 -1
  87. package/connection/pool.js +281 -118
  88. package/connection/pool.js.map +1 -1
  89. package/connection/reload.d.ts +60 -12
  90. package/connection/reload.d.ts.map +1 -1
  91. package/connection/reload.js +859 -234
  92. package/connection/reload.js.map +1 -1
  93. package/connection/session.d.ts +91 -0
  94. package/connection/session.d.ts.map +1 -0
  95. package/connection/session.js +2 -0
  96. package/connection/session.js.map +1 -0
  97. package/connection/stats.d.ts +20 -11
  98. package/connection/stats.d.ts.map +1 -1
  99. package/connection/stats.js +64 -9
  100. package/connection/stats.js.map +1 -1
  101. package/connection/ticker.d.ts +4 -0
  102. package/connection/ticker.d.ts.map +1 -0
  103. package/connection/ticker.js +66 -0
  104. package/connection/ticker.js.map +1 -0
  105. package/connection/tokens.d.ts +2 -0
  106. package/connection/tokens.d.ts.map +1 -0
  107. package/connection/tokens.js +404 -0
  108. package/connection/tokens.js.map +1 -0
  109. package/connection/transport.d.ts.map +1 -1
  110. package/connection/transport.js +4 -5
  111. package/connection/transport.js.map +1 -1
  112. package/connection/withdrawal.d.ts +2 -0
  113. package/connection/withdrawal.d.ts.map +1 -0
  114. package/connection/withdrawal.js +23 -0
  115. package/connection/withdrawal.js.map +1 -0
  116. package/consume.js +213 -47
  117. package/consume.js.map +1 -1
  118. package/cover.d.ts +59 -0
  119. package/cover.d.ts.map +1 -0
  120. package/cover.js +375 -0
  121. package/cover.js.map +1 -0
  122. package/datagram.d.ts +70 -11
  123. package/datagram.d.ts.map +1 -1
  124. package/datagram.js +317 -2
  125. package/datagram.js.map +1 -1
  126. package/datagram_stream.d.ts +18 -0
  127. package/datagram_stream.d.ts.map +1 -0
  128. package/datagram_stream.js +67 -0
  129. package/datagram_stream.js.map +1 -0
  130. package/defined.test-util.d.ts +2 -0
  131. package/defined.test-util.d.ts.map +1 -0
  132. package/defined.test-util.js +7 -0
  133. package/defined.test-util.js.map +1 -0
  134. package/delivered.d.ts +75 -0
  135. package/delivered.d.ts.map +1 -0
  136. package/delivered.js +228 -0
  137. package/delivered.js.map +1 -0
  138. package/demand.d.ts +173 -0
  139. package/demand.d.ts.map +1 -0
  140. package/demand.js +582 -0
  141. package/demand.js.map +1 -0
  142. package/drops.d.ts +93 -0
  143. package/drops.d.ts.map +1 -0
  144. package/drops.js +283 -0
  145. package/drops.js.map +1 -0
  146. package/error.d.ts +120 -21
  147. package/error.d.ts.map +1 -1
  148. package/error.js +230 -38
  149. package/error.js.map +1 -1
  150. package/errors.d.ts +2 -2
  151. package/errors.d.ts.map +1 -1
  152. package/errors.js +2 -3
  153. package/errors.js.map +1 -1
  154. package/fill.d.ts +174 -0
  155. package/fill.d.ts.map +1 -0
  156. package/fill.js +760 -0
  157. package/fill.js.map +1 -0
  158. package/flate/decoder.d.ts +2 -0
  159. package/flate/decoder.d.ts.map +1 -0
  160. package/flate/decoder.js +63 -0
  161. package/flate/decoder.js.map +1 -0
  162. package/flate/encoder.d.ts +2 -0
  163. package/flate/encoder.d.ts.map +1 -0
  164. package/flate/encoder.js +64 -0
  165. package/flate/encoder.js.map +1 -0
  166. package/flate/group.d.ts +34 -0
  167. package/flate/group.d.ts.map +1 -0
  168. package/flate/group.js +140 -0
  169. package/flate/group.js.map +1 -0
  170. package/frame.d.ts +80 -0
  171. package/frame.d.ts.map +1 -0
  172. package/frame.js +296 -0
  173. package/frame.js.map +1 -0
  174. package/frame.test-util.d.ts +5 -0
  175. package/frame.test-util.d.ts.map +1 -0
  176. package/frame.test-util.js +9 -0
  177. package/frame.test-util.js.map +1 -0
  178. package/group.d.ts +108 -45
  179. package/group.d.ts.map +1 -1
  180. package/group.js +1616 -308
  181. package/group.js.map +1 -1
  182. package/group_api.d.ts +7 -0
  183. package/group_api.d.ts.map +1 -0
  184. package/group_api.js +7 -0
  185. package/group_api.js.map +1 -0
  186. package/hop.d.ts +62 -76
  187. package/hop.d.ts.map +1 -1
  188. package/hop.js +92 -65
  189. package/hop.js.map +1 -1
  190. package/identity.d.ts +39 -0
  191. package/identity.d.ts.map +1 -0
  192. package/identity.js +47 -0
  193. package/identity.js.map +1 -0
  194. package/ietf/active_count.d.ts +2 -0
  195. package/ietf/active_count.d.ts.map +1 -0
  196. package/ietf/active_count.js +30 -0
  197. package/ietf/active_count.js.map +1 -0
  198. package/ietf/aliases.js +69 -36
  199. package/ietf/aliases.js.map +1 -1
  200. package/ietf/cluster.d.ts +3 -3
  201. package/ietf/cluster.js +14 -55
  202. package/ietf/cluster.js.map +1 -1
  203. package/ietf/connection.d.ts +1 -31
  204. package/ietf/connection.d.ts.map +1 -1
  205. package/ietf/connection.js +305 -144
  206. package/ietf/connection.js.map +1 -1
  207. package/ietf/datagram.d.ts +60 -0
  208. package/ietf/datagram.d.ts.map +1 -0
  209. package/ietf/datagram.js +152 -0
  210. package/ietf/datagram.js.map +1 -0
  211. package/ietf/error.d.ts +3 -3
  212. package/ietf/error.js +82 -101
  213. package/ietf/error.js.map +1 -1
  214. package/ietf/fetch.d.ts +93 -37
  215. package/ietf/fetch.d.ts.map +1 -1
  216. package/ietf/fetch.js +172 -94
  217. package/ietf/fetch.js.map +1 -1
  218. package/ietf/filter.d.ts +21 -31
  219. package/ietf/filter.d.ts.map +1 -1
  220. package/ietf/filter.js +140 -172
  221. package/ietf/filter.js.map +1 -1
  222. package/ietf/goaway.d.ts +12 -10
  223. package/ietf/goaway.d.ts.map +1 -1
  224. package/ietf/goaway.js +22 -36
  225. package/ietf/goaway.js.map +1 -1
  226. package/ietf/hidden.js +1 -2
  227. package/ietf/hidden.js.map +1 -1
  228. package/ietf/index.d.ts +8 -20
  229. package/ietf/index.d.ts.map +1 -1
  230. package/ietf/index.js +4 -15
  231. package/ietf/index.js.map +1 -1
  232. package/ietf/join.d.ts +7 -0
  233. package/ietf/join.d.ts.map +1 -0
  234. package/ietf/join.js +234 -0
  235. package/ietf/join.js.map +1 -0
  236. package/ietf/message.d.ts +18 -2
  237. package/ietf/message.d.ts.map +1 -1
  238. package/ietf/message.js +60 -41
  239. package/ietf/message.js.map +1 -1
  240. package/ietf/message.test-util.d.ts +6 -0
  241. package/ietf/message.test-util.d.ts.map +1 -0
  242. package/ietf/message.test-util.js +13 -0
  243. package/ietf/message.test-util.js.map +1 -0
  244. package/ietf/namespace.d.ts +19 -5
  245. package/ietf/namespace.d.ts.map +1 -1
  246. package/ietf/namespace.js +78 -27
  247. package/ietf/namespace.js.map +1 -1
  248. package/ietf/object.d.ts +195 -33
  249. package/ietf/object.d.ts.map +1 -1
  250. package/ietf/object.js +405 -179
  251. package/ietf/object.js.map +1 -1
  252. package/ietf/parameters.d.ts +25 -45
  253. package/ietf/parameters.d.ts.map +1 -1
  254. package/ietf/parameters.js +260 -473
  255. package/ietf/parameters.js.map +1 -1
  256. package/ietf/priority.d.ts +17 -2
  257. package/ietf/priority.d.ts.map +1 -1
  258. package/ietf/priority.js +19 -5
  259. package/ietf/priority.js.map +1 -1
  260. package/ietf/properties.d.ts +6 -5
  261. package/ietf/properties.d.ts.map +1 -1
  262. package/ietf/properties.js +78 -49
  263. package/ietf/properties.js.map +1 -1
  264. package/ietf/publish.d.ts +25 -33
  265. package/ietf/publish.d.ts.map +1 -1
  266. package/ietf/publish.js +45 -140
  267. package/ietf/publish.js.map +1 -1
  268. package/ietf/publish_namespace.d.ts +49 -72
  269. package/ietf/publish_namespace.d.ts.map +1 -1
  270. package/ietf/publish_namespace.js +66 -185
  271. package/ietf/publish_namespace.js.map +1 -1
  272. package/ietf/publisher.js +1800 -601
  273. package/ietf/publisher.js.map +1 -1
  274. package/ietf/range.d.ts +2 -0
  275. package/ietf/range.d.ts.map +1 -0
  276. package/ietf/range.js +222 -0
  277. package/ietf/range.js.map +1 -0
  278. package/ietf/request.d.ts +6 -30
  279. package/ietf/request.d.ts.map +1 -1
  280. package/ietf/request.js +41 -79
  281. package/ietf/request.js.map +1 -1
  282. package/ietf/request_stream.d.ts +1 -6
  283. package/ietf/request_stream.d.ts.map +1 -1
  284. package/ietf/request_stream.js +306 -17
  285. package/ietf/request_stream.js.map +1 -1
  286. package/ietf/session.d.ts +41 -0
  287. package/ietf/session.d.ts.map +1 -0
  288. package/ietf/session.js +65 -0
  289. package/ietf/session.js.map +1 -0
  290. package/ietf/setup.d.ts +5 -30
  291. package/ietf/setup.d.ts.map +1 -1
  292. package/ietf/setup.js +6 -118
  293. package/ietf/setup.js.map +1 -1
  294. package/ietf/setup_options.d.ts +31 -0
  295. package/ietf/setup_options.d.ts.map +1 -0
  296. package/ietf/setup_options.js +138 -0
  297. package/ietf/setup_options.js.map +1 -0
  298. package/ietf/solicit.js +4 -15
  299. package/ietf/solicit.js.map +1 -1
  300. package/ietf/subscribe.d.ts +52 -45
  301. package/ietf/subscribe.d.ts.map +1 -1
  302. package/ietf/subscribe.js +118 -240
  303. package/ietf/subscribe.js.map +1 -1
  304. package/ietf/subscribe_namespace.d.ts +16 -79
  305. package/ietf/subscribe_namespace.d.ts.map +1 -1
  306. package/ietf/subscribe_namespace.js +30 -202
  307. package/ietf/subscribe_namespace.js.map +1 -1
  308. package/ietf/subscriber.js +1839 -537
  309. package/ietf/subscriber.js.map +1 -1
  310. package/ietf/token.js +105 -28
  311. package/ietf/token.js.map +1 -1
  312. package/ietf/track.d.ts +27 -24
  313. package/ietf/track.d.ts.map +1 -1
  314. package/ietf/track.js +48 -62
  315. package/ietf/track.js.map +1 -1
  316. package/ietf/version.d.ts +13 -42
  317. package/ietf/version.d.ts.map +1 -1
  318. package/ietf/version.js +22 -49
  319. package/ietf/version.js.map +1 -1
  320. package/implementation.d.ts +2 -0
  321. package/implementation.d.ts.map +1 -0
  322. package/implementation.js +5 -0
  323. package/implementation.js.map +1 -0
  324. package/index.d.ts +34 -19
  325. package/index.d.ts.map +1 -1
  326. package/index.js +19 -7
  327. package/index.js.map +1 -1
  328. package/internal.d.ts +1515 -67
  329. package/internal.d.ts.map +1 -1
  330. package/internal.js +557 -80
  331. package/internal.js.map +1 -1
  332. package/ledger.d.ts +23 -0
  333. package/ledger.d.ts.map +1 -0
  334. package/ledger.js +247 -0
  335. package/ledger.js.map +1 -0
  336. package/listing.d.ts +132 -0
  337. package/listing.d.ts.map +1 -0
  338. package/listing.js +486 -0
  339. package/listing.js.map +1 -0
  340. package/lite/announce.d.ts +127 -66
  341. package/lite/announce.d.ts.map +1 -1
  342. package/lite/announce.js +384 -159
  343. package/lite/announce.js.map +1 -1
  344. package/lite/announce_stream.d.ts +2 -0
  345. package/lite/announce_stream.d.ts.map +1 -0
  346. package/lite/announce_stream.js +92 -0
  347. package/lite/announce_stream.js.map +1 -0
  348. package/lite/answer.d.ts +22 -0
  349. package/lite/answer.d.ts.map +1 -0
  350. package/lite/answer.js +301 -0
  351. package/lite/answer.js.map +1 -0
  352. package/lite/auth.d.ts +45 -0
  353. package/lite/auth.d.ts.map +1 -0
  354. package/lite/auth.js +204 -0
  355. package/lite/auth.js.map +1 -0
  356. package/lite/compat.d.ts +31 -0
  357. package/lite/compat.d.ts.map +1 -0
  358. package/lite/compat.js +86 -0
  359. package/lite/compat.js.map +1 -0
  360. package/lite/connection.d.ts +1 -45
  361. package/lite/connection.d.ts.map +1 -1
  362. package/lite/connection.js +360 -78
  363. package/lite/connection.js.map +1 -1
  364. package/lite/datagram-end.d.ts +26 -0
  365. package/lite/datagram-end.d.ts.map +1 -0
  366. package/lite/datagram-end.js +30 -0
  367. package/lite/datagram-end.js.map +1 -0
  368. package/lite/datagram.d.ts +73 -8
  369. package/lite/datagram.d.ts.map +1 -1
  370. package/lite/datagram.js +144 -10
  371. package/lite/datagram.js.map +1 -1
  372. package/lite/duration.d.ts +6 -0
  373. package/lite/duration.d.ts.map +1 -0
  374. package/lite/duration.js +14 -0
  375. package/lite/duration.js.map +1 -0
  376. package/lite/error.d.ts +9 -0
  377. package/lite/error.d.ts.map +1 -0
  378. package/lite/error.js +24 -0
  379. package/lite/error.js.map +1 -0
  380. package/lite/fills.d.ts +162 -0
  381. package/lite/fills.d.ts.map +1 -0
  382. package/lite/fills.js +486 -0
  383. package/lite/fills.js.map +1 -0
  384. package/lite/fit.d.ts +49 -0
  385. package/lite/fit.d.ts.map +1 -0
  386. package/lite/fit.js +305 -0
  387. package/lite/fit.js.map +1 -0
  388. package/lite/goaway.d.ts +2 -2
  389. package/lite/goaway.d.ts.map +1 -1
  390. package/lite/goaway.js +5 -14
  391. package/lite/goaway.js.map +1 -1
  392. package/lite/group.d.ts +67 -16
  393. package/lite/group.d.ts.map +1 -1
  394. package/lite/group.js +108 -31
  395. package/lite/group.js.map +1 -1
  396. package/lite/identity.d.ts +25 -0
  397. package/lite/identity.d.ts.map +1 -0
  398. package/lite/identity.js +79 -0
  399. package/lite/identity.js.map +1 -0
  400. package/lite/index.d.ts +14 -13
  401. package/lite/index.d.ts.map +1 -1
  402. package/lite/index.js +2 -2
  403. package/lite/index.js.map +1 -1
  404. package/lite/message.d.ts +10 -2
  405. package/lite/message.d.ts.map +1 -1
  406. package/lite/message.js +28 -45
  407. package/lite/message.js.map +1 -1
  408. package/lite/priority.d.ts +9 -2
  409. package/lite/priority.d.ts.map +1 -1
  410. package/lite/priority.js +11 -106
  411. package/lite/priority.js.map +1 -1
  412. package/lite/probe.d.ts +2 -2
  413. package/lite/probe.d.ts.map +1 -1
  414. package/lite/probe.js +9 -1
  415. package/lite/probe.js.map +1 -1
  416. package/lite/publisher.d.ts +10 -1
  417. package/lite/publisher.d.ts.map +1 -1
  418. package/lite/publisher.js +2548 -438
  419. package/lite/publisher.js.map +1 -1
  420. package/lite/routed.d.ts +59 -0
  421. package/lite/routed.d.ts.map +1 -0
  422. package/lite/routed.js +564 -0
  423. package/lite/routed.js.map +1 -0
  424. package/lite/session.d.ts +2 -28
  425. package/lite/session.d.ts.map +1 -1
  426. package/lite/session.js +0 -100
  427. package/lite/session.js.map +1 -1
  428. package/lite/setup.d.ts +32 -5
  429. package/lite/setup.d.ts.map +1 -1
  430. package/lite/setup.js +95 -22
  431. package/lite/setup.js.map +1 -1
  432. package/lite/stream.d.ts +5 -11
  433. package/lite/stream.d.ts.map +1 -1
  434. package/lite/stream.js +5 -2
  435. package/lite/stream.js.map +1 -1
  436. package/lite/subscribe.d.ts +478 -78
  437. package/lite/subscribe.d.ts.map +1 -1
  438. package/lite/subscribe.js +1373 -143
  439. package/lite/subscribe.js.map +1 -1
  440. package/lite/subscriber.d.ts +7 -44
  441. package/lite/subscriber.d.ts.map +1 -1
  442. package/lite/subscriber.js +3290 -516
  443. package/lite/subscriber.js.map +1 -1
  444. package/lite/track.d.ts +27 -12
  445. package/lite/track.d.ts.map +1 -1
  446. package/lite/track.js +116 -38
  447. package/lite/track.js.map +1 -1
  448. package/lite/tracks.d.ts +55 -0
  449. package/lite/tracks.d.ts.map +1 -0
  450. package/lite/tracks.js +114 -0
  451. package/lite/tracks.js.map +1 -0
  452. package/lite/version.d.ts +132 -24
  453. package/lite/version.d.ts.map +1 -1
  454. package/lite/version.js +378 -34
  455. package/lite/version.js.map +1 -1
  456. package/meta.d.ts +77 -0
  457. package/meta.d.ts.map +1 -0
  458. package/meta.js +130 -0
  459. package/meta.js.map +1 -0
  460. package/meta_api.d.ts +7 -0
  461. package/meta_api.d.ts.map +1 -0
  462. package/meta_api.js +7 -0
  463. package/meta_api.js.map +1 -0
  464. package/mint.d.ts +28 -0
  465. package/mint.d.ts.map +1 -0
  466. package/mint.js +66 -0
  467. package/mint.js.map +1 -0
  468. package/open.d.ts +63 -0
  469. package/open.d.ts.map +1 -0
  470. package/open.js +250 -0
  471. package/open.js.map +1 -0
  472. package/origin.d.ts +394 -142
  473. package/origin.d.ts.map +1 -1
  474. package/origin.js +2533 -687
  475. package/origin.js.map +1 -1
  476. package/package.json +8 -13
  477. package/path.d.ts +51 -51
  478. package/path.d.ts.map +1 -1
  479. package/path.js +210 -58
  480. package/path.js.map +1 -1
  481. package/payload.d.ts +33 -0
  482. package/payload.d.ts.map +1 -0
  483. package/payload.js +65 -0
  484. package/payload.js.map +1 -0
  485. package/prefix.d.ts +152 -0
  486. package/prefix.d.ts.map +1 -0
  487. package/prefix.js +349 -0
  488. package/prefix.js.map +1 -0
  489. package/priority.d.ts +8 -0
  490. package/priority.d.ts.map +1 -0
  491. package/priority.js +185 -0
  492. package/priority.js.map +1 -0
  493. package/queue.d.ts +2 -0
  494. package/queue.d.ts.map +1 -0
  495. package/queue.js +46 -0
  496. package/queue.js.map +1 -0
  497. package/ranges.d.ts +36 -0
  498. package/ranges.d.ts.map +1 -0
  499. package/ranges.js +312 -0
  500. package/ranges.js.map +1 -0
  501. package/rescale.d.ts +24 -0
  502. package/rescale.d.ts.map +1 -0
  503. package/rescale.js +39 -0
  504. package/rescale.js.map +1 -0
  505. package/resume.d.ts +55 -0
  506. package/resume.d.ts.map +1 -0
  507. package/resume.js +4173 -0
  508. package/resume.js.map +1 -0
  509. package/resume.test-util.d.ts +2 -0
  510. package/resume.test-util.d.ts.map +1 -0
  511. package/resume.test-util.js +25 -0
  512. package/resume.test-util.js.map +1 -0
  513. package/skips.d.ts +48 -0
  514. package/skips.d.ts.map +1 -0
  515. package/skips.js +182 -0
  516. package/skips.js.map +1 -0
  517. package/stream.d.ts +78 -40
  518. package/stream.d.ts.map +1 -1
  519. package/stream.js +236 -93
  520. package/stream.js.map +1 -1
  521. package/subscription.test-util.d.ts +2 -0
  522. package/subscription.test-util.d.ts.map +1 -0
  523. package/subscription.test-util.js +49 -0
  524. package/subscription.test-util.js.map +1 -0
  525. package/tail.d.ts +23 -14
  526. package/tail.d.ts.map +1 -1
  527. package/tail.js +224 -98
  528. package/tail.js.map +1 -1
  529. package/time.d.ts +41 -102
  530. package/time.d.ts.map +1 -1
  531. package/time.js +129 -92
  532. package/time.js.map +1 -1
  533. package/timed.d.ts +21 -0
  534. package/timed.d.ts.map +1 -0
  535. package/timed.js +2 -0
  536. package/timed.js.map +1 -0
  537. package/track.d.ts +578 -246
  538. package/track.d.ts.map +1 -1
  539. package/track.js +7306 -772
  540. package/track.js.map +1 -1
  541. package/track_api.d.ts +7 -0
  542. package/track_api.d.ts.map +1 -0
  543. package/track_api.js +7 -0
  544. package/track_api.js.map +1 -0
  545. package/util/abort.d.ts +1 -0
  546. package/util/abort.d.ts.map +1 -1
  547. package/util/abort.js +23 -2
  548. package/util/abort.js.map +1 -1
  549. package/util/announce.d.ts +4 -0
  550. package/util/announce.d.ts.map +1 -0
  551. package/util/announce.js +11 -0
  552. package/util/announce.js.map +1 -0
  553. package/util/bigint.d.ts +3 -0
  554. package/util/bigint.d.ts.map +1 -0
  555. package/util/bigint.js +8 -0
  556. package/util/bigint.js.map +1 -0
  557. package/util/change.d.ts +12 -0
  558. package/util/change.d.ts.map +1 -0
  559. package/util/change.js +18 -0
  560. package/util/change.js.map +1 -0
  561. package/util/deadline.d.ts +2 -0
  562. package/util/deadline.d.ts.map +1 -0
  563. package/util/deadline.js +108 -0
  564. package/util/deadline.js.map +1 -0
  565. package/util/decode_error.d.ts +3 -0
  566. package/util/decode_error.d.ts.map +1 -0
  567. package/util/decode_error.js +11 -0
  568. package/util/decode_error.js.map +1 -0
  569. package/util/demand.d.ts +8 -0
  570. package/util/demand.d.ts.map +1 -0
  571. package/util/demand.js +24 -0
  572. package/util/demand.js.map +1 -0
  573. package/util/given_up.d.ts +2 -0
  574. package/util/given_up.d.ts.map +1 -0
  575. package/util/given_up.js +101 -0
  576. package/util/given_up.js.map +1 -0
  577. package/util/hex.d.ts +6 -0
  578. package/util/hex.d.ts.map +1 -1
  579. package/util/hex.js +19 -5
  580. package/util/hex.js.map +1 -1
  581. package/util/key.d.ts +15 -0
  582. package/util/key.d.ts.map +1 -0
  583. package/util/key.js +38 -0
  584. package/util/key.js.map +1 -0
  585. package/util/limits.d.ts +2 -0
  586. package/util/limits.d.ts.map +1 -0
  587. package/util/limits.js +76 -0
  588. package/util/limits.js.map +1 -0
  589. package/util/observed.d.ts +23 -0
  590. package/util/observed.d.ts.map +1 -0
  591. package/util/observed.js +122 -0
  592. package/util/observed.js.map +1 -0
  593. package/util/sorted.d.ts +2 -0
  594. package/util/sorted.d.ts.map +1 -0
  595. package/util/sorted.js +149 -0
  596. package/util/sorted.js.map +1 -0
  597. package/util/timeout.d.ts +2 -1
  598. package/util/timeout.d.ts.map +1 -1
  599. package/util/timeout.js +13 -10
  600. package/util/timeout.js.map +1 -1
  601. package/util/timer.d.ts +2 -0
  602. package/util/timer.d.ts.map +1 -0
  603. package/util/timer.js +19 -0
  604. package/util/timer.js.map +1 -0
  605. package/util/u64.js +0 -1
  606. package/util/utf8.d.ts +2 -0
  607. package/util/utf8.d.ts.map +1 -1
  608. package/util/utf8.js +7 -2
  609. package/util/utf8.js.map +1 -1
  610. package/util/varint.d.ts.map +1 -1
  611. package/util/varint.js +8 -2
  612. package/util/varint.js.map +1 -1
  613. package/util/watch.d.ts +8 -0
  614. package/util/watch.d.ts.map +1 -0
  615. package/util/watch.js +38 -0
  616. package/util/watch.js.map +1 -0
  617. package/util/yield.d.ts +2 -0
  618. package/util/yield.d.ts.map +1 -0
  619. package/util/yield.js +31 -0
  620. package/util/yield.js.map +1 -0
  621. package/varint.d.ts +0 -29
  622. package/varint.d.ts.map +1 -1
  623. package/varint.js +7 -29
  624. package/varint.js.map +1 -1
  625. package/varint_api.d.ts +7 -0
  626. package/varint_api.d.ts.map +1 -0
  627. package/varint_api.js +7 -0
  628. package/varint_api.js.map +1 -0
  629. package/version.d.ts +2 -0
  630. package/version.d.ts.map +1 -0
  631. package/version.js +4 -0
  632. package/version.js.map +1 -0
  633. package/window.d.ts +570 -0
  634. package/window.d.ts.map +1 -0
  635. package/window.js +1677 -0
  636. package/window.js.map +1 -0
  637. package/wire.d.ts +150 -35
  638. package/wire.d.ts.map +1 -1
  639. package/wire.js +27 -1
  640. package/wire.js.map +1 -1
  641. package/connection/established.d.ts +0 -53
  642. package/connection/established.d.ts.map +0 -1
  643. package/connection/established.js +0 -3
  644. package/connection/established.js.map +0 -1
  645. package/ietf/adapter.d.ts +0 -75
  646. package/ietf/adapter.d.ts.map +0 -1
  647. package/ietf/adapter.js +0 -700
  648. package/ietf/adapter.js.map +0 -1
  649. package/lite/datagram_stream.d.ts +0 -8
  650. package/lite/datagram_stream.d.ts.map +0 -1
  651. package/lite/datagram_stream.js +0 -44
  652. package/lite/datagram_stream.js.map +0 -1
  653. package/lite/fetch.d.ts +0 -28
  654. package/lite/fetch.d.ts.map +0 -1
  655. package/lite/fetch.js +0 -79
  656. package/lite/fetch.js.map +0 -1
  657. package/util/log.d.ts +0 -5
  658. package/util/log.d.ts.map +0 -1
  659. package/util/log.js +0 -17
  660. package/util/log.js.map +0 -1
  661. package/zod.d.ts +0 -13
  662. package/zod.d.ts.map +0 -1
  663. package/zod.js +0 -19
  664. 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 (and best-effort datagrams) within a broadcast.
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 { Datagram } from "./datagram";
8
- import { type Frame, type Consumer as GroupConsumer, Producer as GroupProducer } from "./group";
9
- import { Milli, Timescale, type Timestamp } from "./time";
10
- export type { Datagram } from "./datagram";
11
- /** Default {@link Info.maxAge} window (milliseconds) when the publisher does not set one. */
12
- export declare const DEFAULT_MAX_AGE_MS: Milli;
13
- /** A position within a track: a group's sequence and a frame's index inside it. */
14
- export interface Location {
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: number;
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 (via {@link Request.accept} or
24
- * {@link Producer.accept}); a consumer awaits them via {@link Subscriber.info}
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 (reported in TRACK_INFO on
30
- * Lite05+). Defaults to milliseconds; set it finer (e.g. {@link Timescale.MICRO})
31
- * for media that needs sub-millisecond timing.
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: the maximum age (milliseconds) of a non-latest group before
36
- * the publisher evicts it. Reported in TRACK_INFO (Lite05+) so relays re-serve with the
37
- * same bound. The publisher-side half of the budget a subscriber sets for itself.
38
- * Rounded up to a whole millisecond by {@link infoDefaults}, which refuses a negative
39
- * or non-finite value and a result past `Number.MAX_SAFE_INTEGER`.
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: Milli;
42
- /** Tie-break priority between subscriptions of equal subscriber priority (`0..=255`, higher first). Defaults to `127`. */
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
- /** Fill in any unset {@link Info} fields with their defaults. */
46
- export declare function infoDefaults(info?: Partial<Info>): Info;
47
- /** An explicitly included or excluded group sequence. */
48
- export type Bound = {
49
- included: number;
50
- excluded?: never;
51
- } | {
52
- excluded: number;
53
- included?: never;
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
- /** Group limits; an omitted endpoint is unbounded. */
56
- export interface Groups {
57
- /** The first group boundary. */
58
- start?: Bound;
59
- /** The last group boundary. */
60
- end?: Bound;
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 lowest group the publisher may deliver (a floor), or omit for none.
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 floor, not a request: only {@link maxAge} asks for data, and the floor bounds how
80
- * far back it may reach. Omitting it and a floor of 0 mean the same thing, and a floor
81
- * above the live edge simply waits there (a resumed subscription naming where it left
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
- groups?: Groups;
266
+ ranges?: Range[];
85
267
  }
86
268
  /**
87
- * A request for a track the peer wants, delivered to the publishing wire layer.
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
- * Created internally by the broadcast when a subscription (or info lookup) needs a track
90
- * served; answer it with {@link accept} or {@link reject}.
91
- *
92
- * @public
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 declare class Request {
95
- #private;
96
- /** The requested track name. */
97
- readonly name: string;
98
- private constructor();
99
- /** The aggregate subscription requested for this track. */
100
- get subscription(): Readonly<Subscription>;
101
- /** The subscriber's priority for this track. */
102
- get priority(): number;
103
- /** Accept the request, committing the track's immutable {@link Info}. */
104
- accept(info?: Partial<Info>): Producer;
105
- /** Reject the request, closing the track optionally with an error. */
106
- reject(err?: Error): void;
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
- * The cursor starts at the group the subscription named (its floor), or 0.
134
- * {@link Subscription.maxAge} is what asks for data: delivery skips everything above
135
- * the floor that the budget convicts, so the default budget of zero delivers only the
136
- * latest group and a larger one reaches back over what it can still use.
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
- /** Fetch the track's immutable publisher properties without subscribing. */
140
- info(): Promise<Info>;
141
- /** Fetch a single group by sequence without holding a live subscription. */
142
- fetchGroup(sequence: number, options?: FetchGroupOptions): Promise<GroupConsumer>;
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
- * track's `maxAge` window so a late subscriber replays the recent groups.
383
+ * idle cache window so a late subscriber can replay groups within its media budget.
152
384
  *
153
- * Obtained from {@link Request.accept} (the wire asks the application for a track to
154
- * serve) or constructed directly for an in-process track.
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
- constructor(name: string);
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 before {@link accept}.
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 closes: `null` on a clean close, or the abort {@link Error}.
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
- * Its cursor starts at the group the subscription named (its floor), or 0.
189
- * {@link Subscription.maxAge} is what asks for data: delivery skips everything above
190
- * the floor that the budget convicts, so the default budget of zero delivers only the
191
- * latest group and a larger one reaches back over what it can still use.
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
- * Whether the track currently has any subscribers.
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
- * Watch it (`effect.get` / `.peek()`) to drive on-demand work: a publisher can start and stop
198
- * capture with demand, and the consumer wire watches it to tear an idle upstream subscription
199
- * down instead of downloading to nobody. Pairs with {@link unused}. Mirrors the Rust `Demand`.
200
- */
201
- get used(): Getter<boolean>;
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
- * Throws on a sequence that is still cached: a live duplicate would fan out to every
210
- * subscriber twice. An aborted incarnation is evicted so a fresh group can serve the
211
- * sequence again. Best effort (mirrors Rust): nothing remembers a sequence whose cache
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
- writeGroup(group: GroupProducer): void;
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
- * Append a datagram with the next sequence number, returning the assigned sequence.
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
- * A datagram is delivered best-effort over a single QUIC datagram, parallel to the track's
219
- * groups but drawing from the same sequence namespace (interleaving with {@link appendGroup}
220
- * never reuses a number). The payload must fit the negotiated transport datagram size minus
221
- * a small header; an oversize payload is dropped at each hop (there is no group fallback), so
222
- * keep datagram payloads small (e.g. a single audio frame). Datagrams are never delivered
223
- * over IETF moq-transport or stream-only transports (the WebSocket fallback). A payload over
224
- * 65535 bytes (the QUIC datagram frame ceiling) throws. An origin publisher uses this; a
225
- * relay preserving upstream numbering uses {@link insertDatagram}.
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
- appendDatagram(timestamp: Timestamp, payload: Uint8Array): number;
480
+ appendGroup(frame: Frame): GroupProducer;
228
481
  /**
229
- * Insert a datagram with an explicit sequence number.
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
- insertDatagram(sequence: number, timestamp: Timestamp, payload: Uint8Array): void;
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
- * `final` is the first sequence that will never be produced, so a track whose last group
241
- * is 89 finishes at 90. Groups and datagrams below it are still accepted; anything at or
242
- * above it is refused. Unlike {@link close} it is not terminal: call `close()` once the
243
- * remaining groups are written. Throws if the track is closed, already has an end, or
244
- * `final` is at or below a sequence already produced.
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(final: number): void;
500
+ finishAt(end: Position): void;
247
501
  /**
248
- * Close the track and every subscriber, mirroring the abort to their groups. Idempotent.
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
- * A clean close keeps the end {@link finishAt} declared, or declares one past the highest
251
- * sequence produced; an abort ends without one. Subscribers still draining get the
252
- * finished groups first, then the end or the abort. An abort after the declared end
253
- * settled (reached, with every group below it finished) is a clean close. The groups
254
- * left behind still age out after the track's `maxAge`, so a stale subscriber can't pin
255
- * them.
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
- /** Appends a string to the track as its own single-frame group. */
261
- writeString(str: string): void;
262
- /** Appends a JSON value to the track as its own single-frame group. */
263
- writeJson(json: unknown): void;
264
- /** Appends a boolean to the track as its own single-frame group. */
265
- writeBool(bool: boolean): void;
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 TRACK_INFO it received (lite-05+) or
283
- * defaults (older drafts), so awaiting it never yields a placeholder. Rejects if
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 final boundary once it is known, mirroring the Rust
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<number>;
590
+ finished(): Promise<Position>;
310
591
  /**
311
- * The newest frame this track has produced, or `undefined` while it has none.
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
- * Read from the groups buffered for this subscriber, so nothing is consumed. A newest
314
- * group that has no frames yet falls back to the newest older group that does. It
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
- largest(): Location | undefined;
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
- * Limit subsequent reads without rewinding read progress or changing the wire request.
323
- * An omitted start preserves the current floor; an omitted end removes the cap.
324
- * Raising the end makes unread buffered groups available again.
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
- setGroups(groups: Groups): void;
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, the lowest sequence is
335
- * returned first.
336
- *
337
- * Honors the range set by {@link setGroups}: a group
338
- * beyond the cap stays buffered (not dropped) and is offered once the cap rises, even
339
- * after a clean close, without blocking in-range groups that arrive behind it.
340
- * A group whose presentation time is further behind the live edge than this
341
- * subscriber's `maxAge` is skipped. The default of zero takes the live edge.
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} and {@link recvDatagram} throw afterwards. Throws once a
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
- * Update this subscription's options (e.g. priority), triggering a SUBSCRIBE_UPDATE to the
382
- * publisher. Mirrors the Rust `Subscriber::update`.
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 sequence than the last, so a late arrival is
392
- * skipped rather than delivered out of turn.
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
- * `maxAge` applies as this cursor reads, exactly as it does on the arrival cursor: a
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 latest group sequence observed on this track, if any. */
414
- latest(): number | undefined;
415
- /** The track's exclusive final boundary; see {@link Subscriber.final}. */
416
- final(): number | undefined;
417
- /** Resolve with the track's exclusive final boundary once known; see {@link Subscriber.finished}. */
418
- finished(): Promise<number>;
419
- /** Limit subsequent reads to these groups and return this reader for chaining. */
420
- withGroups(groups: Groups): this;
421
- /** Limit subsequent reads to these groups; see {@link Subscriber.setGroups}. */
422
- setGroups(groups: Groups): void;
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 (sequence at or below the last returned) are silently skipped, as is a
431
- * group whose every frame is further behind the live edge than `maxAge` (the default of
432
- * zero keeps only what nothing newer has superseded). Honors the bounds set by
433
- * {@link setGroups}.
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 `maxAge` proves it useless.
441
- * Treat the returned frame bytes as read-only; they are shared with other consumers.
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: number;
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