@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
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resume.test-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.test-util.d.ts","sourceRoot":"","sources":["../src/resume.test-util.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { defined } from "./defined.test-util.js";
2
+ import { hooks } from "./internal.js";
3
+ import { Timestamp } from "./time.js";
4
+ let probes = 0;
5
+ /** Whether `active` reads its tracks from `source` now: a group cached there arrives through it. @internal */
6
+ export function readsFrom(active, source) {
7
+ if (!active)
8
+ return false;
9
+ const name = `probe-${probes++}`;
10
+ const track = defined(source.createTrack(name));
11
+ const group = hooks.appendNext(track);
12
+ group.writeFrame({ payload: new Uint8Array([1]), timestamp: Timestamp.unscaled(group.start) });
13
+ group.finish();
14
+ const sub = active.track(name).subscribe();
15
+ try {
16
+ return sub.tryRecvGroup() !== undefined;
17
+ }
18
+ finally {
19
+ sub.close();
20
+ track.finish();
21
+ track.close();
22
+ source.removeTrack(name);
23
+ }
24
+ }
25
+ //# sourceMappingURL=resume.test-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.test-util.js","sourceRoot":"","sources":["../src/resume.test-util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,8GAA8G;AAC9G,MAAM,UAAU,SAAS,CAAC,MAAqC,EAAE,MAAyB;IACzF,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,IAAI,GAAG,SAAS,MAAM,EAAE,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/F,KAAK,CAAC,MAAM,EAAE,CAAC;IACf,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3C,IAAI,CAAC;QACJ,OAAO,GAAG,CAAC,YAAY,EAAE,KAAK,SAAS,CAAC;IACzC,CAAC;YAAS,CAAC;QACV,GAAG,CAAC,KAAK,EAAE,CAAC;QACZ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["import type { Consumer as BroadcastConsumer, Producer as BroadcastProducer } from \"./broadcast\";\nimport { defined } from \"./defined.test-util.ts\";\nimport { hooks } from \"./internal.ts\";\nimport { Timestamp } from \"./time.ts\";\n\nlet probes = 0;\n\n/** Whether `active` reads its tracks from `source` now: a group cached there arrives through it. @internal */\nexport function readsFrom(active: BroadcastConsumer | undefined, source: BroadcastProducer): boolean {\n\tif (!active) return false;\n\tconst name = `probe-${probes++}`;\n\tconst track = defined(source.createTrack(name));\n\tconst group = hooks.appendNext(track);\n\tgroup.writeFrame({ payload: new Uint8Array([1]), timestamp: Timestamp.unscaled(group.start) });\n\tgroup.finish();\n\tconst sub = active.track(name).subscribe();\n\ttry {\n\t\treturn sub.tryRecvGroup() !== undefined;\n\t} finally {\n\t\tsub.close();\n\t\ttrack.finish();\n\t\ttrack.close();\n\t\tsource.removeTrack(name);\n\t}\n}\n"]}
package/skips.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The skips a front's route copies declared, kept for its logical track. Mirrors the Rust
3
+ * `model::skips`.
4
+ *
5
+ * Every route copy of a front shares one identity, so a skip ("never produced") any copy declared
6
+ * is a fact of the logical track itself: no route will deliver that group. A reader keeps each skip
7
+ * a copy declared here before it stops holding that copy, so neither a route switch nor a reader
8
+ * joining later turns one into a group nobody accounts for.
9
+ *
10
+ * JS caches have no byte budget (see `cache.ts`), so where the Rust record pays pool debt, this one
11
+ * forgets a run once it outlived the pool's idle window, as a track's drop set does. A run forgotten
12
+ * is unknown again, never absent, so a reader that reaches it asks upstream.
13
+ *
14
+ * Package-internal: not exported from the entrypoint.
15
+ *
16
+ * @module
17
+ */
18
+ import { type Duration } from "@moq/clock";
19
+ import { Signal } from "@moq/signals";
20
+ import type { Run } from "./internal.ts";
21
+ /** The skips any route copy of one logical track declared. Shared by the route and every reader. */
22
+ export declare class Skips {
23
+ #private;
24
+ /** Bumped as runs are added, waking readers parked on them. */
25
+ readonly changed: Signal<number>;
26
+ constructor(expiry?: Duration);
27
+ /**
28
+ * Keep `runs` as declared skipped. Only what is new is written, so harvesting a copy again wakes
29
+ * nobody. One pass over the kept and the given runs, so a harvest costs their sum.
30
+ */
31
+ learn(runs: readonly Run[]): void;
32
+ /** The exclusive end of the skipped run holding `key`, if one does. */
33
+ holeEnd(key: bigint): bigint | undefined;
34
+ /** The parts of `[start, end)` declared skipped. */
35
+ skippedIn(start: bigint, end: bigint): Run[];
36
+ /** How many keys just below `key` were declared skipped. */
37
+ skippedBelow(key: bigint): bigint;
38
+ /** The current revision, for {@link since}. */
39
+ get revision(): number;
40
+ /**
41
+ * The runs of `[start, end)` changed after revision `seen`: every one when `all`. Forgets the runs
42
+ * past the idle window first, since every read polls this.
43
+ */
44
+ since(seen: number, all: boolean, start: bigint, end: bigint): Run[];
45
+ /** The first part of `run` still declared skipped: a run forgotten since is unknown again. */
46
+ held(run: Run): Run | undefined;
47
+ }
48
+ //# sourceMappingURL=skips.d.ts.map
package/skips.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skips.d.ts","sourceRoot":"","sources":["../src/skips.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAUzC,oGAAoG;AACpG,qBAAa,KAAK;;IAOjB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,iBAAiB;IAEjC,YAAY,MAAM,GAAE,QAAyB,EAE5C;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,IAAI,CAkDhC;IAqBD,uEAAuE;IACvE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvC;IAED,oDAAoD;IACpD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CAE3C;IAED,4DAA4D;IAC5D,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhC;IAED,+CAA+C;IAC/C,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CASnE;IAED,8FAA8F;IAC9F,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAI9B;CACD"}
package/skips.js ADDED
@@ -0,0 +1,182 @@
1
+ /**
2
+ * The skips a front's route copies declared, kept for its logical track. Mirrors the Rust
3
+ * `model::skips`.
4
+ *
5
+ * Every route copy of a front shares one identity, so a skip ("never produced") any copy declared
6
+ * is a fact of the logical track itself: no route will deliver that group. A reader keeps each skip
7
+ * a copy declared here before it stops holding that copy, so neither a route switch nor a reader
8
+ * joining later turns one into a group nobody accounts for.
9
+ *
10
+ * JS caches have no byte budget (see `cache.ts`), so where the Rust record pays pool debt, this one
11
+ * forgets a run once it outlived the pool's idle window, as a track's drop set does. A run forgotten
12
+ * is unknown again, never absent, so a reader that reaches it asks upstream.
13
+ *
14
+ * Package-internal: not exported from the entrypoint.
15
+ *
16
+ * @module
17
+ */
18
+ import { Instant, now } from "@moq/clock";
19
+ import { Signal } from "@moq/signals";
20
+ import { DEFAULT_EXPIRY } from "./cache.js";
21
+ import { max, min } from "./util/key.js";
22
+ /** The skips any route copy of one logical track declared. Shared by the route and every reader. */
23
+ export class Skips {
24
+ // Sorted, disjoint, never adjacent.
25
+ #runs = [];
26
+ #revision = 0;
27
+ // The earliest run's deadline, so a check that nothing is due costs no walk.
28
+ #oldest;
29
+ #expiry;
30
+ /** Bumped as runs are added, waking readers parked on them. */
31
+ changed = new Signal(0);
32
+ constructor(expiry = DEFAULT_EXPIRY) {
33
+ this.#expiry = expiry;
34
+ }
35
+ /**
36
+ * Keep `runs` as declared skipped. Only what is new is written, so harvesting a copy again wakes
37
+ * nobody. One pass over the kept and the given runs, so a harvest costs their sum.
38
+ */
39
+ learn(runs) {
40
+ const at = nanos(now());
41
+ this.#forget(at);
42
+ const expires = this.#deadline(at);
43
+ const given = runs.filter((run) => run.start < run.end).sort((x, y) => (x.start < y.start ? -1 : 1));
44
+ const kept = this.#runs;
45
+ const out = [];
46
+ let learned = false;
47
+ // The coalesced run being built, and the kept runs it took in.
48
+ let start = 0n;
49
+ let end = 0n;
50
+ let from = [];
51
+ let open = false;
52
+ const flush = () => {
53
+ if (!open)
54
+ return;
55
+ const [only] = from;
56
+ // Unchanged when it is one kept run as it was; anything it merged takes a new deadline and
57
+ // revision, so a reader folds the whole run in again.
58
+ if (from.length === 1 && only && only.start === start && only.end === end) {
59
+ out.push(only);
60
+ }
61
+ else {
62
+ out.push({ start, end, expires, revision: ++this.#revision });
63
+ learned = true;
64
+ }
65
+ };
66
+ let i = 0;
67
+ let j = 0;
68
+ while (i < kept.length || j < given.length) {
69
+ const old = kept[i];
70
+ const run = given[j];
71
+ const next = old && (!run || old.start <= run.start) ? old : run;
72
+ if (next === old)
73
+ i++;
74
+ else
75
+ j++;
76
+ if (open && next.start <= end) {
77
+ end = max(end, next.end);
78
+ }
79
+ else {
80
+ flush();
81
+ start = next.start;
82
+ end = next.end;
83
+ from = [];
84
+ open = true;
85
+ }
86
+ if (next === old)
87
+ from.push(old);
88
+ }
89
+ flush();
90
+ this.#runs = out;
91
+ if (learned) {
92
+ this.#oldest = Math.min(this.#oldest ?? expires, expires);
93
+ this.changed.update((n) => n + 1);
94
+ }
95
+ }
96
+ // When a run learned at `at` is forgotten: rounded up to a quarter of the idle window, so runs
97
+ // learned together expire together and a run outlives the window after it was learned. Mirrors
98
+ // a track's drop set (`track.ts` `#setDrops`).
99
+ #deadline(at) {
100
+ const window = this.#expiry.asNanos();
101
+ const quarter = Math.max(1, Math.floor(window / 4));
102
+ return (Math.floor(at / quarter) + 1) * quarter + window;
103
+ }
104
+ // Forget the runs past their deadline, walking them only once the earliest is due, which a quarter
105
+ // of the window separates from the next: staggered harvests cost one walk per quarter, not one
106
+ // per run.
107
+ #forget(at) {
108
+ if (this.#oldest === undefined || at < this.#oldest)
109
+ return;
110
+ this.#runs = this.#runs.filter((run) => at < run.expires);
111
+ this.#oldest = undefined;
112
+ for (const run of this.#runs)
113
+ this.#oldest = Math.min(this.#oldest ?? run.expires, run.expires);
114
+ }
115
+ /** The exclusive end of the skipped run holding `key`, if one does. */
116
+ holeEnd(key) {
117
+ const run = this.#runs[first(this.#runs, key)];
118
+ return run && run.start <= key ? run.end : undefined;
119
+ }
120
+ /** The parts of `[start, end)` declared skipped. */
121
+ skippedIn(start, end) {
122
+ return clip(this.#runs, start, end);
123
+ }
124
+ /** How many keys just below `key` were declared skipped. */
125
+ skippedBelow(key) {
126
+ if (key === 0n)
127
+ return 0n;
128
+ const run = this.#runs[first(this.#runs, key - 1n)];
129
+ return run && run.end === key ? key - run.start : 0n;
130
+ }
131
+ /** The current revision, for {@link since}. */
132
+ get revision() {
133
+ return this.#revision;
134
+ }
135
+ /**
136
+ * The runs of `[start, end)` changed after revision `seen`: every one when `all`. Forgets the runs
137
+ * past the idle window first, since every read polls this.
138
+ */
139
+ since(seen, all, start, end) {
140
+ this.#forget(nanos(now()));
141
+ if (all)
142
+ return clip(this.#runs, start, end);
143
+ if (seen >= this.#revision)
144
+ return [];
145
+ return clip(this.#runs.filter((run) => run.revision > seen), start, end);
146
+ }
147
+ /** The first part of `run` still declared skipped: a run forgotten since is unknown again. */
148
+ held(run) {
149
+ const kept = this.#runs[first(this.#runs, run.start)];
150
+ if (!kept || kept.start >= run.end)
151
+ return undefined;
152
+ return { start: max(kept.start, run.start), end: min(kept.end, run.end) };
153
+ }
154
+ }
155
+ function nanos(at) {
156
+ return at.since(Instant.ZERO).asNanos();
157
+ }
158
+ /** The index of the first of the sorted, disjoint `runs` ending past `key`. */
159
+ function first(runs, key) {
160
+ let lo = 0;
161
+ let hi = runs.length;
162
+ while (lo < hi) {
163
+ const mid = (lo + hi) >>> 1;
164
+ if (runs[mid].end <= key)
165
+ lo = mid + 1;
166
+ else
167
+ hi = mid;
168
+ }
169
+ return lo;
170
+ }
171
+ /** The parts of `runs` within `[start, end)`. */
172
+ function clip(runs, start, end) {
173
+ const found = [];
174
+ for (let i = first(runs, start); i < runs.length; i++) {
175
+ const run = runs[i];
176
+ if (run.start >= end)
177
+ break;
178
+ found.push({ start: max(run.start, start), end: min(run.end, end) });
179
+ }
180
+ return found;
181
+ }
182
+ //# sourceMappingURL=skips.js.map
package/skips.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skips.js","sourceRoot":"","sources":["../src/skips.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAiB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CAAC;QAChB,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAK,IAAI,CAAC,GAAG,CAAS,CAAC,GAAG,IAAI,GAAG;YAAE,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;;YAC3C,EAAE,GAAG,GAAG,CAAC;IACf,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC;AAED,iDAAiD;AACjD,SAAS,IAAI,CAAC,IAAoB,EAAE,KAAa,EAAE,GAAW;IAC7D,MAAM,KAAK,GAAU,EAAE,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAQ,CAAC;QAC3B,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG;YAAE,MAAM;QAC5B,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/**\n * The skips a front's route copies declared, kept for its logical track. Mirrors the Rust\n * `model::skips`.\n *\n * Every route copy of a front shares one identity, so a skip (\"never produced\") any copy declared\n * is a fact of the logical track itself: no route will deliver that group. A reader keeps each skip\n * a copy declared here before it stops holding that copy, so neither a route switch nor a reader\n * joining later turns one into a group nobody accounts for.\n *\n * JS caches have no byte budget (see `cache.ts`), so where the Rust record pays pool debt, this one\n * forgets a run once it outlived the pool's idle window, as a track's drop set does. A run forgotten\n * is unknown again, never absent, so a reader that reaches it asks upstream.\n *\n * Package-internal: not exported from the entrypoint.\n *\n * @module\n */\nimport { type Duration, Instant, now } from \"@moq/clock\";\nimport { Signal } from \"@moq/signals\";\nimport { DEFAULT_EXPIRY } from \"./cache.ts\";\nimport type { Run } from \"./internal.ts\";\nimport { max, min } from \"./util/key.ts\";\n\n/** A run of keys declared skipped, when it is forgotten, and the revision it changed at. */\ninterface Kept extends Run {\n\t// Nanoseconds since the clock's origin, rounded up to a quarter of the idle window.\n\texpires: number;\n\trevision: number;\n}\n\n/** The skips any route copy of one logical track declared. Shared by the route and every reader. */\nexport class Skips {\n\t// Sorted, disjoint, never adjacent.\n\t#runs: Kept[] = [];\n\t#revision = 0;\n\t// The earliest run's deadline, so a check that nothing is due costs no walk.\n\t#oldest?: number;\n\treadonly #expiry: Duration;\n\t/** Bumped as runs are added, waking readers parked on them. */\n\treadonly changed = new Signal(0);\n\n\tconstructor(expiry: Duration = DEFAULT_EXPIRY) {\n\t\tthis.#expiry = expiry;\n\t}\n\n\t/**\n\t * Keep `runs` as declared skipped. Only what is new is written, so harvesting a copy again wakes\n\t * nobody. One pass over the kept and the given runs, so a harvest costs their sum.\n\t */\n\tlearn(runs: readonly Run[]): void {\n\t\tconst at = nanos(now());\n\t\tthis.#forget(at);\n\t\tconst expires = this.#deadline(at);\n\t\tconst given = runs.filter((run) => run.start < run.end).sort((x, y) => (x.start < y.start ? -1 : 1));\n\t\tconst kept = this.#runs;\n\t\tconst out: Kept[] = [];\n\t\tlet learned = false;\n\t\t// The coalesced run being built, and the kept runs it took in.\n\t\tlet start = 0n;\n\t\tlet end = 0n;\n\t\tlet from: Kept[] = [];\n\t\tlet open = false;\n\t\tconst flush = () => {\n\t\t\tif (!open) return;\n\t\t\tconst [only] = from;\n\t\t\t// Unchanged when it is one kept run as it was; anything it merged takes a new deadline and\n\t\t\t// revision, so a reader folds the whole run in again.\n\t\t\tif (from.length === 1 && only && only.start === start && only.end === end) {\n\t\t\t\tout.push(only);\n\t\t\t} else {\n\t\t\t\tout.push({ start, end, expires, revision: ++this.#revision });\n\t\t\t\tlearned = true;\n\t\t\t}\n\t\t};\n\t\tlet i = 0;\n\t\tlet j = 0;\n\t\twhile (i < kept.length || j < given.length) {\n\t\t\tconst old = kept[i];\n\t\t\tconst run = given[j];\n\t\t\tconst next = old && (!run || old.start <= run.start) ? old : (run as Run);\n\t\t\tif (next === old) i++;\n\t\t\telse j++;\n\t\t\tif (open && next.start <= end) {\n\t\t\t\tend = max(end, next.end);\n\t\t\t} else {\n\t\t\t\tflush();\n\t\t\t\tstart = next.start;\n\t\t\t\tend = next.end;\n\t\t\t\tfrom = [];\n\t\t\t\topen = true;\n\t\t\t}\n\t\t\tif (next === old) from.push(old);\n\t\t}\n\t\tflush();\n\t\tthis.#runs = out;\n\t\tif (learned) {\n\t\t\tthis.#oldest = Math.min(this.#oldest ?? expires, expires);\n\t\t\tthis.changed.update((n) => n + 1);\n\t\t}\n\t}\n\n\t// When a run learned at `at` is forgotten: rounded up to a quarter of the idle window, so runs\n\t// learned together expire together and a run outlives the window after it was learned. Mirrors\n\t// a track's drop set (`track.ts` `#setDrops`).\n\t#deadline(at: number): number {\n\t\tconst window = this.#expiry.asNanos();\n\t\tconst quarter = Math.max(1, Math.floor(window / 4));\n\t\treturn (Math.floor(at / quarter) + 1) * quarter + window;\n\t}\n\n\t// Forget the runs past their deadline, walking them only once the earliest is due, which a quarter\n\t// of the window separates from the next: staggered harvests cost one walk per quarter, not one\n\t// per run.\n\t#forget(at: number): void {\n\t\tif (this.#oldest === undefined || at < this.#oldest) return;\n\t\tthis.#runs = this.#runs.filter((run) => at < run.expires);\n\t\tthis.#oldest = undefined;\n\t\tfor (const run of this.#runs) this.#oldest = Math.min(this.#oldest ?? run.expires, run.expires);\n\t}\n\n\t/** The exclusive end of the skipped run holding `key`, if one does. */\n\tholeEnd(key: bigint): bigint | undefined {\n\t\tconst run = this.#runs[first(this.#runs, key)];\n\t\treturn run && run.start <= key ? run.end : undefined;\n\t}\n\n\t/** The parts of `[start, end)` declared skipped. */\n\tskippedIn(start: bigint, end: bigint): Run[] {\n\t\treturn clip(this.#runs, start, end);\n\t}\n\n\t/** How many keys just below `key` were declared skipped. */\n\tskippedBelow(key: bigint): bigint {\n\t\tif (key === 0n) return 0n;\n\t\tconst run = this.#runs[first(this.#runs, key - 1n)];\n\t\treturn run && run.end === key ? key - run.start : 0n;\n\t}\n\n\t/** The current revision, for {@link since}. */\n\tget revision(): number {\n\t\treturn this.#revision;\n\t}\n\n\t/**\n\t * The runs of `[start, end)` changed after revision `seen`: every one when `all`. Forgets the runs\n\t * past the idle window first, since every read polls this.\n\t */\n\tsince(seen: number, all: boolean, start: bigint, end: bigint): Run[] {\n\t\tthis.#forget(nanos(now()));\n\t\tif (all) return clip(this.#runs, start, end);\n\t\tif (seen >= this.#revision) return [];\n\t\treturn clip(\n\t\t\tthis.#runs.filter((run) => run.revision > seen),\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/** The first part of `run` still declared skipped: a run forgotten since is unknown again. */\n\theld(run: Run): Run | undefined {\n\t\tconst kept = this.#runs[first(this.#runs, run.start)];\n\t\tif (!kept || kept.start >= run.end) return undefined;\n\t\treturn { start: max(kept.start, run.start), end: min(kept.end, run.end) };\n\t}\n}\n\nfunction nanos(at: Instant): number {\n\treturn at.since(Instant.ZERO).asNanos();\n}\n\n/** The index of the first of the sorted, disjoint `runs` ending past `key`. */\nfunction first(runs: readonly Run[], key: bigint): number {\n\tlet lo = 0;\n\tlet hi = runs.length;\n\twhile (lo < hi) {\n\t\tconst mid = (lo + hi) >>> 1;\n\t\tif ((runs[mid] as Run).end <= key) lo = mid + 1;\n\t\telse hi = mid;\n\t}\n\treturn lo;\n}\n\n/** The parts of `runs` within `[start, end)`. */\nfunction clip(runs: readonly Run[], start: bigint, end: bigint): Run[] {\n\tconst found: Run[] = [];\n\tfor (let i = first(runs, start); i < runs.length; i++) {\n\t\tconst run = runs[i] as Run;\n\t\tif (run.start >= end) break;\n\t\tfound.push({ start: max(run.start, start), end: min(run.end, end) });\n\t}\n\treturn found;\n}\n"]}
package/stream.d.ts CHANGED
@@ -1,16 +1,9 @@
1
- import type { IetfVersion } from "./ietf/version";
2
- import { type Version as LiteVersion } from "./lite/version";
3
- import { U64 } from "./util/u64";
4
- /**
5
- * Options handed to the transport for one outgoing stream.
6
- *
7
- * `waitUntilAvailable` waits for the peer's concurrent stream limit to free a slot instead
8
- * of rejecting with a `QuotaExceededError`, which is what we want for the streams a session
9
- * opens occasionally. `@types/web` doesn't declare it yet, hence the intersection.
10
- */
11
- export declare function sendOptions(options?: OpenOptions): WebTransportSendStreamOptions & {
12
- waitUntilAvailable?: boolean;
13
- };
1
+ import { type Instant } from "@moq/clock";
2
+ import { StreamCode } from "./error.ts";
3
+ import type { IetfVersion } from "./ietf/version.ts";
4
+ import { type Version as LiteVersion } from "./lite/version.ts";
5
+ import { type OpenStream, type Rank } from "./open.ts";
6
+ import { U64 } from "./util/u64.ts";
14
7
  /**
15
8
  * The version a stream's bytes follow: a moq-transport draft or a moq-lite draft. Required on
16
9
  * every stream so the varint form never defaults silently; a stream opened before negotiation
@@ -19,6 +12,11 @@ export declare function sendOptions(options?: OpenOptions): WebTransportSendStre
19
12
  export type StreamVersion = IetfVersion | LiteVersion;
20
13
  /** The moq-transport draft a stream follows, or undefined on moq-lite, whose stream codes are the same on every draft. */
21
14
  export declare function asIetf(version: StreamVersion): IetfVersion | undefined;
15
+ /**
16
+ * Whether `version` writes leading-ones varints, which carry the full u64; older versions use QUIC's, which stop at 2^62-1.
17
+ * Every draft newer than these counts leading ones, so a new version falls forward.
18
+ */
19
+ export declare function isLeadingOnes(version: StreamVersion): boolean;
22
20
  /** Encode one varint in the form `version` uses, for a body written outside a {@link Writer}. */
23
21
  export declare function encodeVarint(v: number | bigint, version: StreamVersion): Uint8Array;
24
22
  /** The parts joined into one buffer, so they can go out in one write. */
@@ -41,31 +39,23 @@ export interface OpenOptions {
41
39
  /** The negotiated version, which selects the varint encoding. */
42
40
  version: StreamVersion;
43
41
  /**
44
- * The transport send order, where HIGHER values are transmitted first.
45
- * Left to the transport's default when unset.
42
+ * The transport send order, where HIGHER values are transmitted first: also where the open
43
+ * waits for the peer's stream credit, ahead of every lower one. Defaults to 0, the
44
+ * transport's default.
46
45
  */
47
46
  sendOrder?: number;
48
- /**
49
- * Reject if the peer hasn't freed a stream slot within this many milliseconds. Defaults
50
- * to 10s. There is no way to wait indefinitely: a peer can advertise a stream limit of
51
- * zero and never raise it, so every open needs a way out.
52
- */
53
- timeout?: number;
54
- /**
55
- * Ask the transport to wait for a stream slot rather than failing when the peer's
56
- * concurrent stream limit is exhausted. Defaults to true.
57
- *
58
- * Set it false on a path that opens streams faster than the peer can retire them. The
59
- * transport queues the opens it can't satisfy and serves them in order, with no way to
60
- * cancel one, so waiting there spends returning credit on whatever was requested first
61
- * rather than on what matters now.
62
- */
63
- waitUntilAvailable?: boolean;
64
47
  }
65
48
  /** Options for {@link Writer.tryOpen}. */
66
- export interface TryOpenOptions extends OpenOptions {
49
+ export interface TryOpenOptions extends Omit<OpenOptions, "sendOrder"> {
50
+ /**
51
+ * The send order, as {@link OpenOptions.sendOrder}, or a function read again whenever the
52
+ * line hands out a stream, for a rank that moves while the open waits.
53
+ */
54
+ sendOrder?: Rank;
67
55
  /** Give up once this resolves. */
68
56
  cancel: Promise<void>;
57
+ /** List the stream among the session's open group streams until it is closed or reset. */
58
+ group?: boolean;
69
59
  }
70
60
  export declare class Stream {
71
61
  reader: Reader;
@@ -88,7 +78,16 @@ export declare class Stream {
88
78
  * @param options - The version its varints encode with, and the send order ranking it
89
79
  * against the session's other streams
90
80
  */
81
+ /** Open a stream, waiting its turn for the peer's stream credit. */
91
82
  static open(quic: WebTransport, options: OpenOptions): Promise<Stream>;
83
+ /**
84
+ * Like {@link Stream.open}, but leaves the line once `signal` aborts, returning undefined so
85
+ * the caller can drop its request. The stream its create admits later goes to the next open
86
+ * in line. A transport failure still throws.
87
+ */
88
+ static tryOpen(quic: WebTransport, options: OpenOptions & {
89
+ signal: AbortSignal;
90
+ }): Promise<Stream | undefined>;
92
91
  close(): void;
93
92
  abort(reason: Error): void;
94
93
  }
@@ -97,6 +96,8 @@ export declare class Reader {
97
96
  version: StreamVersion;
98
97
  constructor(stream: ReadableStream<Uint8Array>, buffer: Uint8Array | undefined, version: StreamVersion);
99
98
  constructor(stream: undefined, buffer: Uint8Array, version: StreamVersion);
99
+ /** When the stream last delivered bytes, which tells a watcher a quiet stream from one still arriving. */
100
+ get last(): Instant;
100
101
  /**
101
102
  * Run a synchronous decode over the buffered bytes and consume what it read.
102
103
  *
@@ -104,11 +105,20 @@ export declare class Reader {
104
105
  * caller can drain every complete message already here without waiting on the stream.
105
106
  */
106
107
  tryDecode<T extends NonNullable<unknown>>(decode: (c: Cursor) => T): T | undefined;
108
+ /** Like {@link tryDecode}, but consumes nothing: a look at what is buffered. */
109
+ tryPeek<T extends NonNullable<unknown>>(decode: (c: Cursor) => T): T | undefined;
107
110
  /** Run a synchronous decode, filling from the stream until it has the bytes it needs. */
108
111
  decode<T>(decode: (c: Cursor) => T): Promise<T>;
112
+ /** Like {@link decode}, but leaves the bytes buffered for the next read. */
113
+ peek<T>(decode: (c: Cursor) => T): Promise<T>;
109
114
  /** Like {@link decode}, but returns undefined if the stream ends cleanly first. */
110
115
  decodeMaybe<T>(decode: (c: Cursor) => T): Promise<T | undefined>;
111
116
  read(size: number): Promise<Uint8Array>;
117
+ /**
118
+ * Read between 1 and `max` bytes as they arrive, without joining them into one buffer, so
119
+ * a payload of any size streams through. Throws {@link UnexpectedEnd} at a clean end.
120
+ */
121
+ readChunk(max: number): Promise<Uint8Array>;
112
122
  readAll(): Promise<Uint8Array>;
113
123
  discard(): Promise<void>;
114
124
  string(): Promise<string>;
@@ -122,6 +132,8 @@ export declare class Reader {
122
132
  varint(): Promise<U64>;
123
133
  done(): Promise<boolean>;
124
134
  stop(reason: unknown): void;
135
+ /** A non-consuming peer reset notification on transports that support one. */
136
+ get resetSignal(): AbortSignal | undefined;
125
137
  get closed(): Promise<void>;
126
138
  }
127
139
  /** The stream ended cleanly partway through a read. */
@@ -161,10 +173,12 @@ export declare class Cursor {
161
173
  /** Read a varint. */
162
174
  varint(): U64;
163
175
  }
164
- export declare class Writer {
176
+ export declare class Writer implements OpenStream {
165
177
  #private;
166
178
  version: StreamVersion;
167
179
  constructor(stream: WritableStream<Uint8Array>, version: StreamVersion);
180
+ /** The send order the stream has now, where HIGHER values are sent first. */
181
+ get sendOrder(): number;
168
182
  /**
169
183
  * Rank this stream against the session's others, where HIGHER values are sent first.
170
184
  *
@@ -176,6 +190,30 @@ export declare class Writer {
176
190
  * ignored property, the same way an ignored `sendOrder` option does at {@link open}.
177
191
  */
178
192
  setPriority(sendOrder: number): void;
193
+ /**
194
+ * Whether the peer has acknowledged every byte written so far, or undefined when the
195
+ * transport cannot tell, as a browser's WebTransport cannot.
196
+ */
197
+ acknowledged(): Promise<boolean | undefined>;
198
+ /**
199
+ * From now on, every reset of the stream, a preemption included, still delivers the bytes
200
+ * written so far. Call it once every write so far resolved. Returns whether the transport
201
+ * can, holding nothing otherwise: a browser's WebTransport cannot, nor can a peer without
202
+ * RESET_STREAM_AT, whose plain reset lets it discard bytes it has not read; and a stream
203
+ * already reset or stopped, perhaps preempted before this, has lost them already.
204
+ */
205
+ hold(): boolean;
206
+ /**
207
+ * Whether the peer acknowledged every byte {@link hold} marked, even after the stream ended;
208
+ * false when nothing is held or the transport cannot tell.
209
+ */
210
+ heldAcknowledged(): Promise<boolean>;
211
+ /**
212
+ * The code the peer stopped the stream with, or undefined while it has not: still open,
213
+ * finished, reset by this side first, or failed with its session. Known before a write or
214
+ * {@link closed} that the stop failed settles.
215
+ */
216
+ get stopped(): StreamCode | undefined;
179
217
  bool(v: boolean): Promise<void>;
180
218
  u8(v: number): Promise<void>;
181
219
  u16(v: number): Promise<void>;
@@ -187,6 +225,9 @@ export declare class Writer {
187
225
  string(str: string): Promise<void>;
188
226
  close(): void;
189
227
  get closed(): Promise<void>;
228
+ /** Reset the stream to make room for a higher one, failing its writer as too far behind. */
229
+ preempt(): void;
230
+ /** Reset the stream with `reason`, still delivering what {@link hold} marked where the transport can. */
190
231
  reset(reason: unknown): void;
191
232
  /** Run `f` against a Writer that buffers in memory, returning everything it wrote as one chunk. */
192
233
  static collect(version: StreamVersion, f: (w: Writer) => Promise<void>): Promise<Uint8Array>;
@@ -196,14 +237,12 @@ export declare class Writer {
196
237
  * @param options - The version its varints encode with, and the send order ranking it
197
238
  * against the session's other streams
198
239
  */
240
+ /** Open a send-only stream, waiting its turn for the peer's stream credit. */
199
241
  static open(quic: WebTransport, options: OpenOptions): Promise<Writer>;
200
242
  /**
201
- * Like {@link Writer.open}, but gives up when `cancel` settles or `timeout` elapses,
202
- * returning undefined so the caller can drop whatever it meant to send. A stream that
203
- * opens after that is reset rather than leaked. A real transport failure still throws.
204
- *
205
- * Worth using even with `waitUntilAvailable: false`, since an implementation may park
206
- * an over-limit open instead of rejecting it.
243
+ * Like {@link Writer.open}, but leaves the line once `cancel` settles, returning undefined
244
+ * so the caller can drop whatever it meant to send. The stream its create admits later goes
245
+ * to the next open in line. A transport failure, or a rejected `cancel`, still throws.
207
246
  */
208
247
  static tryOpen(quic: WebTransport, options: TryOpenOptions): Promise<Writer | undefined>;
209
248
  }
@@ -211,6 +250,5 @@ export declare class Readers {
211
250
  #private;
212
251
  constructor(quic: WebTransport, version: StreamVersion);
213
252
  next(): Promise<Reader | undefined>;
214
- close(): void;
215
253
  }
216
254
  //# sourceMappingURL=stream.d.ts.map
package/stream.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAmB,KAAK,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAA6B,GAAG,EAAE,MAAM,eAAe,CAAC;AA2B/D;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC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