@genesislcap/foundation-broadcast-channel 14.172.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +87 -0
- package/dist/dts/__test__/config.d.ts +12 -0
- package/dist/dts/__test__/config.d.ts.map +1 -0
- package/dist/dts/__test__/elements.d.ts +59 -0
- package/dist/dts/__test__/elements.d.ts.map +1 -0
- package/dist/dts/__test__/index.d.ts +4 -0
- package/dist/dts/__test__/index.d.ts.map +1 -0
- package/dist/dts/__test__/types.d.ts +28 -0
- package/dist/dts/__test__/types.d.ts.map +1 -0
- package/dist/dts/broadcast-channel/broadcast-channel.d.ts +123 -0
- package/dist/dts/broadcast-channel/broadcast-channel.d.ts.map +1 -0
- package/dist/dts/broadcast-channel/index.d.ts +2 -0
- package/dist/dts/broadcast-channel/index.d.ts.map +1 -0
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/utils/index.d.ts +2 -0
- package/dist/dts/utils/index.d.ts.map +1 -0
- package/dist/dts/utils/logger.d.ts +5 -0
- package/dist/dts/utils/logger.d.ts.map +1 -0
- package/dist/esm/__test__/config.js +7 -0
- package/dist/esm/__test__/elements.js +108 -0
- package/dist/esm/__test__/index.js +3 -0
- package/dist/esm/__test__/types.js +24 -0
- package/dist/esm/broadcast-channel/broadcast-channel.js +61 -0
- package/dist/esm/broadcast-channel/index.js +1 -0
- package/dist/esm/index.federated.js +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/logger.js +5 -0
- package/dist/foundation-broadcast-channel.api.json +797 -0
- package/dist/foundation-broadcast-channel.d.ts +138 -0
- package/docs/.gitattributes +2 -0
- package/docs/api/foundation-broadcast-channel.createtypedbroadcastchannel.md +25 -0
- package/docs/api/foundation-broadcast-channel.defaulttypedbroadcastchannel.ismessagetype.md +13 -0
- package/docs/api/foundation-broadcast-channel.defaulttypedbroadcastchannel.md +24 -0
- package/docs/api/foundation-broadcast-channel.defaulttypedbroadcastchannel.postmessage.md +13 -0
- package/docs/api/foundation-broadcast-channel.logger.md +12 -0
- package/docs/api/foundation-broadcast-channel.md +32 -0
- package/docs/api/foundation-broadcast-channel.registertypedbroadcastchannel.md +24 -0
- package/docs/api/foundation-broadcast-channel.typedbroadcastchannel.ismessagetype.md +25 -0
- package/docs/api/foundation-broadcast-channel.typedbroadcastchannel.md +42 -0
- package/docs/api/foundation-broadcast-channel.typedbroadcastchannel.onmessage.md +34 -0
- package/docs/api/foundation-broadcast-channel.typedbroadcastchannel.onmessageerror.md +11 -0
- package/docs/api/foundation-broadcast-channel.typedbroadcastchannel.postmessage.md +29 -0
- package/docs/api/foundation-broadcast-channel.typedmessageevent.md +16 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +47 -0
- package/license.txt +46 -0
- package/package.json +43 -0
@@ -0,0 +1,797 @@
|
|
1
|
+
{
|
2
|
+
"metadata": {
|
3
|
+
"toolPackage": "@microsoft/api-extractor",
|
4
|
+
"toolVersion": "7.34.9",
|
5
|
+
"schemaVersion": 1011,
|
6
|
+
"oldestForwardsCompatibleVersion": 1001,
|
7
|
+
"tsdocConfig": {
|
8
|
+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
|
9
|
+
"noStandardTags": true,
|
10
|
+
"tagDefinitions": [
|
11
|
+
{
|
12
|
+
"tagName": "@alpha",
|
13
|
+
"syntaxKind": "modifier"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"tagName": "@beta",
|
17
|
+
"syntaxKind": "modifier"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"tagName": "@defaultValue",
|
21
|
+
"syntaxKind": "block"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"tagName": "@decorator",
|
25
|
+
"syntaxKind": "block",
|
26
|
+
"allowMultiple": true
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"tagName": "@deprecated",
|
30
|
+
"syntaxKind": "block"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"tagName": "@eventProperty",
|
34
|
+
"syntaxKind": "modifier"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"tagName": "@example",
|
38
|
+
"syntaxKind": "block",
|
39
|
+
"allowMultiple": true
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"tagName": "@experimental",
|
43
|
+
"syntaxKind": "modifier"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"tagName": "@inheritDoc",
|
47
|
+
"syntaxKind": "inline"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"tagName": "@internal",
|
51
|
+
"syntaxKind": "modifier"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"tagName": "@label",
|
55
|
+
"syntaxKind": "inline"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"tagName": "@link",
|
59
|
+
"syntaxKind": "inline",
|
60
|
+
"allowMultiple": true
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"tagName": "@override",
|
64
|
+
"syntaxKind": "modifier"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"tagName": "@packageDocumentation",
|
68
|
+
"syntaxKind": "modifier"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"tagName": "@param",
|
72
|
+
"syntaxKind": "block",
|
73
|
+
"allowMultiple": true
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"tagName": "@privateRemarks",
|
77
|
+
"syntaxKind": "block"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"tagName": "@public",
|
81
|
+
"syntaxKind": "modifier"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"tagName": "@readonly",
|
85
|
+
"syntaxKind": "modifier"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"tagName": "@remarks",
|
89
|
+
"syntaxKind": "block"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"tagName": "@returns",
|
93
|
+
"syntaxKind": "block"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"tagName": "@sealed",
|
97
|
+
"syntaxKind": "modifier"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"tagName": "@see",
|
101
|
+
"syntaxKind": "block"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"tagName": "@throws",
|
105
|
+
"syntaxKind": "block",
|
106
|
+
"allowMultiple": true
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"tagName": "@typeParam",
|
110
|
+
"syntaxKind": "block",
|
111
|
+
"allowMultiple": true
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"tagName": "@virtual",
|
115
|
+
"syntaxKind": "modifier"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"tagName": "@betaDocumentation",
|
119
|
+
"syntaxKind": "modifier"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"tagName": "@internalRemarks",
|
123
|
+
"syntaxKind": "block"
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"tagName": "@preapproved",
|
127
|
+
"syntaxKind": "modifier"
|
128
|
+
}
|
129
|
+
],
|
130
|
+
"supportForTags": {
|
131
|
+
"@alpha": true,
|
132
|
+
"@beta": true,
|
133
|
+
"@defaultValue": true,
|
134
|
+
"@decorator": true,
|
135
|
+
"@deprecated": true,
|
136
|
+
"@eventProperty": true,
|
137
|
+
"@example": true,
|
138
|
+
"@experimental": true,
|
139
|
+
"@inheritDoc": true,
|
140
|
+
"@internal": true,
|
141
|
+
"@label": true,
|
142
|
+
"@link": true,
|
143
|
+
"@override": true,
|
144
|
+
"@packageDocumentation": true,
|
145
|
+
"@param": true,
|
146
|
+
"@privateRemarks": true,
|
147
|
+
"@public": true,
|
148
|
+
"@readonly": true,
|
149
|
+
"@remarks": true,
|
150
|
+
"@returns": true,
|
151
|
+
"@sealed": true,
|
152
|
+
"@see": true,
|
153
|
+
"@throws": true,
|
154
|
+
"@typeParam": true,
|
155
|
+
"@virtual": true,
|
156
|
+
"@betaDocumentation": true,
|
157
|
+
"@internalRemarks": true,
|
158
|
+
"@preapproved": true
|
159
|
+
},
|
160
|
+
"reportUnsupportedHtmlElements": false
|
161
|
+
}
|
162
|
+
},
|
163
|
+
"kind": "Package",
|
164
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!",
|
165
|
+
"docComment": "",
|
166
|
+
"name": "@genesislcap/foundation-broadcast-channel",
|
167
|
+
"preserveMemberOrder": false,
|
168
|
+
"members": [
|
169
|
+
{
|
170
|
+
"kind": "EntryPoint",
|
171
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!",
|
172
|
+
"name": "",
|
173
|
+
"preserveMemberOrder": false,
|
174
|
+
"members": [
|
175
|
+
{
|
176
|
+
"kind": "Variable",
|
177
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!createTypedBroadcastChannel:var",
|
178
|
+
"docComment": "/**\n * Creates a strongly typed broadcast channel.\n *\n * @remarks\n *\n * `registerTypedBroadcastChannel` may be preferred, as it will create and register the channel in the DI.\n *\n * @param name - The channel name.\n *\n * @returns The created TypedBroadcastChannel.\n *\n * @example\n * ```ts\n * const channel = createTypedBroadcastChannel<GenesisResourcesEvents>(GenesisResourcesChannelId);\n * ```\n *\n * @public\n */\n",
|
179
|
+
"excerptTokens": [
|
180
|
+
{
|
181
|
+
"kind": "Content",
|
182
|
+
"text": "createTypedBroadcastChannel: "
|
183
|
+
},
|
184
|
+
{
|
185
|
+
"kind": "Content",
|
186
|
+
"text": "<TEventDetailMap extends "
|
187
|
+
},
|
188
|
+
{
|
189
|
+
"kind": "Reference",
|
190
|
+
"text": "EventDetailMap",
|
191
|
+
"canonicalReference": "@genesislcap/foundation-events!EventDetailMap:type"
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"kind": "Content",
|
195
|
+
"text": ">(name: string) => "
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"kind": "Reference",
|
199
|
+
"text": "DefaultTypedBroadcastChannel",
|
200
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!DefaultTypedBroadcastChannel:class"
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"kind": "Content",
|
204
|
+
"text": "<TEventDetailMap>"
|
205
|
+
}
|
206
|
+
],
|
207
|
+
"fileUrlPath": "src/broadcast-channel/broadcast-channel.ts",
|
208
|
+
"isReadonly": true,
|
209
|
+
"releaseTag": "Public",
|
210
|
+
"name": "createTypedBroadcastChannel",
|
211
|
+
"variableTypeTokenRange": {
|
212
|
+
"startIndex": 1,
|
213
|
+
"endIndex": 6
|
214
|
+
}
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"kind": "Class",
|
218
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!DefaultTypedBroadcastChannel:class",
|
219
|
+
"docComment": "/**\n * Default TypedBroadcastChannel implementation.\n *\n * @public\n */\n",
|
220
|
+
"excerptTokens": [
|
221
|
+
{
|
222
|
+
"kind": "Content",
|
223
|
+
"text": "export declare class DefaultTypedBroadcastChannel<TEventDetailMap extends "
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"kind": "Reference",
|
227
|
+
"text": "EventDetailMap",
|
228
|
+
"canonicalReference": "@genesislcap/foundation-events!EventDetailMap:type"
|
229
|
+
},
|
230
|
+
{
|
231
|
+
"kind": "Content",
|
232
|
+
"text": "> extends "
|
233
|
+
},
|
234
|
+
{
|
235
|
+
"kind": "Reference",
|
236
|
+
"text": "BroadcastChannel",
|
237
|
+
"canonicalReference": "!BroadcastChannel:interface"
|
238
|
+
},
|
239
|
+
{
|
240
|
+
"kind": "Content",
|
241
|
+
"text": " implements "
|
242
|
+
},
|
243
|
+
{
|
244
|
+
"kind": "Reference",
|
245
|
+
"text": "TypedBroadcastChannel",
|
246
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel:interface"
|
247
|
+
},
|
248
|
+
{
|
249
|
+
"kind": "Content",
|
250
|
+
"text": "<TEventDetailMap>"
|
251
|
+
},
|
252
|
+
{
|
253
|
+
"kind": "Content",
|
254
|
+
"text": " "
|
255
|
+
}
|
256
|
+
],
|
257
|
+
"fileUrlPath": "src/broadcast-channel/broadcast-channel.ts",
|
258
|
+
"releaseTag": "Public",
|
259
|
+
"typeParameters": [
|
260
|
+
{
|
261
|
+
"typeParameterName": "TEventDetailMap",
|
262
|
+
"constraintTokenRange": {
|
263
|
+
"startIndex": 1,
|
264
|
+
"endIndex": 2
|
265
|
+
},
|
266
|
+
"defaultTypeTokenRange": {
|
267
|
+
"startIndex": 0,
|
268
|
+
"endIndex": 0
|
269
|
+
}
|
270
|
+
}
|
271
|
+
],
|
272
|
+
"isAbstract": false,
|
273
|
+
"name": "DefaultTypedBroadcastChannel",
|
274
|
+
"preserveMemberOrder": false,
|
275
|
+
"members": [
|
276
|
+
{
|
277
|
+
"kind": "Property",
|
278
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!DefaultTypedBroadcastChannel#isMessageType:member",
|
279
|
+
"docComment": "/**\n * A type predicate function to narrow down message events based on their 'type' property.\n *\n * @param type - The message type.\n *\n * @param event - The message event.\n */\n",
|
280
|
+
"excerptTokens": [
|
281
|
+
{
|
282
|
+
"kind": "Content",
|
283
|
+
"text": "isMessageType: "
|
284
|
+
},
|
285
|
+
{
|
286
|
+
"kind": "Content",
|
287
|
+
"text": "<T extends keyof TEventDetailMap>(type: T, event: "
|
288
|
+
},
|
289
|
+
{
|
290
|
+
"kind": "Reference",
|
291
|
+
"text": "TypedMessageEvent",
|
292
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedMessageEvent:type"
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"kind": "Content",
|
296
|
+
"text": "<TEventDetailMap, keyof TEventDetailMap>) => "
|
297
|
+
},
|
298
|
+
{
|
299
|
+
"kind": "Reference",
|
300
|
+
"text": "event",
|
301
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!~event"
|
302
|
+
},
|
303
|
+
{
|
304
|
+
"kind": "Content",
|
305
|
+
"text": " is "
|
306
|
+
},
|
307
|
+
{
|
308
|
+
"kind": "Reference",
|
309
|
+
"text": "TypedMessageEvent",
|
310
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedMessageEvent:type"
|
311
|
+
},
|
312
|
+
{
|
313
|
+
"kind": "Content",
|
314
|
+
"text": "<TEventDetailMap, T>"
|
315
|
+
},
|
316
|
+
{
|
317
|
+
"kind": "Content",
|
318
|
+
"text": ";"
|
319
|
+
}
|
320
|
+
],
|
321
|
+
"isReadonly": false,
|
322
|
+
"isOptional": false,
|
323
|
+
"releaseTag": "Public",
|
324
|
+
"name": "isMessageType",
|
325
|
+
"propertyTypeTokenRange": {
|
326
|
+
"startIndex": 1,
|
327
|
+
"endIndex": 8
|
328
|
+
},
|
329
|
+
"isStatic": false,
|
330
|
+
"isProtected": false,
|
331
|
+
"isAbstract": false
|
332
|
+
},
|
333
|
+
{
|
334
|
+
"kind": "Property",
|
335
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!DefaultTypedBroadcastChannel#postMessage:member",
|
336
|
+
"docComment": "/**\n * Post strongly typed messages.\n */\n",
|
337
|
+
"excerptTokens": [
|
338
|
+
{
|
339
|
+
"kind": "Content",
|
340
|
+
"text": "postMessage: "
|
341
|
+
},
|
342
|
+
{
|
343
|
+
"kind": "Reference",
|
344
|
+
"text": "PostMessage",
|
345
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!~PostMessage:type"
|
346
|
+
},
|
347
|
+
{
|
348
|
+
"kind": "Content",
|
349
|
+
"text": "<TEventDetailMap>"
|
350
|
+
},
|
351
|
+
{
|
352
|
+
"kind": "Content",
|
353
|
+
"text": ";"
|
354
|
+
}
|
355
|
+
],
|
356
|
+
"isReadonly": false,
|
357
|
+
"isOptional": false,
|
358
|
+
"releaseTag": "Public",
|
359
|
+
"name": "postMessage",
|
360
|
+
"propertyTypeTokenRange": {
|
361
|
+
"startIndex": 1,
|
362
|
+
"endIndex": 3
|
363
|
+
},
|
364
|
+
"isStatic": false,
|
365
|
+
"isProtected": false,
|
366
|
+
"isAbstract": false
|
367
|
+
}
|
368
|
+
],
|
369
|
+
"extendsTokenRange": {
|
370
|
+
"startIndex": 3,
|
371
|
+
"endIndex": 4
|
372
|
+
},
|
373
|
+
"implementsTokenRanges": [
|
374
|
+
{
|
375
|
+
"startIndex": 5,
|
376
|
+
"endIndex": 7
|
377
|
+
}
|
378
|
+
]
|
379
|
+
},
|
380
|
+
{
|
381
|
+
"kind": "Variable",
|
382
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!logger:var",
|
383
|
+
"docComment": "/**\n * @public\n */\n",
|
384
|
+
"excerptTokens": [
|
385
|
+
{
|
386
|
+
"kind": "Content",
|
387
|
+
"text": "logger: "
|
388
|
+
},
|
389
|
+
{
|
390
|
+
"kind": "Content",
|
391
|
+
"text": "import(\"@genesislcap/foundation-logger\")."
|
392
|
+
},
|
393
|
+
{
|
394
|
+
"kind": "Reference",
|
395
|
+
"text": "Logger",
|
396
|
+
"canonicalReference": "@genesislcap/foundation-logger!Logger:interface"
|
397
|
+
}
|
398
|
+
],
|
399
|
+
"fileUrlPath": "src/utils/logger.ts",
|
400
|
+
"isReadonly": true,
|
401
|
+
"releaseTag": "Public",
|
402
|
+
"name": "logger",
|
403
|
+
"variableTypeTokenRange": {
|
404
|
+
"startIndex": 1,
|
405
|
+
"endIndex": 3
|
406
|
+
}
|
407
|
+
},
|
408
|
+
{
|
409
|
+
"kind": "Variable",
|
410
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!registerTypedBroadcastChannel:var",
|
411
|
+
"docComment": "/**\n * Creates a dependency injection key for the broadcast channel being registered which is lazily created when injected.\n *\n * @param name - The channel name.\n *\n * @returns The created key.\n *\n * @example\n *\n * In a package's config.ts\n * ```ts\n * export interface GenesisResourcesChannel extends TypedBroadcastChannel<GenesisResourcesEvents> {}\n * ...\n * export const GenesisResourcesChannel = registerTypedBroadcastChannel<GenesisResourcesEvents>(GenesisResourcesChannelId);\n * ```\n *\n * @public\n */\n",
|
412
|
+
"excerptTokens": [
|
413
|
+
{
|
414
|
+
"kind": "Content",
|
415
|
+
"text": "registerTypedBroadcastChannel: "
|
416
|
+
},
|
417
|
+
{
|
418
|
+
"kind": "Content",
|
419
|
+
"text": "<TEventDetailMap extends "
|
420
|
+
},
|
421
|
+
{
|
422
|
+
"kind": "Reference",
|
423
|
+
"text": "EventDetailMap",
|
424
|
+
"canonicalReference": "@genesislcap/foundation-events!EventDetailMap:type"
|
425
|
+
},
|
426
|
+
{
|
427
|
+
"kind": "Content",
|
428
|
+
"text": ">(name: string) => import(\"@microsoft/fast-foundation\")."
|
429
|
+
},
|
430
|
+
{
|
431
|
+
"kind": "Reference",
|
432
|
+
"text": "InterfaceSymbol",
|
433
|
+
"canonicalReference": "@microsoft/fast-foundation!InterfaceSymbol:type"
|
434
|
+
},
|
435
|
+
{
|
436
|
+
"kind": "Content",
|
437
|
+
"text": "<"
|
438
|
+
},
|
439
|
+
{
|
440
|
+
"kind": "Reference",
|
441
|
+
"text": "TypedBroadcastChannel",
|
442
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel:interface"
|
443
|
+
},
|
444
|
+
{
|
445
|
+
"kind": "Content",
|
446
|
+
"text": "<TEventDetailMap>>"
|
447
|
+
}
|
448
|
+
],
|
449
|
+
"fileUrlPath": "src/broadcast-channel/broadcast-channel.ts",
|
450
|
+
"isReadonly": true,
|
451
|
+
"releaseTag": "Public",
|
452
|
+
"name": "registerTypedBroadcastChannel",
|
453
|
+
"variableTypeTokenRange": {
|
454
|
+
"startIndex": 1,
|
455
|
+
"endIndex": 8
|
456
|
+
}
|
457
|
+
},
|
458
|
+
{
|
459
|
+
"kind": "Interface",
|
460
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel:interface",
|
461
|
+
"docComment": "/**\n * A TypedBroadcastChannel for sending and receiving typed messages based on {@link @genesislcap/foundation-events#EventDetailMap} input.\n *\n * @example\n * ```ts\n * export type GenesisResourcesEvents = {\n * 'resources-loaded': ResourceItem[];\n * 'resources-unloaded': void;\n * };\n * ...\n * protected channel: TypedBroadcastChannel<GenesisResourcesEvents>;\n * ```\n *\n * See the {@link registerTypedBroadcastChannel} and {@link createTypedBroadcastChannel} APIs below.\n *\n * @public\n */\n",
|
462
|
+
"excerptTokens": [
|
463
|
+
{
|
464
|
+
"kind": "Content",
|
465
|
+
"text": "export interface TypedBroadcastChannel<TEventDetailMap extends "
|
466
|
+
},
|
467
|
+
{
|
468
|
+
"kind": "Reference",
|
469
|
+
"text": "EventDetailMap",
|
470
|
+
"canonicalReference": "@genesislcap/foundation-events!EventDetailMap:type"
|
471
|
+
},
|
472
|
+
{
|
473
|
+
"kind": "Content",
|
474
|
+
"text": "> extends "
|
475
|
+
},
|
476
|
+
{
|
477
|
+
"kind": "Reference",
|
478
|
+
"text": "Omit",
|
479
|
+
"canonicalReference": "!Omit:type"
|
480
|
+
},
|
481
|
+
{
|
482
|
+
"kind": "Content",
|
483
|
+
"text": "<"
|
484
|
+
},
|
485
|
+
{
|
486
|
+
"kind": "Reference",
|
487
|
+
"text": "BroadcastChannel",
|
488
|
+
"canonicalReference": "!BroadcastChannel:interface"
|
489
|
+
},
|
490
|
+
{
|
491
|
+
"kind": "Content",
|
492
|
+
"text": ", 'postMessage' | 'onmessage' | 'onmessageerror'>"
|
493
|
+
},
|
494
|
+
{
|
495
|
+
"kind": "Content",
|
496
|
+
"text": " "
|
497
|
+
}
|
498
|
+
],
|
499
|
+
"fileUrlPath": "src/broadcast-channel/broadcast-channel.ts",
|
500
|
+
"releaseTag": "Public",
|
501
|
+
"typeParameters": [
|
502
|
+
{
|
503
|
+
"typeParameterName": "TEventDetailMap",
|
504
|
+
"constraintTokenRange": {
|
505
|
+
"startIndex": 1,
|
506
|
+
"endIndex": 2
|
507
|
+
},
|
508
|
+
"defaultTypeTokenRange": {
|
509
|
+
"startIndex": 0,
|
510
|
+
"endIndex": 0
|
511
|
+
}
|
512
|
+
}
|
513
|
+
],
|
514
|
+
"name": "TypedBroadcastChannel",
|
515
|
+
"preserveMemberOrder": false,
|
516
|
+
"members": [
|
517
|
+
{
|
518
|
+
"kind": "MethodSignature",
|
519
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel#isMessageType:member(1)",
|
520
|
+
"docComment": "/**\n * A type predicate function to narrow down message events based on their 'type' property.\n *\n * @param type - The message type.\n *\n * @param event - The message event.\n */\n",
|
521
|
+
"excerptTokens": [
|
522
|
+
{
|
523
|
+
"kind": "Content",
|
524
|
+
"text": "isMessageType<T extends "
|
525
|
+
},
|
526
|
+
{
|
527
|
+
"kind": "Content",
|
528
|
+
"text": "keyof TEventDetailMap"
|
529
|
+
},
|
530
|
+
{
|
531
|
+
"kind": "Content",
|
532
|
+
"text": ">(type: "
|
533
|
+
},
|
534
|
+
{
|
535
|
+
"kind": "Content",
|
536
|
+
"text": "T"
|
537
|
+
},
|
538
|
+
{
|
539
|
+
"kind": "Content",
|
540
|
+
"text": ", event: "
|
541
|
+
},
|
542
|
+
{
|
543
|
+
"kind": "Reference",
|
544
|
+
"text": "TypedMessageEvent",
|
545
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedMessageEvent:type"
|
546
|
+
},
|
547
|
+
{
|
548
|
+
"kind": "Content",
|
549
|
+
"text": "<TEventDetailMap, keyof TEventDetailMap>"
|
550
|
+
},
|
551
|
+
{
|
552
|
+
"kind": "Content",
|
553
|
+
"text": "): "
|
554
|
+
},
|
555
|
+
{
|
556
|
+
"kind": "Reference",
|
557
|
+
"text": "event",
|
558
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!~event"
|
559
|
+
},
|
560
|
+
{
|
561
|
+
"kind": "Content",
|
562
|
+
"text": " is "
|
563
|
+
},
|
564
|
+
{
|
565
|
+
"kind": "Reference",
|
566
|
+
"text": "TypedMessageEvent",
|
567
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedMessageEvent:type"
|
568
|
+
},
|
569
|
+
{
|
570
|
+
"kind": "Content",
|
571
|
+
"text": "<TEventDetailMap, T>"
|
572
|
+
},
|
573
|
+
{
|
574
|
+
"kind": "Content",
|
575
|
+
"text": ";"
|
576
|
+
}
|
577
|
+
],
|
578
|
+
"isOptional": false,
|
579
|
+
"returnTypeTokenRange": {
|
580
|
+
"startIndex": 8,
|
581
|
+
"endIndex": 12
|
582
|
+
},
|
583
|
+
"releaseTag": "Public",
|
584
|
+
"overloadIndex": 1,
|
585
|
+
"parameters": [
|
586
|
+
{
|
587
|
+
"parameterName": "type",
|
588
|
+
"parameterTypeTokenRange": {
|
589
|
+
"startIndex": 3,
|
590
|
+
"endIndex": 4
|
591
|
+
},
|
592
|
+
"isOptional": false
|
593
|
+
},
|
594
|
+
{
|
595
|
+
"parameterName": "event",
|
596
|
+
"parameterTypeTokenRange": {
|
597
|
+
"startIndex": 5,
|
598
|
+
"endIndex": 7
|
599
|
+
},
|
600
|
+
"isOptional": false
|
601
|
+
}
|
602
|
+
],
|
603
|
+
"typeParameters": [
|
604
|
+
{
|
605
|
+
"typeParameterName": "T",
|
606
|
+
"constraintTokenRange": {
|
607
|
+
"startIndex": 1,
|
608
|
+
"endIndex": 2
|
609
|
+
},
|
610
|
+
"defaultTypeTokenRange": {
|
611
|
+
"startIndex": 0,
|
612
|
+
"endIndex": 0
|
613
|
+
}
|
614
|
+
}
|
615
|
+
],
|
616
|
+
"name": "isMessageType"
|
617
|
+
},
|
618
|
+
{
|
619
|
+
"kind": "PropertySignature",
|
620
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel#onmessage:member",
|
621
|
+
"docComment": "/**\n * On message handler.\n *\n * @example\n *\n * Use the `channel.isMessageType` method to narrow based on message types.\n * ```ts\n * import { GenesisResourcesChannel } from '@genesislcap/foundation-comms';\n * ...\n * @GenesisResourcesChannel protected channel: GenesisResourcesChannel;\n * ...\n * this.channel.onmessage = (ev) => {\n * if (this.channel.isMessageType('resources-loaded', ev)) {\n * if (!ev.data.detail.length) {\n * throw Error('No backend resources available');\n * }\n * }\n * };\n * ...\n * this.channel.close();\n * ```\n *\n */\n",
|
622
|
+
"excerptTokens": [
|
623
|
+
{
|
624
|
+
"kind": "Content",
|
625
|
+
"text": "onmessage: "
|
626
|
+
},
|
627
|
+
{
|
628
|
+
"kind": "Reference",
|
629
|
+
"text": "OnMessage",
|
630
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!~OnMessage:type"
|
631
|
+
},
|
632
|
+
{
|
633
|
+
"kind": "Content",
|
634
|
+
"text": "<TEventDetailMap>"
|
635
|
+
},
|
636
|
+
{
|
637
|
+
"kind": "Content",
|
638
|
+
"text": ";"
|
639
|
+
}
|
640
|
+
],
|
641
|
+
"isReadonly": false,
|
642
|
+
"isOptional": false,
|
643
|
+
"releaseTag": "Public",
|
644
|
+
"name": "onmessage",
|
645
|
+
"propertyTypeTokenRange": {
|
646
|
+
"startIndex": 1,
|
647
|
+
"endIndex": 3
|
648
|
+
}
|
649
|
+
},
|
650
|
+
{
|
651
|
+
"kind": "PropertySignature",
|
652
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel#onmessageerror:member",
|
653
|
+
"docComment": "",
|
654
|
+
"excerptTokens": [
|
655
|
+
{
|
656
|
+
"kind": "Content",
|
657
|
+
"text": "onmessageerror: "
|
658
|
+
},
|
659
|
+
{
|
660
|
+
"kind": "Reference",
|
661
|
+
"text": "OnMessageError",
|
662
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!~OnMessageError:type"
|
663
|
+
},
|
664
|
+
{
|
665
|
+
"kind": "Content",
|
666
|
+
"text": "<TEventDetailMap>"
|
667
|
+
},
|
668
|
+
{
|
669
|
+
"kind": "Content",
|
670
|
+
"text": ";"
|
671
|
+
}
|
672
|
+
],
|
673
|
+
"isReadonly": false,
|
674
|
+
"isOptional": false,
|
675
|
+
"releaseTag": "Public",
|
676
|
+
"name": "onmessageerror",
|
677
|
+
"propertyTypeTokenRange": {
|
678
|
+
"startIndex": 1,
|
679
|
+
"endIndex": 3
|
680
|
+
}
|
681
|
+
},
|
682
|
+
{
|
683
|
+
"kind": "PropertySignature",
|
684
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedBroadcastChannel#postMessage:member",
|
685
|
+
"docComment": "/**\n * Post strongly typed messages.\n *\n * @example\n *\n * The event detail map provided to the channel on creation will provide `postMessage` typing.\n * ```ts\n * type GenesisResourcesEvents = {\n * 'resources-loaded': ResourceItem[];\n * 'resources-unloaded': void;\n * };\n * ...\n * channel.postMessage('resources-loaded', this.resources); // ok, as this.resources is an array of ResourceItems.\n * channel.postMessage('resources-loaded'); // not ok, as an array is expected for this message type.\n * channel.postMessage('resources-unloaded'); // ok, as this message type maps to void for its detail.\n * ```\n *\n */\n",
|
686
|
+
"excerptTokens": [
|
687
|
+
{
|
688
|
+
"kind": "Content",
|
689
|
+
"text": "postMessage: "
|
690
|
+
},
|
691
|
+
{
|
692
|
+
"kind": "Reference",
|
693
|
+
"text": "PostMessage",
|
694
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!~PostMessage:type"
|
695
|
+
},
|
696
|
+
{
|
697
|
+
"kind": "Content",
|
698
|
+
"text": "<TEventDetailMap>"
|
699
|
+
},
|
700
|
+
{
|
701
|
+
"kind": "Content",
|
702
|
+
"text": ";"
|
703
|
+
}
|
704
|
+
],
|
705
|
+
"isReadonly": false,
|
706
|
+
"isOptional": false,
|
707
|
+
"releaseTag": "Public",
|
708
|
+
"name": "postMessage",
|
709
|
+
"propertyTypeTokenRange": {
|
710
|
+
"startIndex": 1,
|
711
|
+
"endIndex": 3
|
712
|
+
}
|
713
|
+
}
|
714
|
+
],
|
715
|
+
"extendsTokenRanges": [
|
716
|
+
{
|
717
|
+
"startIndex": 3,
|
718
|
+
"endIndex": 7
|
719
|
+
}
|
720
|
+
]
|
721
|
+
},
|
722
|
+
{
|
723
|
+
"kind": "TypeAlias",
|
724
|
+
"canonicalReference": "@genesislcap/foundation-broadcast-channel!TypedMessageEvent:type",
|
725
|
+
"docComment": "/**\n * A TypedMessageEvent for BroadcastChannel transmission.\n *\n * @public\n */\n",
|
726
|
+
"excerptTokens": [
|
727
|
+
{
|
728
|
+
"kind": "Content",
|
729
|
+
"text": "export type TypedMessageEvent<TEventDetailMap extends "
|
730
|
+
},
|
731
|
+
{
|
732
|
+
"kind": "Reference",
|
733
|
+
"text": "EventDetailMap",
|
734
|
+
"canonicalReference": "@genesislcap/foundation-events!EventDetailMap:type"
|
735
|
+
},
|
736
|
+
{
|
737
|
+
"kind": "Content",
|
738
|
+
"text": ", T extends "
|
739
|
+
},
|
740
|
+
{
|
741
|
+
"kind": "Content",
|
742
|
+
"text": "keyof TEventDetailMap"
|
743
|
+
},
|
744
|
+
{
|
745
|
+
"kind": "Content",
|
746
|
+
"text": "> = "
|
747
|
+
},
|
748
|
+
{
|
749
|
+
"kind": "Reference",
|
750
|
+
"text": "MessageEvent",
|
751
|
+
"canonicalReference": "!MessageEvent:interface"
|
752
|
+
},
|
753
|
+
{
|
754
|
+
"kind": "Content",
|
755
|
+
"text": "<{\n type: T;\n detail: TEventDetailMap[T];\n}>"
|
756
|
+
},
|
757
|
+
{
|
758
|
+
"kind": "Content",
|
759
|
+
"text": ";"
|
760
|
+
}
|
761
|
+
],
|
762
|
+
"fileUrlPath": "src/broadcast-channel/broadcast-channel.ts",
|
763
|
+
"releaseTag": "Public",
|
764
|
+
"name": "TypedMessageEvent",
|
765
|
+
"typeParameters": [
|
766
|
+
{
|
767
|
+
"typeParameterName": "TEventDetailMap",
|
768
|
+
"constraintTokenRange": {
|
769
|
+
"startIndex": 1,
|
770
|
+
"endIndex": 2
|
771
|
+
},
|
772
|
+
"defaultTypeTokenRange": {
|
773
|
+
"startIndex": 0,
|
774
|
+
"endIndex": 0
|
775
|
+
}
|
776
|
+
},
|
777
|
+
{
|
778
|
+
"typeParameterName": "T",
|
779
|
+
"constraintTokenRange": {
|
780
|
+
"startIndex": 3,
|
781
|
+
"endIndex": 4
|
782
|
+
},
|
783
|
+
"defaultTypeTokenRange": {
|
784
|
+
"startIndex": 0,
|
785
|
+
"endIndex": 0
|
786
|
+
}
|
787
|
+
}
|
788
|
+
],
|
789
|
+
"typeTokenRange": {
|
790
|
+
"startIndex": 5,
|
791
|
+
"endIndex": 7
|
792
|
+
}
|
793
|
+
}
|
794
|
+
]
|
795
|
+
}
|
796
|
+
]
|
797
|
+
}
|