@telperion/messenger 8.4.0 → 8.5.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 (245) hide show
  1. package/.build-manifest.json +416 -0
  2. package/README.md +30 -1
  3. package/broadcast/default-channel-name.cjs +6 -4
  4. package/broadcast/default-channel-name.cjs.map +1 -0
  5. package/broadcast/default-channel-name.d.cts +3 -0
  6. package/broadcast/default-channel-name.d.ts +3 -1
  7. package/broadcast/default-channel-name.js +2 -1
  8. package/broadcast/default-channel-name.js.map +1 -1
  9. package/broadcast/index.cjs +16 -13
  10. package/broadcast/index.cjs.map +1 -0
  11. package/broadcast/index.d.cts +11 -0
  12. package/broadcast/index.d.ts +11 -5
  13. package/broadcast/index.js +5 -6
  14. package/broadcast/index.js.map +1 -1
  15. package/broadcast/message-client.cjs +15 -13
  16. package/broadcast/message-client.cjs.map +1 -0
  17. package/broadcast/message-client.d.cts +15 -0
  18. package/broadcast/message-client.d.ts +9 -6
  19. package/broadcast/message-client.js +7 -5
  20. package/broadcast/message-client.js.map +1 -1
  21. package/broadcast/message-host.cjs +14 -12
  22. package/broadcast/message-host.cjs.map +1 -0
  23. package/broadcast/message-host.d.cts +14 -0
  24. package/broadcast/message-host.d.ts +9 -4
  25. package/broadcast/message-host.js +7 -5
  26. package/broadcast/message-host.js.map +1 -1
  27. package/broadcast/message-service.cjs +11 -9
  28. package/broadcast/message-service.cjs.map +1 -0
  29. package/broadcast/message-service.d.cts +15 -0
  30. package/broadcast/message-service.d.ts +10 -3
  31. package/broadcast/message-service.js +7 -5
  32. package/broadcast/message-service.js.map +1 -1
  33. package/chrome/default-connection-name.cjs +6 -4
  34. package/chrome/default-connection-name.cjs.map +1 -0
  35. package/chrome/default-connection-name.d.cts +3 -0
  36. package/chrome/default-connection-name.d.ts +3 -1
  37. package/chrome/default-connection-name.js +2 -1
  38. package/chrome/default-connection-name.js.map +1 -1
  39. package/chrome/index.cjs +14 -11
  40. package/chrome/index.cjs.map +1 -0
  41. package/chrome/index.d.cts +10 -0
  42. package/chrome/index.d.ts +10 -4
  43. package/chrome/index.js +4 -5
  44. package/chrome/index.js.map +1 -1
  45. package/chrome/message-client.cjs +18 -16
  46. package/chrome/message-client.cjs.map +1 -0
  47. package/chrome/message-client.d.cts +17 -0
  48. package/chrome/message-client.d.ts +8 -6
  49. package/chrome/message-client.js +6 -4
  50. package/chrome/message-client.js.map +1 -1
  51. package/chrome/message-host.cjs +15 -13
  52. package/chrome/message-host.cjs.map +1 -0
  53. package/chrome/message-host.d.cts +14 -0
  54. package/chrome/message-host.d.ts +9 -4
  55. package/chrome/message-host.js +6 -4
  56. package/chrome/message-host.js.map +1 -1
  57. package/fesm/messenger.mjs +125 -0
  58. package/fesm/messenger.mjs.map +1 -0
  59. package/iframe/channel-path-splitter.cjs +6 -4
  60. package/iframe/channel-path-splitter.cjs.map +1 -0
  61. package/iframe/channel-path-splitter.d.cts +3 -0
  62. package/iframe/channel-path-splitter.d.ts +3 -1
  63. package/iframe/channel-path-splitter.js +2 -1
  64. package/iframe/channel-path-splitter.js.map +1 -1
  65. package/iframe/default-channel-name.cjs +6 -4
  66. package/iframe/default-channel-name.cjs.map +1 -0
  67. package/iframe/default-channel-name.d.cts +3 -0
  68. package/iframe/default-channel-name.d.ts +3 -1
  69. package/iframe/default-channel-name.js +2 -1
  70. package/iframe/default-channel-name.js.map +1 -1
  71. package/iframe/iframe.type.cjs +3 -2
  72. package/iframe/iframe.type.cjs.map +1 -0
  73. package/iframe/iframe.type.d.cts +6 -0
  74. package/iframe/iframe.type.d.ts +6 -4
  75. package/iframe/iframe.type.js +0 -1
  76. package/iframe/iframe.type.js.map +1 -1
  77. package/iframe/index.cjs +16 -13
  78. package/iframe/index.cjs.map +1 -0
  79. package/iframe/index.d.cts +13 -0
  80. package/iframe/index.d.ts +13 -6
  81. package/iframe/index.js +5 -6
  82. package/iframe/index.js.map +1 -1
  83. package/iframe/message-client.cjs +26 -24
  84. package/iframe/message-client.cjs.map +1 -0
  85. package/iframe/message-client.d.cts +19 -0
  86. package/iframe/message-client.d.ts +9 -7
  87. package/iframe/message-client.js +7 -5
  88. package/iframe/message-client.js.map +1 -1
  89. package/iframe/message-host.cjs +30 -28
  90. package/iframe/message-host.cjs.map +1 -0
  91. package/iframe/message-host.d.cts +23 -0
  92. package/iframe/message-host.d.ts +10 -6
  93. package/iframe/message-host.js +8 -6
  94. package/iframe/message-host.js.map +1 -1
  95. package/iframe/message-service.cjs +13 -11
  96. package/iframe/message-service.cjs.map +1 -0
  97. package/iframe/message-service.d.cts +18 -0
  98. package/iframe/message-service.d.ts +11 -4
  99. package/iframe/message-service.js +7 -5
  100. package/iframe/message-service.js.map +1 -1
  101. package/iframe/source-id-splitter.cjs +6 -4
  102. package/iframe/source-id-splitter.cjs.map +1 -0
  103. package/iframe/source-id-splitter.d.cts +3 -0
  104. package/iframe/source-id-splitter.d.ts +3 -1
  105. package/iframe/source-id-splitter.js +2 -1
  106. package/iframe/source-id-splitter.js.map +1 -1
  107. package/iframe/upcoming-message.cjs +3 -2
  108. package/iframe/upcoming-message.cjs.map +1 -0
  109. package/iframe/upcoming-message.d.cts +6 -0
  110. package/iframe/upcoming-message.d.ts +3 -1
  111. package/iframe/upcoming-message.js +0 -1
  112. package/iframe/upcoming-message.js.map +1 -1
  113. package/index.cjs +22 -13
  114. package/index.cjs.map +1 -0
  115. package/index.d.cts +8 -0
  116. package/index.d.ts +8 -7
  117. package/index.js +5 -6
  118. package/index.js.map +1 -1
  119. package/listen.decorator.cjs +11 -8
  120. package/listen.decorator.cjs.map +1 -0
  121. package/listen.decorator.d.cts +8 -0
  122. package/listen.decorator.d.ts +3 -1
  123. package/listen.decorator.js +4 -2
  124. package/listen.decorator.js.map +1 -1
  125. package/listener-storage.type.cjs +3 -2
  126. package/listener-storage.type.cjs.map +1 -0
  127. package/listener-storage.type.d.cts +5 -0
  128. package/listener-storage.type.d.ts +4 -1
  129. package/listener-storage.type.js +0 -1
  130. package/listener-storage.type.js.map +1 -1
  131. package/message-client.cjs +4 -4
  132. package/message-client.cjs.map +1 -0
  133. package/message-client.d.cts +26 -0
  134. package/message-client.d.ts +8 -5
  135. package/message-client.js +2 -2
  136. package/message-client.js.map +1 -1
  137. package/message-host.cjs +20 -18
  138. package/message-host.cjs.map +1 -0
  139. package/message-host.d.cts +29 -0
  140. package/message-host.d.ts +8 -5
  141. package/message-host.js +5 -3
  142. package/message-host.js.map +1 -1
  143. package/message-response.type.cjs +3 -2
  144. package/message-response.type.cjs.map +1 -0
  145. package/message-response.type.d.cts +18 -0
  146. package/message-response.type.d.ts +8 -6
  147. package/message-response.type.js +0 -1
  148. package/message-response.type.js.map +1 -1
  149. package/message.interface.cjs +3 -2
  150. package/message.interface.cjs.map +1 -0
  151. package/message.interface.d.cts +8 -0
  152. package/message.interface.d.ts +3 -1
  153. package/message.interface.js +0 -1
  154. package/message.interface.js.map +1 -1
  155. package/package.json +387 -75
  156. package/request.decorator.cjs +32 -14
  157. package/request.decorator.cjs.map +1 -0
  158. package/request.decorator.d.cts +55 -0
  159. package/request.decorator.d.ts +55 -1
  160. package/request.decorator.js +26 -9
  161. package/request.decorator.js.map +1 -1
  162. package/rtc/channel-controller.cjs +6 -4
  163. package/rtc/channel-controller.cjs.map +1 -0
  164. package/rtc/channel-controller.d.cts +8 -0
  165. package/rtc/channel-controller.d.ts +3 -2
  166. package/rtc/channel-controller.js +2 -1
  167. package/rtc/channel-controller.js.map +1 -1
  168. package/rtc/default-channel-name.cjs +6 -4
  169. package/rtc/default-channel-name.cjs.map +1 -0
  170. package/rtc/default-channel-name.d.cts +4 -0
  171. package/rtc/default-channel-name.d.ts +3 -1
  172. package/rtc/default-channel-name.js +2 -1
  173. package/rtc/default-channel-name.js.map +1 -1
  174. package/rtc/index.cjs +16 -13
  175. package/rtc/index.cjs.map +1 -0
  176. package/rtc/index.d.cts +12 -0
  177. package/rtc/index.d.ts +12 -5
  178. package/rtc/index.js +5 -6
  179. package/rtc/index.js.map +1 -1
  180. package/rtc/initializer.cjs +23 -18
  181. package/rtc/initializer.cjs.map +1 -0
  182. package/rtc/initializer.d.cts +20 -0
  183. package/rtc/initializer.d.ts +7 -3
  184. package/rtc/initializer.js +11 -7
  185. package/rtc/initializer.js.map +1 -1
  186. package/rtc/message-client.cjs +63 -31
  187. package/rtc/message-client.cjs.map +1 -0
  188. package/rtc/message-client.d.cts +75 -0
  189. package/rtc/message-client.d.ts +17 -9
  190. package/rtc/message-client.js +40 -10
  191. package/rtc/message-client.js.map +1 -1
  192. package/rtc/message-host.cjs +40 -28
  193. package/rtc/message-host.cjs.map +1 -0
  194. package/rtc/message-host.d.cts +70 -0
  195. package/rtc/message-host.d.ts +12 -8
  196. package/rtc/message-host.js +18 -8
  197. package/rtc/message-host.js.map +1 -1
  198. package/rtc/message-service.cjs +17 -15
  199. package/rtc/message-service.cjs.map +1 -0
  200. package/rtc/message-service.d.cts +46 -0
  201. package/rtc/message-service.d.ts +11 -4
  202. package/rtc/message-service.js +11 -9
  203. package/rtc/message-service.js.map +1 -1
  204. package/rtc/rtc.type.cjs +3 -2
  205. package/rtc/rtc.type.cjs.map +1 -0
  206. package/rtc/rtc.type.d.cts +14 -0
  207. package/rtc/rtc.type.d.ts +6 -4
  208. package/rtc/rtc.type.js +0 -1
  209. package/rtc/rtc.type.js.map +1 -1
  210. package/selectors.cjs +18 -10
  211. package/selectors.cjs.map +1 -0
  212. package/selectors.d.cts +9 -0
  213. package/selectors.d.ts +9 -7
  214. package/selectors.js +8 -7
  215. package/selectors.js.map +1 -1
  216. package/worker/index.cjs +16 -13
  217. package/worker/index.cjs.map +1 -0
  218. package/worker/index.d.cts +12 -0
  219. package/worker/index.d.ts +12 -5
  220. package/worker/index.js +5 -6
  221. package/worker/index.js.map +1 -1
  222. package/worker/initializer.cjs +11 -8
  223. package/worker/initializer.cjs.map +1 -0
  224. package/worker/initializer.d.cts +15 -0
  225. package/worker/initializer.d.ts +8 -5
  226. package/worker/initializer.js +5 -3
  227. package/worker/initializer.js.map +1 -1
  228. package/worker/message-client.cjs +19 -17
  229. package/worker/message-client.cjs.map +1 -0
  230. package/worker/message-client.d.cts +133 -0
  231. package/worker/message-client.d.ts +10 -8
  232. package/worker/message-client.js +9 -7
  233. package/worker/message-client.js.map +1 -1
  234. package/worker/message-host.cjs +17 -15
  235. package/worker/message-host.cjs.map +1 -0
  236. package/worker/message-host.d.cts +135 -0
  237. package/worker/message-host.d.ts +10 -6
  238. package/worker/message-host.js +8 -6
  239. package/worker/message-host.js.map +1 -1
  240. package/worker/message-service.cjs +11 -9
  241. package/worker/message-service.cjs.map +1 -0
  242. package/worker/message-service.d.cts +124 -0
  243. package/worker/message-service.d.ts +11 -4
  244. package/worker/message-service.js +6 -4
  245. package/worker/message-service.js.map +1 -1
@@ -2,17 +2,18 @@ import { noop } from '@telperion/js-utils/function/noop';
2
2
  import { call } from '@telperion/js-utils/function/call';
3
3
  import { NEVER } from '@telperion/js-utils/promise/never';
4
4
  import { Subject } from 'rxjs';
5
- import { MessageHost } from '../message-host';
6
- import { LISTEN, RESPONSE } from '../selectors';
7
- import { DEFAULT_CHANNEL_NAME } from './default-channel-name';
8
- import { initialize } from './initializer';
5
+ import { MessageHost } from '../message-host.js';
6
+ import { LISTEN, RESPONSE } from '../selectors.js';
7
+ import { DEFAULT_CHANNEL_NAME } from './default-channel-name.js';
8
+ import { initialize } from './initializer.js';
9
+
9
10
  const CHANNEL_NAME = Symbol('RTCMessageHost Channel Name');
10
11
  const CHANNEL = Symbol('RTCMessageHost Channel');
11
12
  const CHANNEL_OPEN = Symbol('RTCMessageHost Channel Open');
12
13
  const DEINITIALIZE = Symbol('RTCMessageHost Deinitialize');
13
14
  const REQUESTS = Symbol('RTCMessageHost Requests');
14
- export const READY = Symbol('RTCMessageHost Ready');
15
- export const CREATED = Symbol('RTCMessageHost Created');
15
+ const READY = Symbol('RTCMessageHost Ready');
16
+ const CREATED = Symbol('RTCMessageHost Created');
16
17
  /**
17
18
  * WebRTC DataChannel message host that listens for incoming request messages
18
19
  * and dispatches responses over the same negotiated channel.
@@ -37,7 +38,7 @@ export const CREATED = Symbol('RTCMessageHost Created');
37
38
  * const host = new GameHost(peerConnection, 'game-events');
38
39
  * ```
39
40
  */
40
- export class RTCMessageHost extends MessageHost {
41
+ class RTCMessageHost extends MessageHost {
41
42
  [REQUESTS] = new Subject();
42
43
  [CHANNEL_NAME];
43
44
  [CHANNEL] = NEVER;
@@ -96,8 +97,17 @@ export class RTCMessageHost extends MessageHost {
96
97
  }
97
98
  async [RESPONSE](message) {
98
99
  const dataChannel = await this[CHANNEL_OPEN];
99
- dataChannel.send(JSON.stringify({ ...message, type: 'response' }));
100
+ // If the channel closed, the requester is gone, so the response is dropped.
101
+ if (dataChannel.readyState !== 'open')
102
+ return;
103
+ try {
104
+ dataChannel.send(JSON.stringify({ ...message, type: 'response' }));
105
+ }
106
+ catch {
107
+ // The channel closed while sending. The requester is gone, so drop it.
108
+ }
100
109
  }
101
110
  }
102
111
 
112
+ export { CREATED, READY, RTCMessageHost };
103
113
  //# sourceMappingURL=message-host.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../libs/messenger/src/rtc/message-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,YAAY,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAC3D,MAAM,OAAO,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AACjD,MAAM,YAAY,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAC3D,MAAM,YAAY,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAC3D,MAAM,QAAQ,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IACrC,CAAC,QAAQ,CAAC,GAAG,IAAI,OAAO,EAAW,CAAC;IACpC,CAAC,YAAY,CAAC,CAAS;IACvB,CAAC,OAAO,CAAC,GAA4B,KAAK,CAAC;IAC3C,CAAC,YAAY,CAAC,GAA4B,KAAK,CAAC;IAChD,CAAC,YAAY,CAAC,GAAwB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE,IAAY,CAAC,OAAO,CAAC;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED,yFAAyF;IACzF,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED,IAAY,CAAC,KAAK,CAAC;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,gFAAgF;IAChF,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,YACE,UAA6B,EAC7B,WAAW,GAAG,oBAAoB,EAClC,SAAkB;QAElB,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC;QACjC,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,UAA6B,EAAE,SAAkB;QAC1D,UAAU,CAAC;YACT,OAAO,EAAE,IAAI;YACb,SAAS,EAAE;gBACT,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,YAAY;gBACzB,MAAM,EAAE,YAAY;gBACpB,OAAO,EAAE,QAAQ;aAClB;YACD,UAAU;YACV,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC;YAC/B,SAAS;YACT,iBAAiB,EAAE,SAAS;SAC7B,CAAC,CAAC;IACL,CAAC;IAED,2DAA2D;IACpD,SAAS;QACd,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAwB;QACjD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC;QAE7C,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC;CACF","file":"message-host.js","sourcesContent":["import { noop } from '@telperion/js-utils/function/noop';\r\nimport { call } from '@telperion/js-utils/function/call';\r\nimport { NEVER } from '@telperion/js-utils/promise/never';\r\nimport { Subject } from 'rxjs';\r\n\r\nimport { MessageHost } from '../message-host';\r\nimport { MessageResponse } from '../message-response.type';\r\nimport { Message } from '../message.interface';\r\nimport { LISTEN, RESPONSE } from '../selectors';\r\nimport { RTCConnectionArg } from './rtc.type';\r\nimport { DEFAULT_CHANNEL_NAME } from './default-channel-name';\r\nimport { initialize } from './initializer';\r\n\r\nconst CHANNEL_NAME = Symbol('RTCMessageHost Channel Name');\r\nconst CHANNEL = Symbol('RTCMessageHost Channel');\r\nconst CHANNEL_OPEN = Symbol('RTCMessageHost Channel Open');\r\nconst DEINITIALIZE = Symbol('RTCMessageHost Deinitialize');\r\nconst REQUESTS = Symbol('RTCMessageHost Requests');\r\nexport const READY = Symbol('RTCMessageHost Ready');\r\nexport const CREATED = Symbol('RTCMessageHost Created');\r\n\r\n/**\r\n * WebRTC DataChannel message host that listens for incoming request messages\r\n * and dispatches responses over the same negotiated channel.\r\n *\r\n * Both peers must create the channel with an identical name and negotiated ID.\r\n * The ID is derived automatically from the channel name via an FNV-1a hash\r\n * unless an explicit `channelId` is supplied.\r\n *\r\n * Use `@Listen` decorators to register request handlers. The host begins\r\n * listening as soon as it is constructed; pass a connection later via\r\n * {@link initialize} if one is not available at construction time.\r\n *\r\n * @example\r\n * ```typescript\r\n * class GameHost extends RTCMessageHost {\r\n * @Listen('move')\r\n * handleMove({ data }: { data: [number, number] }): Observable<boolean> {\r\n * return of(applyMove(data));\r\n * }\r\n * }\r\n *\r\n * const host = new GameHost(peerConnection, 'game-events');\r\n * ```\r\n */\r\nexport class RTCMessageHost extends MessageHost {\r\n private [REQUESTS] = new Subject<Message>();\r\n private [CHANNEL_NAME]: string;\r\n private [CHANNEL]: Promise<RTCDataChannel> = NEVER;\r\n private [CHANNEL_OPEN]: Promise<RTCDataChannel> = NEVER;\r\n private [DEINITIALIZE]: Promise<() => void> = Promise.resolve(noop);\r\n\r\n private get [CREATED]() {\r\n return this[CHANNEL];\r\n }\r\n\r\n /** Resolves with the `RTCDataChannel` once it has been created (may not yet be open). */\r\n get created(): Promise<RTCDataChannel> {\r\n return this[CREATED];\r\n }\r\n\r\n private get [READY](): Promise<RTCDataChannel> {\r\n return this[CHANNEL_OPEN];\r\n }\r\n\r\n /** Resolves with the `RTCDataChannel` once it is open and ready to transmit. */\r\n get ready(): Promise<RTCDataChannel> {\r\n return this[READY];\r\n }\r\n\r\n /**\r\n * @param connection - RTCPeerConnection instance, promise, or factory function. Omit to initialize later via {@link initialize}.\r\n * @param channelName - Name for the negotiated data channel. Determines the channel ID via FNV-1a hash.\r\n * @param channelId - Explicit negotiated channel ID. Overrides the hash-derived default.\r\n */\r\n constructor(\r\n connection?: RTCConnectionArg,\r\n channelName = DEFAULT_CHANNEL_NAME,\r\n channelId?: number\r\n ) {\r\n super();\r\n\r\n this[CHANNEL_NAME] = channelName;\r\n RTCMessageHost.prototype.initialize.call(this, connection, channelId);\r\n this[LISTEN](this[REQUESTS]);\r\n }\r\n\r\n /**\r\n * (Re)initializes the data channel with a new connection.\r\n * Cleans up the previous channel before establishing a new one.\r\n *\r\n * @param connection - RTCPeerConnection instance, promise, or factory function.\r\n * @param channelId - Optional new channel ID. Defaults to the current channel ID.\r\n */\r\n initialize(connection?: RTCConnectionArg, channelId?: number): void {\r\n initialize({\r\n context: this,\r\n selectors: {\r\n channel: CHANNEL,\r\n channelOpen: CHANNEL_OPEN,\r\n deinit: DEINITIALIZE,\r\n emitter: REQUESTS\r\n },\r\n connection,\r\n channelName: this[CHANNEL_NAME],\r\n channelId,\r\n messageFilterType: 'request'\r\n });\r\n }\r\n\r\n /** Closes the data channel and removes event listeners. */\r\n public terminate(): void {\r\n this[DEINITIALIZE].then(call);\r\n }\r\n\r\n protected async [RESPONSE](message: MessageResponse) {\r\n const dataChannel = await this[CHANNEL_OPEN];\r\n\r\n dataChannel.send(JSON.stringify({...message, type: 'response' }));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"message-host.js","sources":["../../../../libs/messenger/src/rtc/message-host.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAaA,MAAM,YAAY,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC1D,MAAM,OAAO,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAChD,MAAM,YAAY,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC1D,MAAM,YAAY,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC1D,MAAM,QAAQ,GAAG,MAAM,CAAC,yBAAyB,CAAC;MACrC,KAAK,GAAG,MAAM,CAAC,sBAAsB;MACrC,OAAO,GAAG,MAAM,CAAC,wBAAwB;AAEtD;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,MAAO,cAAe,SAAQ,WAAW,CAAA;AACrC,IAAA,CAAC,QAAQ,IAAI,IAAI,OAAO,EAAW;IACnC,CAAC,YAAY;AACb,IAAA,CAAC,OAAO,IAA6B,KAAK;AAC1C,IAAA,CAAC,YAAY,IAA6B,KAAK;IAC/C,CAAC,YAAY,IAAyB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAEnE,KAAa,OAAO,CAAC,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB;;AAGA,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB;IAEA,KAAa,KAAK,CAAC,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B;;AAGA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB;AAEA;;;;AAIG;AACH,IAAA,WAAA,CACE,UAA6B,EAC7B,WAAW,GAAG,oBAAoB,EAClC,SAAkB,EAAA;AAElB,QAAA,KAAK,EAAE;AAEP,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,WAAW;AAChC,QAAA,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B;AAEA;;;;;;AAMG;IACH,UAAU,CAAC,UAA6B,EAAE,SAAkB,EAAA;AAC1D,QAAA,UAAU,CAAC;AACT,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,SAAS,EAAE;AACT,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,WAAW,EAAE,YAAY;AACzB,gBAAA,MAAM,EAAE,YAAY;AACpB,gBAAA,OAAO,EAAE;AACV,aAAA;YACD,UAAU;AACV,YAAA,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC;YAC/B,SAAS;AACT,YAAA,iBAAiB,EAAE;AACpB,SAAA,CAAC;IACJ;;IAGO,SAAS,GAAA;QACd,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAC/B;AAEU,IAAA,OAAO,QAAQ,CAAC,CAAC,OAAwB,EAAA;AACjD,QAAA,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC;;AAG5C,QAAA,IAAI,WAAW,CAAC,UAAU,KAAK,MAAM;YAAE;AAEvC,QAAA,IAAI;AACF,YAAA,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACnE;AAAE,QAAA,MAAM;;QAER;IACF;AACD;;;;"}
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RTCMessageService = void 0;
4
- const mixin_1 = require("@telperion/js-utils/class/mixin");
5
- const message_client_1 = require("./message-client");
6
- const message_host_1 = require("./message-host");
7
- const default_channel_name_1 = require("./default-channel-name");
1
+ 'use strict';
2
+
3
+ var mixin = require('@telperion/js-utils/class/mixin');
4
+ var rtc_messageClient = require('./message-client.cjs');
5
+ var rtc_messageHost = require('./message-host.cjs');
6
+ var rtc_defaultChannelName = require('./default-channel-name.cjs');
7
+
8
8
  /**
9
9
  * Bidirectional message service for WebRTC DataChannel communication.
10
10
  *
@@ -26,19 +26,19 @@ const default_channel_name_1 = require("./default-channel-name");
26
26
  * const peer = new GamePeer(peerConnection, 'game-events');
27
27
  * ```
28
28
  */
29
- class RTCMessageService extends (0, mixin_1.mixin)(message_host_1.RTCMessageHost, message_client_1.RTCMessageClient) {
29
+ class RTCMessageService extends mixin.mixin(rtc_messageHost.RTCMessageHost, rtc_messageClient.RTCMessageClient) {
30
30
  /**
31
31
  * @param connection - RTCPeerConnection instance, promise, or factory function.
32
32
  * @param channelName - Name for the negotiated data channel.
33
33
  * @param channelId - Explicit negotiated channel ID. Overrides the hash-derived default.
34
34
  */
35
- constructor(connection, channelName = default_channel_name_1.DEFAULT_CHANNEL_NAME, channelId) {
35
+ constructor(connection, channelName = rtc_defaultChannelName.DEFAULT_CHANNEL_NAME, channelId) {
36
36
  super([connection, channelName, channelId], [connection, channelName, channelId]);
37
37
  Reflect.defineProperty(this, 'ready', {
38
38
  get: () => {
39
39
  return Promise.race([
40
- this[message_client_1.READY],
41
- this[message_host_1.READY]
40
+ this[rtc_messageClient.READY],
41
+ this[rtc_messageHost.READY]
42
42
  ]);
43
43
  },
44
44
  configurable: false
@@ -46,16 +46,18 @@ class RTCMessageService extends (0, mixin_1.mixin)(message_host_1.RTCMessageHost
46
46
  Reflect.defineProperty(this, 'created', {
47
47
  get: () => {
48
48
  return Promise.race([
49
- this[message_client_1.CREATED],
50
- this[message_host_1.CREATED]
49
+ this[rtc_messageClient.CREATED],
50
+ this[rtc_messageHost.CREATED]
51
51
  ]);
52
52
  },
53
53
  configurable: false
54
54
  });
55
55
  }
56
56
  initialize = (connection, channelId) => {
57
- message_host_1.RTCMessageHost.prototype.initialize.call(this, connection, channelId);
58
- message_client_1.RTCMessageClient.prototype.initialize.call(this, connection, channelId);
57
+ rtc_messageHost.RTCMessageHost.prototype.initialize.call(this, connection, channelId);
58
+ rtc_messageClient.RTCMessageClient.prototype.initialize.call(this, connection, channelId);
59
59
  };
60
60
  }
61
+
61
62
  exports.RTCMessageService = RTCMessageService;
63
+ //# sourceMappingURL=message-service.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-service.cjs","sources":["../../../../libs/messenger/src/rtc/message-service.ts"],"sourcesContent":[null],"names":["mixin","RTCMessageHost","RTCMessageClient","DEFAULT_CHANNEL_NAME","CLIENT_READY","HOST_READY","CLIENT_CREATED","HOST_CREATED"],"mappings":";;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,MAAO,iBAAkB,SAAQA,WAAK,CAACC,8BAAc,EAAEC,kCAAgB,CAAC,CAAA;AAC5E;;;;AAIG;AACH,IAAA,WAAA,CAAY,UAA6B,EAAE,WAAW,GAAGC,2CAAoB,EAAE,SAAkB,EAAA;AAC/F,QAAA,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAEjF,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE;YACpC,GAAG,EAAE,MAAK;gBACR,OAAO,OAAO,CAAC,IAAI,CAAC;oBAClB,IAAI,CAACC,uBAAY,CAAC;oBACjB,IAAY,CAACC,qBAAU;AACzB,iBAAA,CAAC;YACJ,CAAC;AACD,YAAA,YAAY,EAAE;AACf,SAAA,CAAC;AAEF,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACtC,GAAG,EAAE,MAAK;gBACR,OAAO,OAAO,CAAC,IAAI,CAAC;oBAClB,IAAI,CAACC,yBAAc,CAAC;oBACnB,IAAY,CAACC,uBAAY;AAC3B,iBAAA,CAAC;YACJ,CAAC;AACD,YAAA,YAAY,EAAE;AACf,SAAA,CAAC;IACJ;AAEgB,IAAA,UAAU,GAAG,CAAC,UAA4B,EAAE,SAAkB,KAAU;AACtF,QAAAN,8BAAc,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;AACrE,QAAAC,kCAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;AACzE,IAAA,CAAC;AACF;;;;"}
@@ -0,0 +1,46 @@
1
+ import { RTCMessageClient } from './message-client.cjs';
2
+ import { RTCConnectionArg } from './rtc.type.cjs';
3
+ import 'rxjs';
4
+ import '../message-client.cjs';
5
+ import '../message-response.type.cjs';
6
+ import '../message.interface.cjs';
7
+ import '../selectors.cjs';
8
+
9
+ declare const RTCMessageService_base: new (args_0: [connection?: RTCConnectionArg, channelName?: string | undefined, channelId?: number | undefined], args_1: [connection?: RTCConnectionArg, channelName?: string | undefined, channelId?: number | undefined]) => {
10
+ readonly created: Promise<RTCDataChannel>;
11
+ readonly ready: Promise<RTCDataChannel>;
12
+ initialize: (connection?: RTCConnectionArg, channelId?: number) => void;
13
+ terminate: () => void;
14
+ } & RTCMessageClient;
15
+ /**
16
+ * Bidirectional message service for WebRTC DataChannel communication.
17
+ *
18
+ * Combines {@link RTCMessageHost} and {@link RTCMessageClient} via mixin,
19
+ * enabling both `@Listen` and `@Request` decorators on the same class.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * class GamePeer extends RTCMessageService {
24
+ * @Request('move')
25
+ * sendMove(pos: [number, number]): Observable<boolean> { return null!; }
26
+ *
27
+ * @Listen('move')
28
+ * handleMove({ data }: { data: [number, number] }): Observable<boolean> {
29
+ * return of(applyMove(data));
30
+ * }
31
+ * }
32
+ *
33
+ * const peer = new GamePeer(peerConnection, 'game-events');
34
+ * ```
35
+ */
36
+ declare class RTCMessageService extends RTCMessageService_base {
37
+ /**
38
+ * @param connection - RTCPeerConnection instance, promise, or factory function.
39
+ * @param channelName - Name for the negotiated data channel.
40
+ * @param channelId - Explicit negotiated channel ID. Overrides the hash-derived default.
41
+ */
42
+ constructor(connection?: RTCConnectionArg, channelName?: string, channelId?: number);
43
+ initialize: (connection: RTCConnectionArg, channelId?: number) => void;
44
+ }
45
+
46
+ export { RTCMessageService };
@@ -1,5 +1,11 @@
1
- import { RTCMessageClient } from "./message-client";
2
- import { RTCConnectionArg } from "./rtc.type";
1
+ import { RTCMessageClient } from './message-client.js';
2
+ import { RTCConnectionArg } from './rtc.type.js';
3
+ import 'rxjs';
4
+ import '../message-client.js';
5
+ import '../message-response.type.js';
6
+ import '../message.interface.js';
7
+ import '../selectors.js';
8
+
3
9
  declare const RTCMessageService_base: new (args_0: [connection?: RTCConnectionArg, channelName?: string | undefined, channelId?: number | undefined], args_1: [connection?: RTCConnectionArg, channelName?: string | undefined, channelId?: number | undefined]) => {
4
10
  readonly created: Promise<RTCDataChannel>;
5
11
  readonly ready: Promise<RTCDataChannel>;
@@ -27,7 +33,7 @@ declare const RTCMessageService_base: new (args_0: [connection?: RTCConnectionAr
27
33
  * const peer = new GamePeer(peerConnection, 'game-events');
28
34
  * ```
29
35
  */
30
- export declare class RTCMessageService extends RTCMessageService_base {
36
+ declare class RTCMessageService extends RTCMessageService_base {
31
37
  /**
32
38
  * @param connection - RTCPeerConnection instance, promise, or factory function.
33
39
  * @param channelName - Name for the negotiated data channel.
@@ -36,4 +42,5 @@ export declare class RTCMessageService extends RTCMessageService_base {
36
42
  constructor(connection?: RTCConnectionArg, channelName?: string, channelId?: number);
37
43
  initialize: (connection: RTCConnectionArg, channelId?: number) => void;
38
44
  }
39
- export {};
45
+
46
+ export { RTCMessageService };
@@ -1,7 +1,8 @@
1
- import { mixin } from "@telperion/js-utils/class/mixin";
2
- import { READY as CLIENT_READY, CREATED as CLIENT_CREATED, RTCMessageClient } from "./message-client";
3
- import { READY as HOST_READY, CREATED as HOST_CREATED, RTCMessageHost } from "./message-host";
4
- import { DEFAULT_CHANNEL_NAME } from "./default-channel-name";
1
+ import { mixin } from '@telperion/js-utils/class/mixin';
2
+ import { RTCMessageClient, READY, CREATED } from './message-client.js';
3
+ import { RTCMessageHost, READY as READY$1, CREATED as CREATED$1 } from './message-host.js';
4
+ import { DEFAULT_CHANNEL_NAME } from './default-channel-name.js';
5
+
5
6
  /**
6
7
  * Bidirectional message service for WebRTC DataChannel communication.
7
8
  *
@@ -23,7 +24,7 @@ import { DEFAULT_CHANNEL_NAME } from "./default-channel-name";
23
24
  * const peer = new GamePeer(peerConnection, 'game-events');
24
25
  * ```
25
26
  */
26
- export class RTCMessageService extends mixin(RTCMessageHost, RTCMessageClient) {
27
+ class RTCMessageService extends mixin(RTCMessageHost, RTCMessageClient) {
27
28
  /**
28
29
  * @param connection - RTCPeerConnection instance, promise, or factory function.
29
30
  * @param channelName - Name for the negotiated data channel.
@@ -34,8 +35,8 @@ export class RTCMessageService extends mixin(RTCMessageHost, RTCMessageClient) {
34
35
  Reflect.defineProperty(this, 'ready', {
35
36
  get: () => {
36
37
  return Promise.race([
37
- this[CLIENT_READY],
38
- this[HOST_READY]
38
+ this[READY],
39
+ this[READY$1]
39
40
  ]);
40
41
  },
41
42
  configurable: false
@@ -43,8 +44,8 @@ export class RTCMessageService extends mixin(RTCMessageHost, RTCMessageClient) {
43
44
  Reflect.defineProperty(this, 'created', {
44
45
  get: () => {
45
46
  return Promise.race([
46
- this[CLIENT_CREATED],
47
- this[HOST_CREATED]
47
+ this[CREATED],
48
+ this[CREATED$1]
48
49
  ]);
49
50
  },
50
51
  configurable: false
@@ -56,4 +57,5 @@ export class RTCMessageService extends mixin(RTCMessageHost, RTCMessageClient) {
56
57
  };
57
58
  }
58
59
 
60
+ export { RTCMessageService };
59
61
  //# sourceMappingURL=message-service.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../libs/messenger/src/rtc/message-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,OAAO,IAAI,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,OAAO,IAAI,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAC5E;;;;OAIG;IACH,YAAY,UAA6B,EAAE,WAAW,GAAG,oBAAoB,EAAE,SAAkB;QAC/F,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;QAElF,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE;YACpC,GAAG,EAAE,GAAG,EAAE;gBACR,OAAO,OAAO,CAAC,IAAI,CAAC;oBAClB,IAAI,CAAC,YAAY,CAAC;oBACjB,IAAY,CAAC,UAAU,CAAC;iBAC1B,CAAC,CAAC;YACL,CAAC;YACD,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACtC,GAAG,EAAE,GAAG,EAAE;gBACR,OAAO,OAAO,CAAC,IAAI,CAAC;oBAClB,IAAI,CAAC,cAAc,CAAC;oBACnB,IAAY,CAAC,YAAY,CAAC;iBAC5B,CAAC,CAAC;YACL,CAAC;YACD,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IAEe,UAAU,GAAG,CAAC,UAA4B,EAAE,SAAkB,EAAQ,EAAE;QACtF,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QACtE,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC1E,CAAC,CAAC;CACH","file":"message-service.js","sourcesContent":["import { mixin } from \"@telperion/js-utils/class/mixin\";\r\n\r\nimport { READY as CLIENT_READY, CREATED as CLIENT_CREATED, RTCMessageClient } from \"./message-client\";\r\nimport { READY as HOST_READY, CREATED as HOST_CREATED, RTCMessageHost } from \"./message-host\";\r\nimport { RTCConnectionArg } from \"./rtc.type\";\r\nimport { DEFAULT_CHANNEL_NAME } from \"./default-channel-name\";\r\n\r\n/**\r\n * Bidirectional message service for WebRTC DataChannel communication.\r\n *\r\n * Combines {@link RTCMessageHost} and {@link RTCMessageClient} via mixin,\r\n * enabling both `@Listen` and `@Request` decorators on the same class.\r\n *\r\n * @example\r\n * ```typescript\r\n * class GamePeer extends RTCMessageService {\r\n * @Request('move')\r\n * sendMove(pos: [number, number]): Observable<boolean> { return null!; }\r\n *\r\n * @Listen('move')\r\n * handleMove({ data }: { data: [number, number] }): Observable<boolean> {\r\n * return of(applyMove(data));\r\n * }\r\n * }\r\n *\r\n * const peer = new GamePeer(peerConnection, 'game-events');\r\n * ```\r\n */\r\nexport class RTCMessageService extends mixin(RTCMessageHost, RTCMessageClient) {\r\n /**\r\n * @param connection - RTCPeerConnection instance, promise, or factory function.\r\n * @param channelName - Name for the negotiated data channel.\r\n * @param channelId - Explicit negotiated channel ID. Overrides the hash-derived default.\r\n */\r\n constructor(connection?: RTCConnectionArg, channelName = DEFAULT_CHANNEL_NAME, channelId?: number) {\r\n super([connection, channelName, channelId], [connection, channelName, channelId]);\r\n\r\n Reflect.defineProperty(this, 'ready', {\r\n get: () => {\r\n return Promise.race([\r\n this[CLIENT_READY],\r\n (this as any)[HOST_READY]\r\n ]);\r\n },\r\n configurable: false\r\n });\r\n\r\n Reflect.defineProperty(this, 'created', {\r\n get: () => {\r\n return Promise.race([\r\n this[CLIENT_CREATED],\r\n (this as any)[HOST_CREATED]\r\n ]);\r\n },\r\n configurable: false\r\n });\r\n }\r\n\r\n public override initialize = (connection: RTCConnectionArg, channelId?: number): void => {\r\n RTCMessageHost.prototype.initialize.call(this, connection, channelId);\r\n RTCMessageClient.prototype.initialize.call(this, connection, channelId);\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"message-service.js","sources":["../../../../libs/messenger/src/rtc/message-service.ts"],"sourcesContent":[null],"names":["CLIENT_READY","HOST_READY","CLIENT_CREATED","HOST_CREATED"],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,MAAO,iBAAkB,SAAQ,KAAK,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAA;AAC5E;;;;AAIG;AACH,IAAA,WAAA,CAAY,UAA6B,EAAE,WAAW,GAAG,oBAAoB,EAAE,SAAkB,EAAA;AAC/F,QAAA,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAEjF,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE;YACpC,GAAG,EAAE,MAAK;gBACR,OAAO,OAAO,CAAC,IAAI,CAAC;oBAClB,IAAI,CAACA,KAAY,CAAC;oBACjB,IAAY,CAACC,OAAU;AACzB,iBAAA,CAAC;YACJ,CAAC;AACD,YAAA,YAAY,EAAE;AACf,SAAA,CAAC;AAEF,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACtC,GAAG,EAAE,MAAK;gBACR,OAAO,OAAO,CAAC,IAAI,CAAC;oBAClB,IAAI,CAACC,OAAc,CAAC;oBACnB,IAAY,CAACC,SAAY;AAC3B,iBAAA,CAAC;YACJ,CAAC;AACD,YAAA,YAAY,EAAE;AACf,SAAA,CAAC;IACJ;AAEgB,IAAA,UAAU,GAAG,CAAC,UAA4B,EAAE,SAAkB,KAAU;AACtF,QAAA,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;AACrE,QAAA,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;AACzE,IAAA,CAAC;AACF;;;;"}
package/rtc/rtc.type.cjs CHANGED
@@ -1,2 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=rtc.type.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtc.type.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,14 @@
1
+ /** An RTCPeerConnection instance or `undefined` if not yet available. */
2
+ type RTCConnectionType = RTCPeerConnection | undefined;
3
+ /** A promise that resolves to an RTCPeerConnection (or `undefined`). */
4
+ type RTCConnectionPromise = Promise<RTCConnectionType>;
5
+ /** A factory function that returns an RTCPeerConnection synchronously or asynchronously. */
6
+ type RTCConnectionFactory = () => RTCConnectionType | RTCConnectionPromise;
7
+ /**
8
+ * Flexible connection argument accepted by RTC message classes.
9
+ *
10
+ * Supports direct instances, promises, and factory functions for lazy or async initialization.
11
+ */
12
+ type RTCConnectionArg = RTCConnectionType | RTCConnectionPromise | RTCConnectionFactory;
13
+
14
+ export type { RTCConnectionArg, RTCConnectionFactory, RTCConnectionPromise, RTCConnectionType };
package/rtc/rtc.type.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  /** An RTCPeerConnection instance or `undefined` if not yet available. */
2
- export type RTCConnectionType = RTCPeerConnection | undefined;
2
+ type RTCConnectionType = RTCPeerConnection | undefined;
3
3
  /** A promise that resolves to an RTCPeerConnection (or `undefined`). */
4
- export type RTCConnectionPromise = Promise<RTCConnectionType>;
4
+ type RTCConnectionPromise = Promise<RTCConnectionType>;
5
5
  /** A factory function that returns an RTCPeerConnection synchronously or asynchronously. */
6
- export type RTCConnectionFactory = () => RTCConnectionType | RTCConnectionPromise;
6
+ type RTCConnectionFactory = () => RTCConnectionType | RTCConnectionPromise;
7
7
  /**
8
8
  * Flexible connection argument accepted by RTC message classes.
9
9
  *
10
10
  * Supports direct instances, promises, and factory functions for lazy or async initialization.
11
11
  */
12
- export type RTCConnectionArg = RTCConnectionType | RTCConnectionPromise | RTCConnectionFactory;
12
+ type RTCConnectionArg = RTCConnectionType | RTCConnectionPromise | RTCConnectionFactory;
13
+
14
+ export type { RTCConnectionArg, RTCConnectionFactory, RTCConnectionPromise, RTCConnectionType };
package/rtc/rtc.type.js CHANGED
@@ -1,3 +1,2 @@
1
- export {};
2
1
 
3
2
  //# sourceMappingURL=rtc.type.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../libs/messenger/src/rtc/rtc.type.ts"],"names":[],"mappings":"","file":"rtc.type.js","sourcesContent":["/** An RTCPeerConnection instance or `undefined` if not yet available. */\r\nexport type RTCConnectionType = RTCPeerConnection | undefined;\r\n\r\n/** A promise that resolves to an RTCPeerConnection (or `undefined`). */\r\nexport type RTCConnectionPromise = Promise<RTCConnectionType>;\r\n\r\n/** A factory function that returns an RTCPeerConnection synchronously or asynchronously. */\r\nexport type RTCConnectionFactory = () => RTCConnectionType | RTCConnectionPromise;\r\n\r\n/**\r\n * Flexible connection argument accepted by RTC message classes.\r\n *\r\n * Supports direct instances, promises, and factory functions for lazy or async initialization.\r\n */\r\nexport type RTCConnectionArg = RTCConnectionType | RTCConnectionPromise | RTCConnectionFactory;\r\n"]}
1
+ {"version":3,"file":"rtc.type.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/selectors.cjs CHANGED
@@ -1,10 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RESPONSE = exports.TERMINATE_MESSAGE$ = exports.LISTEN = exports.GET_NEW_ID = exports.SEND = exports.RESPONSES$ = exports.MESSAGE_LISTENERS = void 0;
4
- exports.MESSAGE_LISTENERS = Symbol('Message Listeners');
5
- exports.RESPONSES$ = Symbol('Responses');
6
- exports.SEND = Symbol('Send');
7
- exports.GET_NEW_ID = Symbol('Get New Id');
8
- exports.LISTEN = Symbol('Listen');
9
- exports.TERMINATE_MESSAGE$ = Symbol('Terminate Message');
10
- exports.RESPONSE = Symbol('Response');
1
+ 'use strict';
2
+
3
+ const MESSAGE_LISTENERS = Symbol('Message Listeners');
4
+ const RESPONSES$ = Symbol('Responses');
5
+ const SEND = Symbol('Send');
6
+ const GET_NEW_ID = Symbol('Get New Id');
7
+ const LISTEN = Symbol('Listen');
8
+ const TERMINATE_MESSAGE$ = Symbol('Terminate Message');
9
+ const RESPONSE = Symbol('Response');
10
+
11
+ exports.GET_NEW_ID = GET_NEW_ID;
12
+ exports.LISTEN = LISTEN;
13
+ exports.MESSAGE_LISTENERS = MESSAGE_LISTENERS;
14
+ exports.RESPONSE = RESPONSE;
15
+ exports.RESPONSES$ = RESPONSES$;
16
+ exports.SEND = SEND;
17
+ exports.TERMINATE_MESSAGE$ = TERMINATE_MESSAGE$;
18
+ //# sourceMappingURL=selectors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.cjs","sources":["../../../libs/messenger/src/selectors.ts"],"sourcesContent":[null],"names":[],"mappings":";;MAAa,iBAAiB,GAAG,MAAM,CAAC,mBAAmB;MAC9C,UAAU,GAAG,MAAM,CAAC,WAAW;MAC/B,IAAI,GAAG,MAAM,CAAC,MAAM;MACpB,UAAU,GAAG,MAAM,CAAC,YAAY;MAChC,MAAM,GAAG,MAAM,CAAC,QAAQ;MACxB,kBAAkB,GAAG,MAAM,CAAC,mBAAmB;MAC/C,QAAQ,GAAG,MAAM,CAAC,UAAU;;;;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ declare const MESSAGE_LISTENERS: unique symbol;
2
+ declare const RESPONSES$: unique symbol;
3
+ declare const SEND: unique symbol;
4
+ declare const GET_NEW_ID: unique symbol;
5
+ declare const LISTEN: unique symbol;
6
+ declare const TERMINATE_MESSAGE$: unique symbol;
7
+ declare const RESPONSE: unique symbol;
8
+
9
+ export { GET_NEW_ID, LISTEN, MESSAGE_LISTENERS, RESPONSE, RESPONSES$, SEND, TERMINATE_MESSAGE$ };
package/selectors.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- export declare const MESSAGE_LISTENERS: unique symbol;
2
- export declare const RESPONSES$: unique symbol;
3
- export declare const SEND: unique symbol;
4
- export declare const GET_NEW_ID: unique symbol;
5
- export declare const LISTEN: unique symbol;
6
- export declare const TERMINATE_MESSAGE$: unique symbol;
7
- export declare const RESPONSE: unique symbol;
1
+ declare const MESSAGE_LISTENERS: unique symbol;
2
+ declare const RESPONSES$: unique symbol;
3
+ declare const SEND: unique symbol;
4
+ declare const GET_NEW_ID: unique symbol;
5
+ declare const LISTEN: unique symbol;
6
+ declare const TERMINATE_MESSAGE$: unique symbol;
7
+ declare const RESPONSE: unique symbol;
8
+
9
+ export { GET_NEW_ID, LISTEN, MESSAGE_LISTENERS, RESPONSE, RESPONSES$, SEND, TERMINATE_MESSAGE$ };
package/selectors.js CHANGED
@@ -1,9 +1,10 @@
1
- export const MESSAGE_LISTENERS = Symbol('Message Listeners');
2
- export const RESPONSES$ = Symbol('Responses');
3
- export const SEND = Symbol('Send');
4
- export const GET_NEW_ID = Symbol('Get New Id');
5
- export const LISTEN = Symbol('Listen');
6
- export const TERMINATE_MESSAGE$ = Symbol('Terminate Message');
7
- export const RESPONSE = Symbol('Response');
1
+ const MESSAGE_LISTENERS = Symbol('Message Listeners');
2
+ const RESPONSES$ = Symbol('Responses');
3
+ const SEND = Symbol('Send');
4
+ const GET_NEW_ID = Symbol('Get New Id');
5
+ const LISTEN = Symbol('Listen');
6
+ const TERMINATE_MESSAGE$ = Symbol('Terminate Message');
7
+ const RESPONSE = Symbol('Response');
8
8
 
9
+ export { GET_NEW_ID, LISTEN, MESSAGE_LISTENERS, RESPONSE, RESPONSES$, SEND, TERMINATE_MESSAGE$ };
9
10
  //# sourceMappingURL=selectors.js.map
package/selectors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../libs/messenger/src/selectors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC","file":"selectors.js","sourcesContent":["export const MESSAGE_LISTENERS = Symbol('Message Listeners');\nexport const RESPONSES$ = Symbol('Responses');\nexport const SEND = Symbol('Send');\nexport const GET_NEW_ID = Symbol('Get New Id');\nexport const LISTEN = Symbol('Listen');\nexport const TERMINATE_MESSAGE$ = Symbol('Terminate Message');\nexport const RESPONSE = Symbol('Response');\n"]}
1
+ {"version":3,"file":"selectors.js","sources":["../../../libs/messenger/src/selectors.ts"],"sourcesContent":[null],"names":[],"mappings":"MAAa,iBAAiB,GAAG,MAAM,CAAC,mBAAmB;MAC9C,UAAU,GAAG,MAAM,CAAC,WAAW;MAC/B,IAAI,GAAG,MAAM,CAAC,MAAM;MACpB,UAAU,GAAG,MAAM,CAAC,YAAY;MAChC,MAAM,GAAG,MAAM,CAAC,QAAQ;MACxB,kBAAkB,GAAG,MAAM,CAAC,mBAAmB;MAC/C,QAAQ,GAAG,MAAM,CAAC,UAAU;;;;"}
package/worker/index.cjs CHANGED
@@ -1,13 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Listen = exports.Request = exports.WorkerMessageHost = exports.WorkerMessageClient = exports.WorkerMessageService = void 0;
4
- var message_service_1 = require("./message-service");
5
- Object.defineProperty(exports, "WorkerMessageService", { enumerable: true, get: function () { return message_service_1.WorkerMessageService; } });
6
- var message_client_1 = require("./message-client");
7
- Object.defineProperty(exports, "WorkerMessageClient", { enumerable: true, get: function () { return message_client_1.WorkerMessageClient; } });
8
- var message_host_1 = require("./message-host");
9
- Object.defineProperty(exports, "WorkerMessageHost", { enumerable: true, get: function () { return message_host_1.WorkerMessageHost; } });
10
- var request_decorator_1 = require("../request.decorator");
11
- Object.defineProperty(exports, "Request", { enumerable: true, get: function () { return request_decorator_1.Request; } });
12
- var listen_decorator_1 = require("../listen.decorator");
13
- Object.defineProperty(exports, "Listen", { enumerable: true, get: function () { return listen_decorator_1.Listen; } });
1
+ 'use strict';
2
+
3
+ var worker_messageService = require('./message-service.cjs');
4
+ var worker_messageClient = require('./message-client.cjs');
5
+ var worker_messageHost = require('./message-host.cjs');
6
+ var request_decorator = require('../request.decorator.cjs');
7
+ var listen_decorator = require('../listen.decorator.cjs');
8
+
9
+
10
+
11
+ exports.WorkerMessageService = worker_messageService.WorkerMessageService;
12
+ exports.WorkerMessageClient = worker_messageClient.WorkerMessageClient;
13
+ exports.WorkerMessageHost = worker_messageHost.WorkerMessageHost;
14
+ exports.Request = request_decorator.Request;
15
+ exports.Listen = listen_decorator.Listen;
16
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ export { WorkerMessageService } from './message-service.cjs';
2
+ export { WorkerMessageClient } from './message-client.cjs';
3
+ export { WorkerMessageHost } from './message-host.cjs';
4
+ export { Request, RequestOptions, SingleRequestDecorator } from '../request.decorator.cjs';
5
+ export { Listen } from '../listen.decorator.cjs';
6
+ import './initializer.cjs';
7
+ import 'rxjs';
8
+ import '../message-client.cjs';
9
+ import '../message-response.type.cjs';
10
+ import '../message.interface.cjs';
11
+ import '../selectors.cjs';
12
+ import '../message-host.cjs';
package/worker/index.d.ts CHANGED
@@ -1,5 +1,12 @@
1
- export { WorkerMessageService } from './message-service';
2
- export { WorkerMessageClient } from './message-client';
3
- export { WorkerMessageHost } from './message-host';
4
- export { Request } from '../request.decorator';
5
- export { Listen } from '../listen.decorator';
1
+ export { WorkerMessageService } from './message-service.js';
2
+ export { WorkerMessageClient } from './message-client.js';
3
+ export { WorkerMessageHost } from './message-host.js';
4
+ export { Request, RequestOptions, SingleRequestDecorator } from '../request.decorator.js';
5
+ export { Listen } from '../listen.decorator.js';
6
+ import './initializer.js';
7
+ import 'rxjs';
8
+ import '../message-client.js';
9
+ import '../message-response.type.js';
10
+ import '../message.interface.js';
11
+ import '../selectors.js';
12
+ import '../message-host.js';
package/worker/index.js CHANGED
@@ -1,7 +1,6 @@
1
- export { WorkerMessageService } from './message-service';
2
- export { WorkerMessageClient } from './message-client';
3
- export { WorkerMessageHost } from './message-host';
4
- export { Request } from '../request.decorator';
5
- export { Listen } from '../listen.decorator';
6
-
1
+ export { WorkerMessageService } from './message-service.js';
2
+ export { WorkerMessageClient } from './message-client.js';
3
+ export { WorkerMessageHost } from './message-host.js';
4
+ export { Request } from '../request.decorator.js';
5
+ export { Listen } from '../listen.decorator.js';
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../libs/messenger/src/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC","file":"index.js","sourcesContent":["export { WorkerMessageService } from './message-service';\nexport { WorkerMessageClient } from './message-client';\nexport { WorkerMessageHost } from './message-host';\nexport { Request } from '../request.decorator';\nexport { Listen } from '../listen.decorator';\n"]}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,8 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initializer = initializer;
4
- const noop_1 = require("@telperion/js-utils/function/noop");
5
- const promisify_1 = require("@telperion/js-utils/promise/promisify");
1
+ 'use strict';
2
+
3
+ var noop = require('@telperion/js-utils/function/noop');
4
+ var promisify = require('@telperion/js-utils/promise/promisify');
5
+
6
6
  /**
7
7
  * Initializes a Web Worker or the worker context for message communication.
8
8
  * @param prevWorker The previous worker promise to deinitialize
@@ -19,11 +19,11 @@ function initializer(prevWorker, worker, handler) {
19
19
  else {
20
20
  removeEventListener('message', handler);
21
21
  }
22
- }).catch(noop_1.noop);
22
+ }).catch(noop.noop);
23
23
  // Resolve worker parameter: execute function if provided, otherwise use value directly
24
24
  const _worker = typeof worker === 'function' ? worker() : worker;
25
25
  // Ensure worker is wrapped in a promise for consistent async handling
26
- const newWorker = (0, promisify_1.promisify)(_worker);
26
+ const newWorker = promisify.promisify(_worker);
27
27
  // Set up message listener once worker is resolved
28
28
  newWorker.then(worker => {
29
29
  if (worker) {
@@ -34,6 +34,9 @@ function initializer(prevWorker, worker, handler) {
34
34
  // Worker thread context: listen to messages from main thread
35
35
  addEventListener('message', handler);
36
36
  }
37
- }).catch(noop_1.noop);
37
+ }).catch(noop.noop);
38
38
  return newWorker;
39
39
  }
40
+
41
+ exports.initializer = initializer;
42
+ //# sourceMappingURL=initializer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializer.cjs","sources":["../../../../libs/messenger/src/worker/initializer.ts"],"sourcesContent":[null],"names":["noop","promisify"],"mappings":";;;;;AAQA;;;;;;AAMG;SACa,WAAW,CACzB,UAA+B,EAC/B,MAAuB,EACvB,OAAsC,EAAA;;AAGtC,IAAA,UAAU,CAAC,IAAI,CAAC,EAAE,IAAG;QACnB,IAAI,EAAE,EAAE;AACN,YAAA,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC;QAC5C;aAAO;AACL,YAAA,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC;QACzC;AACF,IAAA,CAAC,CAAC,CAAC,KAAK,CAACA,SAAI,CAAC;;AAGd,IAAA,MAAM,OAAO,GAAuD,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM;;AAEpH,IAAA,MAAM,SAAS,GAAGC,mBAAS,CAAC,OAAO,CAAC;;AAGpC,IAAA,SAAS,CAAC,IAAI,CAAC,MAAM,IAAG;QACtB,IAAI,MAAM,EAAE;;AAEV,YAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC;QAC7C;aAAO;;AAEL,YAAA,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC;QACtC;AACF,IAAA,CAAC,CAAC,CAAC,KAAK,CAACD,SAAI,CAAC;AAEd,IAAA,OAAO,SAAS;AAClB;;;;"}
@@ -0,0 +1,15 @@
1
+ type ClientWorkerType = Worker | undefined;
2
+ type ClientWorkerPromise = Promise<ClientWorkerType>;
3
+ type ClientWorkerFactory = () => ClientWorkerType | ClientWorkerPromise;
4
+ type ClientWorkerArg = ClientWorkerType | ClientWorkerPromise | ClientWorkerFactory;
5
+ /**
6
+ * Initializes a Web Worker or the worker context for message communication.
7
+ * @param prevWorker The previous worker promise to deinitialize
8
+ * @param worker The new worker argument (Worker instance, promise, or factory function)
9
+ * @param handler The message event handler to attach
10
+ * @returns A promise resolving to the initialized Worker or undefined if in worker context
11
+ */
12
+ declare function initializer(prevWorker: ClientWorkerPromise, worker: ClientWorkerArg, handler: (event: MessageEvent) => void): Promise<Worker | undefined>;
13
+
14
+ export { initializer };
15
+ export type { ClientWorkerArg, ClientWorkerFactory, ClientWorkerPromise, ClientWorkerType };
@@ -1,7 +1,7 @@
1
- export type ClientWorkerType = Worker | undefined;
2
- export type ClientWorkerPromise = Promise<ClientWorkerType>;
3
- export type ClientWorkerFactory = () => ClientWorkerType | ClientWorkerPromise;
4
- export type ClientWorkerArg = ClientWorkerType | ClientWorkerPromise | ClientWorkerFactory;
1
+ type ClientWorkerType = Worker | undefined;
2
+ type ClientWorkerPromise = Promise<ClientWorkerType>;
3
+ type ClientWorkerFactory = () => ClientWorkerType | ClientWorkerPromise;
4
+ type ClientWorkerArg = ClientWorkerType | ClientWorkerPromise | ClientWorkerFactory;
5
5
  /**
6
6
  * Initializes a Web Worker or the worker context for message communication.
7
7
  * @param prevWorker The previous worker promise to deinitialize
@@ -9,4 +9,7 @@ export type ClientWorkerArg = ClientWorkerType | ClientWorkerPromise | ClientWor
9
9
  * @param handler The message event handler to attach
10
10
  * @returns A promise resolving to the initialized Worker or undefined if in worker context
11
11
  */
12
- export declare function initializer(prevWorker: ClientWorkerPromise, worker: ClientWorkerArg, handler: (event: MessageEvent) => void): Promise<Worker | undefined>;
12
+ declare function initializer(prevWorker: ClientWorkerPromise, worker: ClientWorkerArg, handler: (event: MessageEvent) => void): Promise<Worker | undefined>;
13
+
14
+ export { initializer };
15
+ export type { ClientWorkerArg, ClientWorkerFactory, ClientWorkerPromise, ClientWorkerType };