werift 0.25.2 → 0.27.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 (568) hide show
  1. package/README.md +63 -0
  2. package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
  3. package/lib/common/src/asn1.d.ts +42 -0
  4. package/lib/common/src/asn1.js +163 -0
  5. package/lib/common/src/asn1.js.map +1 -0
  6. package/lib/common/src/binary.d.ts +1 -3
  7. package/lib/common/src/binary.js +8 -6
  8. package/lib/common/src/binary.js.map +1 -1
  9. package/lib/common/src/binaryData.js +2 -1
  10. package/lib/common/src/binaryData.js.map +1 -1
  11. package/lib/common/src/index.d.ts +6 -5
  12. package/lib/common/src/index.js +6 -5
  13. package/lib/common/src/index.js.map +1 -1
  14. package/lib/common/src/log.d.ts +12 -1
  15. package/lib/common/src/log.js +142 -12
  16. package/lib/common/src/log.js.map +1 -1
  17. package/lib/common/src/network.js.map +1 -1
  18. package/lib/common/src/queue.d.ts +41 -0
  19. package/lib/common/src/queue.js +146 -0
  20. package/lib/common/src/queue.js.map +1 -0
  21. package/lib/common/src/transport.d.ts +15 -2
  22. package/lib/common/src/transport.js +108 -19
  23. package/lib/common/src/transport.js.map +1 -1
  24. package/lib/dtls/src/cipher/create.js.map +1 -1
  25. package/lib/dtls/src/cipher/ec.js +8 -8
  26. package/lib/dtls/src/cipher/ec.js.map +1 -1
  27. package/lib/dtls/src/cipher/namedCurve.js +6 -7
  28. package/lib/dtls/src/cipher/namedCurve.js.map +1 -1
  29. package/lib/dtls/src/cipher/prf.d.ts +2 -2
  30. package/lib/dtls/src/cipher/prf.js +29 -8
  31. package/lib/dtls/src/cipher/prf.js.map +1 -1
  32. package/lib/dtls/src/cipher/suites/aead.d.ts +1 -1
  33. package/lib/dtls/src/context/certificate.d.ts +32 -0
  34. package/lib/dtls/src/context/certificate.js +54 -0
  35. package/lib/dtls/src/context/certificate.js.map +1 -0
  36. package/lib/dtls/src/context/cipher.d.ts +13 -7
  37. package/lib/dtls/src/context/cipher.js +58 -106
  38. package/lib/dtls/src/context/cipher.js.map +1 -1
  39. package/lib/dtls/src/context/dtls.js +4 -2
  40. package/lib/dtls/src/context/dtls.js.map +1 -1
  41. package/lib/dtls/src/context/transport.d.ts +4 -0
  42. package/lib/dtls/src/context/transport.js +16 -1
  43. package/lib/dtls/src/context/transport.js.map +1 -1
  44. package/lib/dtls/src/flight/client/flight1.js +2 -1
  45. package/lib/dtls/src/flight/client/flight1.js.map +1 -1
  46. package/lib/dtls/src/flight/client/flight5.js +4 -2
  47. package/lib/dtls/src/flight/client/flight5.js.map +1 -1
  48. package/lib/dtls/src/flight/flight.d.ts +1 -1
  49. package/lib/dtls/src/flight/flight.js +16 -5
  50. package/lib/dtls/src/flight/flight.js.map +1 -1
  51. package/lib/dtls/src/flight/server/flight2.js.map +1 -1
  52. package/lib/dtls/src/flight/server/flight4.d.ts +2 -1
  53. package/lib/dtls/src/flight/server/flight4.js +12 -4
  54. package/lib/dtls/src/flight/server/flight4.js.map +1 -1
  55. package/lib/dtls/src/flight/server/flight6.js +2 -1
  56. package/lib/dtls/src/flight/server/flight6.js.map +1 -1
  57. package/lib/dtls/src/handshake/const.d.ts +17 -13
  58. package/lib/dtls/src/handshake/const.js +16 -14
  59. package/lib/dtls/src/handshake/const.js.map +1 -1
  60. package/lib/dtls/src/handshake/extensions/signature.d.ts +1 -1
  61. package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
  62. package/lib/dtls/src/handshake/message/alert.js +5 -3
  63. package/lib/dtls/src/handshake/message/alert.js.map +1 -1
  64. package/lib/dtls/src/handshake/message/certificate.js +3 -2
  65. package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
  66. package/lib/dtls/src/handshake/message/changeCipherSpec.js +4 -4
  67. package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
  68. package/lib/dtls/src/handshake/message/client/certificateVerify.d.ts +1 -1
  69. package/lib/dtls/src/handshake/message/client/certificateVerify.js +5 -3
  70. package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
  71. package/lib/dtls/src/handshake/message/client/hello.js +15 -8
  72. package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
  73. package/lib/dtls/src/handshake/message/client/keyExchange.js +3 -2
  74. package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
  75. package/lib/dtls/src/handshake/message/finished.js +2 -1
  76. package/lib/dtls/src/handshake/message/finished.js.map +1 -1
  77. package/lib/dtls/src/handshake/message/server/certificateRequest.d.ts +1 -1
  78. package/lib/dtls/src/handshake/message/server/certificateRequest.js +7 -4
  79. package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
  80. package/lib/dtls/src/handshake/message/server/hello.d.ts +1 -1
  81. package/lib/dtls/src/handshake/message/server/hello.js +14 -8
  82. package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
  83. package/lib/dtls/src/handshake/message/server/helloDone.js +1 -1
  84. package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
  85. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +5 -3
  86. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
  87. package/lib/dtls/src/handshake/message/server/keyExchange.d.ts +1 -1
  88. package/lib/dtls/src/handshake/message/server/keyExchange.js +17 -9
  89. package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
  90. package/lib/dtls/src/handshake/random.d.ts +1 -1
  91. package/lib/dtls/src/handshake/random.js +7 -4
  92. package/lib/dtls/src/handshake/random.js.map +1 -1
  93. package/lib/dtls/src/imports/common.d.ts +1 -0
  94. package/lib/dtls/src/imports/common.js +1 -0
  95. package/lib/dtls/src/imports/common.js.map +1 -1
  96. package/lib/dtls/src/index.d.ts +2 -2
  97. package/lib/dtls/src/index.js +2 -2
  98. package/lib/dtls/src/index.js.map +1 -1
  99. package/lib/dtls/src/record/const.d.ts +43 -33
  100. package/lib/dtls/src/record/const.js +43 -36
  101. package/lib/dtls/src/record/const.js.map +1 -1
  102. package/lib/dtls/src/record/message/fragment.d.ts +1 -1
  103. package/lib/dtls/src/record/message/fragment.js +15 -9
  104. package/lib/dtls/src/record/message/fragment.js.map +1 -1
  105. package/lib/dtls/src/record/message/header.js +12 -7
  106. package/lib/dtls/src/record/message/header.js.map +1 -1
  107. package/lib/dtls/src/record/message/plaintext.js +4 -2
  108. package/lib/dtls/src/record/message/plaintext.js.map +1 -1
  109. package/lib/dtls/src/record/receive.js +2 -2
  110. package/lib/dtls/src/record/receive.js.map +1 -1
  111. package/lib/dtls/src/server.js +1 -1
  112. package/lib/dtls/src/server.js.map +1 -1
  113. package/lib/dtls/src/socket.d.ts +2 -2
  114. package/lib/dtls/src/socket.js +6 -4
  115. package/lib/dtls/src/socket.js.map +1 -1
  116. package/lib/ice/src/candidate.d.ts +1 -1
  117. package/lib/ice/src/candidate.js +24 -12
  118. package/lib/ice/src/candidate.js.map +1 -1
  119. package/lib/ice/src/dns/lookup.d.ts +10 -1
  120. package/lib/ice/src/dns/lookup.js +42 -7
  121. package/lib/ice/src/dns/lookup.js.map +1 -1
  122. package/lib/ice/src/exceptions.d.ts +46 -0
  123. package/lib/ice/src/exceptions.js +92 -5
  124. package/lib/ice/src/exceptions.js.map +1 -1
  125. package/lib/ice/src/helper.d.ts +1 -1
  126. package/lib/ice/src/ice.d.ts +191 -5
  127. package/lib/ice/src/ice.js +1048 -156
  128. package/lib/ice/src/ice.js.map +1 -1
  129. package/lib/ice/src/iceBase.d.ts +174 -10
  130. package/lib/ice/src/iceBase.js +165 -12
  131. package/lib/ice/src/iceBase.js.map +1 -1
  132. package/lib/ice/src/index.d.ts +5 -5
  133. package/lib/ice/src/index.js +5 -5
  134. package/lib/ice/src/index.js.map +1 -1
  135. package/lib/ice/src/internal/resolveHostAddresses.d.ts +26 -0
  136. package/lib/ice/src/internal/resolveHostAddresses.js +45 -0
  137. package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -0
  138. package/lib/ice/src/stun/protocol.d.ts +3 -1
  139. package/lib/ice/src/stun/protocol.js +16 -0
  140. package/lib/ice/src/stun/protocol.js.map +1 -1
  141. package/lib/ice/src/stun/tcpProtocol.d.ts +2 -0
  142. package/lib/ice/src/stun/tcpProtocol.js +16 -1
  143. package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
  144. package/lib/ice/src/stun/transaction.d.ts +35 -1
  145. package/lib/ice/src/stun/transaction.js +93 -18
  146. package/lib/ice/src/stun/transaction.js.map +1 -1
  147. package/lib/ice/src/turn/credential.d.ts +49 -0
  148. package/lib/ice/src/turn/credential.js +78 -0
  149. package/lib/ice/src/turn/credential.js.map +1 -0
  150. package/lib/ice/src/turn/protocol.d.ts +97 -7
  151. package/lib/ice/src/turn/protocol.js +357 -55
  152. package/lib/ice/src/turn/protocol.js.map +1 -1
  153. package/lib/ice/src/utils.js.map +1 -1
  154. package/lib/ice-server/src/stun/attributes.d.ts +2 -0
  155. package/lib/ice-server/src/stun/attributes.js +7 -1
  156. package/lib/ice-server/src/stun/attributes.js.map +1 -1
  157. package/lib/ice-server/src/stun/const.d.ts +24 -16
  158. package/lib/ice-server/src/stun/const.js +22 -18
  159. package/lib/ice-server/src/stun/const.js.map +1 -1
  160. package/lib/ice-server/src/stun/message.d.ts +3 -1
  161. package/lib/ice-server/src/stun/message.js +41 -6
  162. package/lib/ice-server/src/stun/message.js.map +1 -1
  163. package/lib/ice-server/src/turn/auth.d.ts +1 -1
  164. package/lib/index.mjs +25252 -12664
  165. package/lib/nonstandard/index.mjs +11015 -8906
  166. package/lib/polyfill/dom.mjs +30779 -18386
  167. package/lib/polyfill/index.mjs +30779 -18386
  168. package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
  169. package/lib/rtp/src/codec/assertPayload.js +12 -0
  170. package/lib/rtp/src/codec/assertPayload.js.map +1 -0
  171. package/lib/rtp/src/codec/av1.js +2 -0
  172. package/lib/rtp/src/codec/av1.js.map +1 -1
  173. package/lib/rtp/src/codec/h264.d.ts +1 -1
  174. package/lib/rtp/src/codec/h264.js +35 -43
  175. package/lib/rtp/src/codec/h264.js.map +1 -1
  176. package/lib/rtp/src/codec/vp8.js +11 -5
  177. package/lib/rtp/src/codec/vp8.js.map +1 -1
  178. package/lib/rtp/src/codec/vp9.js +12 -0
  179. package/lib/rtp/src/codec/vp9.js.map +1 -1
  180. package/lib/rtp/src/extra/container/mp4/container.js +2 -1
  181. package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
  182. package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
  183. package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
  184. package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
  185. package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
  186. package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
  187. package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
  188. package/lib/rtp/src/extra/container/ogg/index.js +1 -0
  189. package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
  190. package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
  191. package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
  192. package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
  193. package/lib/rtp/src/extra/container/webm/container.d.ts +1 -1
  194. package/lib/rtp/src/extra/container/webm/ebml/ebml.d.ts +6 -0
  195. package/lib/rtp/src/extra/container/webm/ebml/ebml.js +26 -4
  196. package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
  197. package/lib/rtp/src/extra/processor/depacketizer.d.ts +6 -1
  198. package/lib/rtp/src/extra/processor/depacketizer.js +29 -3
  199. package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
  200. package/lib/rtp/src/extra/processor/depacketizerCallback.d.ts +1 -11
  201. package/lib/rtp/src/extra/processor/depacketizerTransformer.d.ts +1 -1
  202. package/lib/rtp/src/extra/processor/dtx.js +4 -2
  203. package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
  204. package/lib/rtp/src/extra/processor/dtxCallback.d.ts +1 -11
  205. package/lib/rtp/src/extra/processor/index.d.ts +2 -0
  206. package/lib/rtp/src/extra/processor/index.js +2 -0
  207. package/lib/rtp/src/extra/processor/index.js.map +1 -1
  208. package/lib/rtp/src/extra/processor/interface.d.ts +16 -11
  209. package/lib/rtp/src/extra/processor/interface.js.map +1 -1
  210. package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
  211. package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
  212. package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
  213. package/lib/rtp/src/extra/processor/jitterBufferCallback.d.ts +1 -11
  214. package/lib/rtp/src/extra/processor/jitterBufferTransformer.d.ts +1 -1
  215. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
  216. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
  217. package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
  218. package/lib/rtp/src/extra/processor/lipsync.js +202 -51
  219. package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
  220. package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
  221. package/lib/rtp/src/extra/processor/mp4.js +7 -4
  222. package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
  223. package/lib/rtp/src/extra/processor/mute.js +4 -2
  224. package/lib/rtp/src/extra/processor/mute.js.map +1 -1
  225. package/lib/rtp/src/extra/processor/nack.d.ts +1 -1
  226. package/lib/rtp/src/extra/processor/nack.js +5 -3
  227. package/lib/rtp/src/extra/processor/nack.js.map +1 -1
  228. package/lib/rtp/src/extra/processor/nackHandlerCallback.d.ts +1 -11
  229. package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
  230. package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
  231. package/lib/rtp/src/extra/processor/ntpTimeCallback.d.ts +1 -11
  232. package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
  233. package/lib/rtp/src/extra/processor/ogg.js +221 -0
  234. package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
  235. package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
  236. package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
  237. package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
  238. package/lib/rtp/src/extra/processor/rtcpCallback.d.ts +1 -1
  239. package/lib/rtp/src/extra/processor/rtcpCallback.js.map +1 -1
  240. package/lib/rtp/src/extra/processor/rtpCallback.d.ts +1 -1
  241. package/lib/rtp/src/extra/processor/rtpCallback.js +3 -2
  242. package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
  243. package/lib/rtp/src/extra/processor/rtpStream.d.ts +2 -2
  244. package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
  245. package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
  246. package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
  247. package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
  248. package/lib/rtp/src/extra/processor/rtpTimeCallback.d.ts +1 -11
  249. package/lib/rtp/src/extra/processor/webm.d.ts +27 -0
  250. package/lib/rtp/src/extra/processor/webm.js +57 -23
  251. package/lib/rtp/src/extra/processor/webm.js.map +1 -1
  252. package/lib/rtp/src/extra/processor/webmCallback.js +6 -1
  253. package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
  254. package/lib/rtp/src/extra/processor/webmStream.js.map +1 -1
  255. package/lib/rtp/src/helper.d.ts +2 -2
  256. package/lib/rtp/src/helper.js +2 -6
  257. package/lib/rtp/src/helper.js.map +1 -1
  258. package/lib/rtp/src/index.d.ts +10 -2
  259. package/lib/rtp/src/index.js +10 -2
  260. package/lib/rtp/src/index.js.map +1 -1
  261. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
  262. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +6 -1
  263. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
  264. package/lib/rtp/src/rtcp/rtcp.js +9 -4
  265. package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
  266. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
  267. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
  268. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
  269. package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
  270. package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
  271. package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
  272. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
  273. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
  274. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
  275. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
  276. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
  277. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
  278. package/lib/rtp/src/rtcp/sr.d.ts +4 -3
  279. package/lib/rtp/src/rtcp/sr.js +4 -2
  280. package/lib/rtp/src/rtcp/sr.js.map +1 -1
  281. package/lib/rtp/src/rtp/continuity.d.ts +36 -0
  282. package/lib/rtp/src/rtp/continuity.js +100 -0
  283. package/lib/rtp/src/rtp/continuity.js.map +1 -0
  284. package/lib/rtp/src/rtp/headerExtension.js +41 -21
  285. package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
  286. package/lib/rtp/src/rtp/padding.d.ts +17 -0
  287. package/lib/rtp/src/rtp/padding.js +37 -0
  288. package/lib/rtp/src/rtp/padding.js.map +1 -0
  289. package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
  290. package/lib/rtp/src/rtp/red/encoder.js +14 -1
  291. package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
  292. package/lib/rtp/src/rtp/red/packet.js +24 -8
  293. package/lib/rtp/src/rtp/red/packet.js.map +1 -1
  294. package/lib/rtp/src/rtp/rtp.d.ts +24 -1
  295. package/lib/rtp/src/rtp/rtp.js +70 -29
  296. package/lib/rtp/src/rtp/rtp.js.map +1 -1
  297. package/lib/rtp/src/rtp/rtx.js +3 -0
  298. package/lib/rtp/src/rtp/rtx.js.map +1 -1
  299. package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
  300. package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
  301. package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
  302. package/lib/rtp/src/srtp/cipher/ctr.d.ts +2 -2
  303. package/lib/rtp/src/srtp/cipher/ctr.js +5 -3
  304. package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
  305. package/lib/rtp/src/srtp/cipher/gcm.d.ts +1 -1
  306. package/lib/rtp/src/srtp/cipher/gcm.js +1 -1
  307. package/lib/rtp/src/srtp/cipher/gcm.js.map +1 -1
  308. package/lib/rtp/src/srtp/cipher/index.js +8 -4
  309. package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
  310. package/lib/rtp/src/srtp/context/context.d.ts +29 -1
  311. package/lib/rtp/src/srtp/context/context.js +84 -27
  312. package/lib/rtp/src/srtp/context/context.js.map +1 -1
  313. package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
  314. package/lib/rtp/src/srtp/context/srtcp.js +33 -0
  315. package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
  316. package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
  317. package/lib/rtp/src/srtp/context/srtp.js +36 -4
  318. package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
  319. package/lib/rtp/src/srtp/error.d.ts +8 -0
  320. package/lib/rtp/src/srtp/error.js +13 -1
  321. package/lib/rtp/src/srtp/error.js.map +1 -1
  322. package/lib/rtp/src/srtp/packet.js +4 -1
  323. package/lib/rtp/src/srtp/packet.js.map +1 -1
  324. package/lib/rtp/src/srtp/replay.d.ts +24 -0
  325. package/lib/rtp/src/srtp/replay.js +75 -0
  326. package/lib/rtp/src/srtp/replay.js.map +1 -0
  327. package/lib/rtp/src/srtp/session.js +2 -1
  328. package/lib/rtp/src/srtp/session.js.map +1 -1
  329. package/lib/rtp/src/srtp/srtcp.js +2 -1
  330. package/lib/rtp/src/srtp/srtcp.js.map +1 -1
  331. package/lib/rtp/src/srtp/srtp.js +2 -1
  332. package/lib/rtp/src/srtp/srtp.js.map +1 -1
  333. package/lib/rtp/src/util.js +2 -1
  334. package/lib/rtp/src/util.js.map +1 -1
  335. package/lib/sctp/src/chunk.d.ts +5 -0
  336. package/lib/sctp/src/chunk.js +31 -8
  337. package/lib/sctp/src/chunk.js.map +1 -1
  338. package/lib/sctp/src/const.d.ts +25 -17
  339. package/lib/sctp/src/const.js +23 -19
  340. package/lib/sctp/src/const.js.map +1 -1
  341. package/lib/sctp/src/index.d.ts +4 -3
  342. package/lib/sctp/src/index.js +10 -8
  343. package/lib/sctp/src/index.js.map +1 -1
  344. package/lib/sctp/src/param.d.ts +6 -2
  345. package/lib/sctp/src/param.js +22 -8
  346. package/lib/sctp/src/param.js.map +1 -1
  347. package/lib/sctp/src/sctp.d.ts +91 -2
  348. package/lib/sctp/src/sctp.js +700 -134
  349. package/lib/sctp/src/sctp.js.map +1 -1
  350. package/lib/sctp/src/transport.js +4 -2
  351. package/lib/sctp/src/transport.js.map +1 -1
  352. package/lib/webrtc/src/api/peerConfig.d.ts +307 -0
  353. package/lib/webrtc/src/api/peerConfig.js +291 -0
  354. package/lib/webrtc/src/api/peerConfig.js.map +1 -0
  355. package/lib/webrtc/src/api/peerConnectionEvents.d.ts +36 -0
  356. package/lib/webrtc/src/api/peerConnectionEvents.js +44 -0
  357. package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -0
  358. package/lib/webrtc/src/dataChannel.d.ts +11 -1
  359. package/lib/webrtc/src/dataChannel.js +25 -5
  360. package/lib/webrtc/src/dataChannel.js.map +1 -1
  361. package/lib/webrtc/src/index.d.ts +2 -2
  362. package/lib/webrtc/src/index.js +2 -2
  363. package/lib/webrtc/src/index.js.map +1 -1
  364. package/lib/webrtc/src/media/index.d.ts +11 -1
  365. package/lib/webrtc/src/media/index.js +71 -1
  366. package/lib/webrtc/src/media/index.js.map +1 -1
  367. package/lib/webrtc/src/media/receiver/nack.js +5 -5
  368. package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
  369. package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
  370. package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
  371. package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
  372. package/lib/webrtc/src/media/router.d.ts +130 -6
  373. package/lib/webrtc/src/media/router.js +325 -29
  374. package/lib/webrtc/src/media/router.js.map +1 -1
  375. package/lib/webrtc/src/media/rtpReceiver.d.ts +137 -14
  376. package/lib/webrtc/src/media/rtpReceiver.js +420 -44
  377. package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
  378. package/lib/webrtc/src/media/rtpSender.d.ts +232 -65
  379. package/lib/webrtc/src/media/rtpSender.js +784 -448
  380. package/lib/webrtc/src/media/rtpSender.js.map +1 -1
  381. package/lib/webrtc/src/media/rtpTransceiver.d.ts +95 -4
  382. package/lib/webrtc/src/media/rtpTransceiver.js +121 -9
  383. package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
  384. package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
  385. package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
  386. package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
  387. package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
  388. package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
  389. package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
  390. package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
  391. package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
  392. package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
  393. package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
  394. package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
  395. package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
  396. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
  397. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
  398. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
  399. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
  400. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
  401. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
  402. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
  403. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
  404. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
  405. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
  406. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
  407. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
  408. package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
  409. package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
  410. package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
  411. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
  412. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
  413. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
  414. package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
  415. package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
  416. package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
  417. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
  418. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
  419. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
  420. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
  421. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
  422. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
  423. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
  424. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
  425. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
  426. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
  427. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
  428. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
  429. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
  430. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
  431. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
  432. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
  433. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
  434. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
  435. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
  436. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
  437. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
  438. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
  439. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
  440. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
  441. package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
  442. package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
  443. package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
  444. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
  445. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
  446. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
  447. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
  448. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
  449. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
  450. package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
  451. package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
  452. package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
  453. package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
  454. package/lib/webrtc/src/media/sender/padding.js +134 -0
  455. package/lib/webrtc/src/media/sender/padding.js.map +1 -0
  456. package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
  457. package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
  458. package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
  459. package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
  460. package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
  461. package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
  462. package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
  463. package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
  464. package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
  465. package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -32
  466. package/lib/webrtc/src/media/sender/senderBWE.js +5 -142
  467. package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
  468. package/lib/webrtc/src/media/sender/senderStats.d.ts +100 -0
  469. package/lib/webrtc/src/media/sender/senderStats.js +322 -0
  470. package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
  471. package/lib/webrtc/src/media/track.d.ts +21 -3
  472. package/lib/webrtc/src/media/track.js +24 -6
  473. package/lib/webrtc/src/media/track.js.map +1 -1
  474. package/lib/webrtc/src/negotiation/bundleTopology.d.ts +103 -0
  475. package/lib/webrtc/src/negotiation/bundleTopology.js +384 -0
  476. package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -0
  477. package/lib/webrtc/src/negotiation/descriptionValidation.d.ts +51 -0
  478. package/lib/webrtc/src/negotiation/descriptionValidation.js +267 -0
  479. package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -0
  480. package/lib/webrtc/src/negotiation/iceRestartRequest.d.ts +21 -0
  481. package/lib/webrtc/src/negotiation/iceRestartRequest.js +61 -0
  482. package/lib/webrtc/src/negotiation/iceRestartRequest.js.map +1 -0
  483. package/lib/webrtc/src/negotiation/internalState.d.ts +34 -0
  484. package/lib/webrtc/src/negotiation/internalState.js +21 -0
  485. package/lib/webrtc/src/negotiation/internalState.js.map +1 -0
  486. package/lib/webrtc/src/negotiation/negotiationNeeded.d.ts +44 -0
  487. package/lib/webrtc/src/negotiation/negotiationNeeded.js +119 -0
  488. package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -0
  489. package/lib/webrtc/src/negotiation/remoteCandidates.d.ts +86 -0
  490. package/lib/webrtc/src/negotiation/remoteCandidates.js +349 -0
  491. package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -0
  492. package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +71 -0
  493. package/lib/webrtc/src/negotiation/remoteMediaApplication.js +414 -0
  494. package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -0
  495. package/lib/webrtc/src/negotiation/transportActivation.d.ts +59 -0
  496. package/lib/webrtc/src/negotiation/transportActivation.js +356 -0
  497. package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -0
  498. package/lib/webrtc/src/negotiationTransaction.d.ts +240 -0
  499. package/lib/webrtc/src/negotiationTransaction.js +604 -0
  500. package/lib/webrtc/src/negotiationTransaction.js.map +1 -0
  501. package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
  502. package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
  503. package/lib/webrtc/src/nonstandard/index.d.ts +1 -1
  504. package/lib/webrtc/src/nonstandard/index.js +1 -1
  505. package/lib/webrtc/src/nonstandard/index.js.map +1 -1
  506. package/lib/webrtc/src/nonstandard/navigator.js +4 -3
  507. package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
  508. package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
  509. package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
  510. package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
  511. package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +10 -8
  512. package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
  513. package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
  514. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
  515. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
  516. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
  517. package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +2 -2
  518. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +10 -3
  519. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
  520. package/lib/webrtc/src/nonstandard/userMedia/packetizer.d.ts +2 -2
  521. package/lib/webrtc/src/nonstandard/userMedia/packetizer.js.map +1 -1
  522. package/lib/webrtc/src/nonstandard/userMedia.d.ts +2 -2
  523. package/lib/webrtc/src/nonstandard/userMedia.js +4 -3
  524. package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
  525. package/lib/webrtc/src/peerConnection.d.ts +176 -238
  526. package/lib/webrtc/src/peerConnection.js +1042 -913
  527. package/lib/webrtc/src/peerConnection.js.map +1 -1
  528. package/lib/webrtc/src/polyfill/api.d.ts +5 -5
  529. package/lib/webrtc/src/polyfill/api.js.map +1 -1
  530. package/lib/webrtc/src/polyfill/index.js.map +1 -1
  531. package/lib/webrtc/src/polyfill/install.js +1 -1
  532. package/lib/webrtc/src/polyfill/install.js.map +1 -1
  533. package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
  534. package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
  535. package/lib/webrtc/src/polyfill/registers/mp4Webm.js.map +1 -1
  536. package/lib/webrtc/src/polyfill/registers/rtpRtcp.js.map +1 -1
  537. package/lib/webrtc/src/polyfill/selectSettings.js.map +1 -1
  538. package/lib/webrtc/src/polyfill/sourceIo.js.map +1 -1
  539. package/lib/webrtc/src/sctpManager.d.ts +97 -1
  540. package/lib/webrtc/src/sctpManager.js +189 -9
  541. package/lib/webrtc/src/sctpManager.js.map +1 -1
  542. package/lib/webrtc/src/sdp.js +12 -6
  543. package/lib/webrtc/src/sdp.js.map +1 -1
  544. package/lib/webrtc/src/sdpManager.d.ts +55 -11
  545. package/lib/webrtc/src/sdpManager.js +364 -87
  546. package/lib/webrtc/src/sdpManager.js.map +1 -1
  547. package/lib/webrtc/src/secureTransportManager.d.ts +89 -28
  548. package/lib/webrtc/src/secureTransportManager.js +232 -53
  549. package/lib/webrtc/src/secureTransportManager.js.map +1 -1
  550. package/lib/webrtc/src/transceiverManager.d.ts +62 -18
  551. package/lib/webrtc/src/transceiverManager.js +272 -107
  552. package/lib/webrtc/src/transceiverManager.js.map +1 -1
  553. package/lib/webrtc/src/transport/dtls.d.ts +64 -3
  554. package/lib/webrtc/src/transport/dtls.js +166 -42
  555. package/lib/webrtc/src/transport/dtls.js.map +1 -1
  556. package/lib/webrtc/src/transport/ice.d.ts +199 -28
  557. package/lib/webrtc/src/transport/ice.js +666 -71
  558. package/lib/webrtc/src/transport/ice.js.map +1 -1
  559. package/lib/webrtc/src/transport/iceCandidateAttribute.d.ts +98 -0
  560. package/lib/webrtc/src/transport/iceCandidateAttribute.js +129 -0
  561. package/lib/webrtc/src/transport/iceCandidateAttribute.js.map +1 -0
  562. package/lib/webrtc/src/transport/sctp.d.ts +6 -1
  563. package/lib/webrtc/src/transport/sctp.js +149 -37
  564. package/lib/webrtc/src/transport/sctp.js.map +1 -1
  565. package/lib/webrtc/src/utils.d.ts +39 -6
  566. package/lib/webrtc/src/utils.js +57 -17
  567. package/lib/webrtc/src/utils.js.map +1 -1
  568. package/package.json +16 -15
@@ -1,27 +1,65 @@
1
- import { Event } from "../imports/common";
2
1
  import { Candidate, type IceConnection, type IceOptions } from "../../../ice/src";
3
- import { type RTCStats } from "../media/stats";
2
+ import { Event } from "../imports/common";
3
+ import { type RTCIceCandidateType, type RTCIceTcpCandidateType, type RTCStats } from "../media/stats";
4
+ import { type RTCIceCandidateFields, type RTCIceComponent, type RTCIceProtocol } from "./iceCandidateAttribute";
4
5
  /**
5
- * +------------+
6
- | |
7
- |disconnected|
8
- | |
9
- +------------+
10
- ^ ^
11
- | |
12
- +------+ +----------+ +-----------+ +----------+
13
- | | | | | | | |
14
- | new | ---> | checking | ---> | connected | ---> | completed|
15
- | | | | | | | |
16
- +------+ +----+-----+ +-----------+ +----------+
17
- |
18
- |
19
- v
20
- +-------+
21
- | |
22
- | failed|
23
- | |
24
- +-------+
6
+ * ICE generations of one transport. An ICE restart (new ufrag/pwd without a
7
+ * BUNDLE topology change) keeps the transport, its sockets and its DTLS
8
+ * association: no role renegotiation, no second handshake (RFC 8842, JSEP).
9
+ * Only a BUNDLE owner change creates a separate pending transport.
10
+ *
11
+ * Restart generations are registered by ufrag (`localGenerationFor`): the
12
+ * latest created offer and the latest created answer each keep theirs until a
13
+ * newer description of the same kind replaces it, whatever is applied, rolled
14
+ * back or committed meanwhile. Applying a description selects the generation
15
+ * its SDP carries, and the final answer switches exactly that one. A new offer
16
+ * reuses the applied pending offer's generation (JSEP 5.2.1) unless
17
+ * `restartIce()` asked to replace it; an answer created again reuses the
18
+ * earlier answer's (JSEP 5.3.1).
19
+ *
20
+ * Provisional generation: while a restart of an established transport is
21
+ * negotiated, a second checklist runs beside the live one on the same sockets.
22
+ * It only exchanges STUN checks; RTP and DataChannel stay on the live selected
23
+ * pair, and it follows the live checklist's rules (pair filter, ICE-lite,
24
+ * nomination, staged-password error responses).
25
+ *
26
+ * - Created when the restart credentials are staged (`stageLocalRestart`): by
27
+ * `createOffer()` while a `restartIce()` request stands, or by
28
+ * `createAnswer()` for a remote offer that changes a live transport's ufrag.
29
+ * It then answers checks for that ufrag.
30
+ * - Fed by the pranswer with the peer's credentials, candidates and
31
+ * end-of-candidates (`setProvisionalRemoteParams`,
32
+ * `addProvisionalRemoteCandidate`); a replacement pranswer restarts it.
33
+ * - Checks start when the pranswer is applied (`startProvisionalChecks`); the
34
+ * controlling side nominates a provisional pair, but the live selected pair
35
+ * and send target never change. A response for an earlier checklist is
36
+ * ignored.
37
+ * - Ends at the final answer, which recreates the live agent with the staged
38
+ * credentials and checks the answered generation from scratch, or at
39
+ * rollback / a replacement offer / selecting another generation, which
40
+ * stops its checks and keeps the live generation.
41
+ *
42
+ * A first negotiation and transports created for a proposal have no
43
+ * provisional generation; they connect normally from the pranswer. The
44
+ * staged-credential methods of `IceConnection` are optional: without them a
45
+ * restart still happens at the final answer, without provisional checks.
46
+ *
47
+ * A restart generation's candidates are fixed when its description is
48
+ * created (host candidates of the kept sockets and their server-reflexive
49
+ * addresses) and are re-advertised at the commit without waiting. With STUN
50
+ * or TURN servers the description carries neither the relay candidate nor
51
+ * end-of-candidates: after the commit the generation gathers again (a new TURN
52
+ * allocation replaces and closes the previous one) and trickles them. A
53
+ * restart's background gathering that a later restart or `close()` replaced
54
+ * signals nothing more. ICE server settings changed after gathering take
55
+ * effect at the next restart (JSEP 4.1.18): the restart generation carries
56
+ * only the kept candidates a fresh gathering with them would produce (none
57
+ * but relay for a relay-only policy, no TCP host candidates without useTcp),
58
+ * in its description and at the commit alike. Settings changed after the
59
+ * description was created still apply to that restart's gathering at the
60
+ * commit: a kept socket they exclude is closed then, so a candidate the
61
+ * description announced for it fails its checks. The old selected pair is
62
+ * dropped at the commit, so RTP pauses until the new generation nominates.
25
63
  */
26
64
  export declare class RTCIceTransport {
27
65
  private iceGather;
@@ -31,11 +69,46 @@ export declare class RTCIceTransport {
31
69
  readonly component = "rtp";
32
70
  iceRestarts: number;
33
71
  private waitStart?;
72
+ private startPromise?;
34
73
  private renominating;
74
+ /**
75
+ * The restart generation selected for the description being created or
76
+ * applied (the one createOffer / createAnswer put in its SDP, or the one an
77
+ * applied description carries).
78
+ */
79
+ private stagedLocalRestart?;
80
+ /**
81
+ * The restart generations the latest created offer and the latest created
82
+ * answer carry, by ufrag (their generation records). One stays registered
83
+ * until a newer description of the same kind replaces it (unless an
84
+ * applied description still carries it) or the transport stops, whatever
85
+ * is applied, rolled back or committed meanwhile; applying a description
86
+ * that carries it selects it (an ICE restart to those credentials on the
87
+ * kept sockets).
88
+ */
89
+ private readonly localGenerations;
90
+ /**
91
+ * The staged generation an applied description (pending local offer, or a
92
+ * remote offer being answered) carries. It stays until that description is
93
+ * committed, replaced or rolled back; an unapplied createOffer cannot drop it.
94
+ */
95
+ private appliedLocalRestart?;
96
+ /**
97
+ * Gatherer events of an ICE restart committed by a local answer, held until
98
+ * that answer is applied (`emitCommittedCandidates`), in their order: the
99
+ * re-advertised candidates first, then what the servers add and
100
+ * end-of-candidates.
101
+ */
102
+ private heldCandidateEvents?;
103
+ /**
104
+ * ICE servers set (setConfiguration) after this transport gathered. They
105
+ * apply to the next gathering, that is the next ICE restart (JSEP 4.1.18).
106
+ */
107
+ private nextGatherIceServers?;
35
108
  private readonly events;
36
109
  onstatechange?: () => void;
37
110
  ongatheringstatechange?: () => void;
38
- readonly onStateChange: Event<["closed" | "disconnected" | "completed" | "new" | "connected" | "failed" | "checking"]>;
111
+ readonly onStateChange: Event<["closed" | "new" | "connected" | "disconnected" | "completed" | "failed" | "checking"]>;
39
112
  readonly onIceCandidate: Event<[IceCandidate | undefined]>;
40
113
  readonly onNegotiationNeeded: Event<[]>;
41
114
  constructor(iceGather: RTCIceGatherer);
@@ -47,7 +120,54 @@ export declare class RTCIceTransport {
47
120
  get role(): "unknown" | "controlling" | "controlled";
48
121
  get gatheringState(): "complete" | "new" | "gathering";
49
122
  get localCandidates(): IceCandidate[];
123
+ /** Whether the local description may carry `a=end-of-candidates`. */
124
+ get localCandidatesComplete(): boolean;
125
+ /**
126
+ * A staged restart whose generation keeps gathering from its servers after
127
+ * the commit; its relay candidates and end-of-candidates come then.
128
+ */
129
+ private stagedGatherPending;
50
130
  get localParameters(): RTCIceParameters;
131
+ /**
132
+ * Prepare an ICE generation for SDP without touching the selected pair.
133
+ * `answering` is the remote offer an answer is created for.
134
+ */
135
+ stageLocalRestart({ answering, replacing, }?: {
136
+ answering?: object;
137
+ /** Credentials restartIce() asked to replace (W3C [[LocalIceCredentialsToReplace]]). */
138
+ replacing?: ReadonlySet<string>;
139
+ }): void;
140
+ private selectGeneration;
141
+ /** Stop answering checks for the selected generation; it stays registered. */
142
+ private unselectLocalRestart;
143
+ get hasStagedRestart(): boolean;
144
+ /** Feed a pranswer's ICE generation to the provisional checklist. */
145
+ setProvisionalRemoteParams(remoteParameters: RTCIceParameters): void;
146
+ addProvisionalRemoteCandidate(candidate?: IceCandidate): Promise<void> | undefined;
147
+ /**
148
+ * Hand a remote candidate (`undefined`: end-of-candidates) to the ICE agent
149
+ * without waiting for it. A host candidate is added synchronously; an mDNS
150
+ * name may take seconds to resolve, and the agent itself orders that
151
+ * resolution against end-of-candidates and generation changes, so the
152
+ * description operation queue must not wait for it.
153
+ */
154
+ deliverRemoteCandidate(candidate?: IceCandidate): void;
155
+ /** `deliverRemoteCandidate` for the provisional (pranswer) generation. */
156
+ deliverProvisionalRemoteCandidate(candidate?: IceCandidate): void;
157
+ startProvisionalChecks(): void;
158
+ emitStagedCandidates(): void;
159
+ rollbackLocalRestart(): void;
160
+ /** The staged generation now belongs to an applied description. */
161
+ markLocalRestartApplied(): void;
162
+ /** Drop only what an unapplied createOffer staged; keep the applied one. */
163
+ discardUnappliedLocalRestart(): void;
164
+ /**
165
+ * Called unconditionally on every answer; actually restarts ICE only if
166
+ * this transport has a staged local restart. No-op otherwise.
167
+ */
168
+ commitLocalRestartIfStaged(): Promise<void>;
169
+ /** Signal the candidates an ICE restart committed by a local answer gathered. */
170
+ emitCommittedCandidates(): void;
51
171
  getRemoteCandidates(): RTCIceCandidate[];
52
172
  getLocalCandidates(): RTCIceCandidate[];
53
173
  getSelectedCandidatePair(): {
@@ -59,9 +179,25 @@ export declare class RTCIceTransport {
59
179
  private setState;
60
180
  gather(): Promise<void>;
61
181
  setIceServers(options: Partial<IceOptions>): void;
182
+ /** Keep ICE servers for the next gathering (an ICE restart). */
183
+ deferIceServers(options: Partial<IceOptions>): void;
62
184
  addRemoteCandidate: (candidate?: IceCandidate) => Promise<void> | undefined;
63
- setRemoteParams(remoteParameters: RTCIceParameters, renomination?: boolean): void;
64
- restart(): void;
185
+ /**
186
+ * `keepLocalCredentials`: the remote credentials come from an answer or
187
+ * pranswer, so the local ones are fixed by the applied local offer. Changed
188
+ * remote credentials restart the checks for the new remote generation
189
+ * without new local credentials (nothing would describe them to the peer).
190
+ */
191
+ setRemoteParams(remoteParameters: RTCIceParameters, renomination?: boolean, { keepLocalCredentials }?: {
192
+ keepLocalCredentials?: boolean;
193
+ }): void;
194
+ /**
195
+ * Internal: drop the remote generation and its checks, keeping the local
196
+ * credentials and candidates a description already carries (a remote-only
197
+ * restart, or a proposal transport a replacement pranswer left unused).
198
+ */
199
+ resetRemoteGeneration(): void;
200
+ restart(notifyNegotiation?: boolean, applyNextGatherIceServers?: boolean): void;
65
201
  start(): Promise<void>;
66
202
  stop(): Promise<void>;
67
203
  getStats(timestamp?: number, transportId?: string): Promise<RTCStats[]>;
@@ -97,12 +233,42 @@ export interface RTCIceCandidateInit {
97
233
  sdpMid?: string | null;
98
234
  usernameFragment?: string | null;
99
235
  }
100
- export declare class RTCIceCandidate {
236
+ export type { RTCIceCandidateFields, RTCIceComponent, RTCIceProtocol, } from "./iceCandidateAttribute";
237
+ /**
238
+ * Browser-shaped ICE candidate. Besides the signaling fields it exposes the
239
+ * readonly fields of the W3C interface parsed from the candidate a-line
240
+ * (`foundation`, `component`, `priority`, `address`, `protocol`, `port`,
241
+ * `type`, `tcpType`, `relatedAddress`, `relatedPort`). Which candidates give
242
+ * `null` fields is specified on {@link RTCIceCandidateFields}. Candidates
243
+ * werift creates carry them without reparsing; `toJSON()` keeps only the
244
+ * signaling fields (RTCIceCandidateInit). `relayProtocol` and `url` are not
245
+ * implemented.
246
+ */
247
+ export declare class RTCIceCandidate implements RTCIceCandidateFields {
101
248
  candidate: string;
102
249
  sdpMid?: string;
103
250
  sdpMLineIndex?: number;
104
251
  usernameFragment?: string;
105
- constructor(props: Partial<RTCIceCandidate>);
252
+ readonly foundation: string | null;
253
+ readonly component: RTCIceComponent | null;
254
+ readonly priority: number | null;
255
+ readonly address: string | null;
256
+ readonly protocol: RTCIceProtocol | null;
257
+ readonly port: number | null;
258
+ readonly type: RTCIceCandidateType | null;
259
+ readonly tcpType: RTCIceTcpCandidateType | null;
260
+ readonly relatedAddress: string | null;
261
+ readonly relatedPort: number | null;
262
+ /**
263
+ * Like the browser constructor, only the `RTCIceCandidateInit` members are
264
+ * read; the parsed fields always come from `init.candidate` (`""` when
265
+ * omitted).
266
+ */
267
+ constructor(init?: RTCIceCandidateInit);
268
+ /**
269
+ * Same as `new RTCIceCandidate({ candidate: sdp })`, plus `usernameFragment`
270
+ * taken from the `ufrag` extension attribute of a valid candidate.
271
+ */
106
272
  static fromSdp(sdp: string): RTCIceCandidate;
107
273
  static isThis(o: any): true | undefined;
108
274
  toJSON(): {
@@ -127,8 +293,13 @@ export declare class IceCandidate {
127
293
  sdpMid?: string;
128
294
  sdpMLineIndex?: number;
129
295
  tcpType?: string;
130
- constructor(component: number, foundation: string, ip: string, port: number, priority: number, protocol: string, type: string, generation?: number | undefined, ufrag?: string | undefined);
296
+ constructor(component: number, foundation: string, ip: string, port: number, priority: number, protocol: string, type: string, generation?: number, ufrag?: string);
297
+ /** The parsed fields are validated from these typed values, not by reparsing. */
131
298
  toJSON(): RTCIceCandidate;
299
+ /**
300
+ * Returns `undefined` when `data.candidate` is empty or violates the grammar
301
+ * documented on {@link RTCIceCandidateFields}.
302
+ */
132
303
  static fromJSON(data: RTCIceCandidate | RTCIceCandidateInit): IceCandidate | undefined;
133
304
  }
134
305
  export declare class RTCIceParameters {