@genesislcap/foundation-fdc3 14.199.2 → 14.200.0-FUI-2127.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/dts/fdc3-channel-event.d.ts.map +1 -1
- package/dist/dts/fdc3.d.ts +57 -1
- package/dist/dts/fdc3.d.ts.map +1 -1
- package/dist/dts/index.d.ts +6 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/notifications/interop-notifications-listener.d.ts.map +1 -1
- package/dist/dts/util/fdc3-context-listener.d.ts +7 -337
- package/dist/dts/util/fdc3-context-listener.d.ts.map +1 -1
- package/dist/dts/util/{fdc3-listener.d.ts → fdc3-intent-listener.d.ts} +6 -19
- package/dist/dts/util/fdc3-intent-listener.d.ts.map +1 -0
- package/dist/dts/util/fdc3-system-channel-listener.d.ts +348 -0
- package/dist/dts/util/fdc3-system-channel-listener.d.ts.map +1 -0
- package/dist/dts/util/index.d.ts +0 -1
- package/dist/dts/util/index.d.ts.map +1 -1
- package/dist/esm/fdc3-channel-event.js +6 -1
- package/dist/esm/fdc3.js +99 -16
- package/dist/esm/index.js +1 -0
- package/dist/esm/util/fdc3-context-listener.js +10 -30
- package/dist/esm/util/fdc3-intent-listener.js +48 -0
- package/dist/esm/util/fdc3-system-channel-listener.js +55 -0
- package/dist/esm/util/index.js +0 -1
- package/dist/foundation-fdc3.api.json +384 -0
- package/dist/foundation-fdc3.d.ts +57 -358
- package/docs/api/foundation-fdc3.fdc3.addsystemchannellistener.md +25 -0
- package/docs/api/foundation-fdc3.fdc3.broadcastoncurrentchannel.md +25 -0
- package/docs/api/foundation-fdc3.fdc3.currentchannel_.md +13 -0
- package/docs/api/foundation-fdc3.fdc3.handlechannelcurrentcontext.md +26 -0
- package/docs/api/foundation-fdc3.fdc3.isinteropfdc3.md +13 -0
- package/docs/api/foundation-fdc3.fdc3.isready_.md +13 -0
- package/docs/api/foundation-fdc3.fdc3.md +7 -0
- package/docs/api/foundation-fdc3.fdc3.raiseintentforcontext.md +26 -0
- package/docs/api-report.md +22 -34
- package/package.json +17 -15
- package/test/fdc3.mock.ts +13 -9
- package/dist/dts/util/fdc3-listener.d.ts.map +0 -1
- package/dist/esm/util/fdc3-listener.js +0 -55
@@ -0,0 +1,55 @@
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
2
|
+
import { LifecycleMixin } from '@genesislcap/foundation-utils';
|
3
|
+
import { customElement, FoundationElement } from '@genesislcap/web-core';
|
4
|
+
import { first, Subscription } from 'rxjs';
|
5
|
+
import { FDC3 } from '../fdc3';
|
6
|
+
let Fdc3SystemChannelListener = class Fdc3SystemChannelListener extends LifecycleMixin(FoundationElement) {
|
7
|
+
constructor() {
|
8
|
+
super(...arguments);
|
9
|
+
this.config = [];
|
10
|
+
this.channelSub = new Subscription();
|
11
|
+
}
|
12
|
+
deepClone() {
|
13
|
+
const copy = super.deepClone();
|
14
|
+
if (this.config) {
|
15
|
+
copy.config = this.config.map((c) => {
|
16
|
+
const copyConfig = Object.assign({}, c);
|
17
|
+
if (c.callback) {
|
18
|
+
copyConfig.callback = c.callback.bind(this);
|
19
|
+
}
|
20
|
+
return copyConfig;
|
21
|
+
});
|
22
|
+
}
|
23
|
+
return copy;
|
24
|
+
}
|
25
|
+
connectedCallback() {
|
26
|
+
super.connectedCallback();
|
27
|
+
this.fdc3.isReady$.pipe(first()).subscribe(() => {
|
28
|
+
if (this.config) {
|
29
|
+
this.addChannelListeners();
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}
|
33
|
+
addChannelListeners() {
|
34
|
+
this.fdc3.isReady$.pipe(first()).subscribe(() => __awaiter(this, void 0, void 0, function* () {
|
35
|
+
return this.config.forEach((c) => this.channelSub.add(this.fdc3.currentChannel$.subscribe((channel) => {
|
36
|
+
this.fdc3.handleChannelCurrentContext(channel, c.channelType, c.callback);
|
37
|
+
channel.addContextListener(c.channelType, c.callback);
|
38
|
+
})));
|
39
|
+
}));
|
40
|
+
}
|
41
|
+
disconnectedCallback() {
|
42
|
+
var _a;
|
43
|
+
(_a = this.channelSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
44
|
+
super.disconnectedCallback();
|
45
|
+
}
|
46
|
+
};
|
47
|
+
__decorate([
|
48
|
+
FDC3
|
49
|
+
], Fdc3SystemChannelListener.prototype, "fdc3", void 0);
|
50
|
+
Fdc3SystemChannelListener = __decorate([
|
51
|
+
customElement({
|
52
|
+
name: 'fdc3-system-channel-listener',
|
53
|
+
})
|
54
|
+
], Fdc3SystemChannelListener);
|
55
|
+
export { Fdc3SystemChannelListener };
|
package/dist/esm/util/index.js
CHANGED
@@ -358,6 +358,72 @@
|
|
358
358
|
],
|
359
359
|
"name": "addIntentListeners"
|
360
360
|
},
|
361
|
+
{
|
362
|
+
"kind": "MethodSignature",
|
363
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#addSystemChannelListener:member(1)",
|
364
|
+
"docComment": "/**\n * Helper function to add a context listener on to the system, aka 'color', channel with a handler for channel messages\n *\n * @param channelType - type of the channel\n *\n * @param callback - handler to for the channel context listener\n */\n",
|
365
|
+
"excerptTokens": [
|
366
|
+
{
|
367
|
+
"kind": "Content",
|
368
|
+
"text": "addSystemChannelListener(channelType: "
|
369
|
+
},
|
370
|
+
{
|
371
|
+
"kind": "Content",
|
372
|
+
"text": "string"
|
373
|
+
},
|
374
|
+
{
|
375
|
+
"kind": "Content",
|
376
|
+
"text": ", callback: "
|
377
|
+
},
|
378
|
+
{
|
379
|
+
"kind": "Content",
|
380
|
+
"text": "(any: any) => void"
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"kind": "Content",
|
384
|
+
"text": "): "
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"kind": "Reference",
|
388
|
+
"text": "Promise",
|
389
|
+
"canonicalReference": "!Promise:interface"
|
390
|
+
},
|
391
|
+
{
|
392
|
+
"kind": "Content",
|
393
|
+
"text": "<void>"
|
394
|
+
},
|
395
|
+
{
|
396
|
+
"kind": "Content",
|
397
|
+
"text": ";"
|
398
|
+
}
|
399
|
+
],
|
400
|
+
"isOptional": false,
|
401
|
+
"returnTypeTokenRange": {
|
402
|
+
"startIndex": 5,
|
403
|
+
"endIndex": 7
|
404
|
+
},
|
405
|
+
"releaseTag": "Public",
|
406
|
+
"overloadIndex": 1,
|
407
|
+
"parameters": [
|
408
|
+
{
|
409
|
+
"parameterName": "channelType",
|
410
|
+
"parameterTypeTokenRange": {
|
411
|
+
"startIndex": 1,
|
412
|
+
"endIndex": 2
|
413
|
+
},
|
414
|
+
"isOptional": false
|
415
|
+
},
|
416
|
+
{
|
417
|
+
"parameterName": "callback",
|
418
|
+
"parameterTypeTokenRange": {
|
419
|
+
"startIndex": 3,
|
420
|
+
"endIndex": 4
|
421
|
+
},
|
422
|
+
"isOptional": false
|
423
|
+
}
|
424
|
+
],
|
425
|
+
"name": "addSystemChannelListener"
|
426
|
+
},
|
361
427
|
{
|
362
428
|
"kind": "MethodSignature",
|
363
429
|
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#broadcastOnChannel:member(1)",
|
@@ -515,6 +581,113 @@
|
|
515
581
|
],
|
516
582
|
"name": "broadcastOnChannelEventHandler"
|
517
583
|
},
|
584
|
+
{
|
585
|
+
"kind": "MethodSignature",
|
586
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#broadcastOnCurrentChannel:member(1)",
|
587
|
+
"docComment": "/**\n * Broadcasts a message on the current app channel\n *\n * @param type - type of the channel\n *\n * @param payload - payload sent to the channel\n */\n",
|
588
|
+
"excerptTokens": [
|
589
|
+
{
|
590
|
+
"kind": "Content",
|
591
|
+
"text": "broadcastOnCurrentChannel(payload: "
|
592
|
+
},
|
593
|
+
{
|
594
|
+
"kind": "Content",
|
595
|
+
"text": "any"
|
596
|
+
},
|
597
|
+
{
|
598
|
+
"kind": "Content",
|
599
|
+
"text": ", type?: "
|
600
|
+
},
|
601
|
+
{
|
602
|
+
"kind": "Content",
|
603
|
+
"text": "string"
|
604
|
+
},
|
605
|
+
{
|
606
|
+
"kind": "Content",
|
607
|
+
"text": "): "
|
608
|
+
},
|
609
|
+
{
|
610
|
+
"kind": "Reference",
|
611
|
+
"text": "Promise",
|
612
|
+
"canonicalReference": "!Promise:interface"
|
613
|
+
},
|
614
|
+
{
|
615
|
+
"kind": "Content",
|
616
|
+
"text": "<void>"
|
617
|
+
},
|
618
|
+
{
|
619
|
+
"kind": "Content",
|
620
|
+
"text": ";"
|
621
|
+
}
|
622
|
+
],
|
623
|
+
"isOptional": false,
|
624
|
+
"returnTypeTokenRange": {
|
625
|
+
"startIndex": 5,
|
626
|
+
"endIndex": 7
|
627
|
+
},
|
628
|
+
"releaseTag": "Public",
|
629
|
+
"overloadIndex": 1,
|
630
|
+
"parameters": [
|
631
|
+
{
|
632
|
+
"parameterName": "payload",
|
633
|
+
"parameterTypeTokenRange": {
|
634
|
+
"startIndex": 1,
|
635
|
+
"endIndex": 2
|
636
|
+
},
|
637
|
+
"isOptional": false
|
638
|
+
},
|
639
|
+
{
|
640
|
+
"parameterName": "type",
|
641
|
+
"parameterTypeTokenRange": {
|
642
|
+
"startIndex": 3,
|
643
|
+
"endIndex": 4
|
644
|
+
},
|
645
|
+
"isOptional": true
|
646
|
+
}
|
647
|
+
],
|
648
|
+
"name": "broadcastOnCurrentChannel"
|
649
|
+
},
|
650
|
+
{
|
651
|
+
"kind": "PropertySignature",
|
652
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#currentChannel$:member",
|
653
|
+
"docComment": "/**\n * Observable which emits the current channel When a new channel is joined a new value is emitted\n *\n * @public\n */\n",
|
654
|
+
"excerptTokens": [
|
655
|
+
{
|
656
|
+
"kind": "Content",
|
657
|
+
"text": "currentChannel$: "
|
658
|
+
},
|
659
|
+
{
|
660
|
+
"kind": "Reference",
|
661
|
+
"text": "Observable",
|
662
|
+
"canonicalReference": "rxjs!Observable:class"
|
663
|
+
},
|
664
|
+
{
|
665
|
+
"kind": "Content",
|
666
|
+
"text": "<"
|
667
|
+
},
|
668
|
+
{
|
669
|
+
"kind": "Reference",
|
670
|
+
"text": "FDC3Channel",
|
671
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3Channel:interface"
|
672
|
+
},
|
673
|
+
{
|
674
|
+
"kind": "Content",
|
675
|
+
"text": ">"
|
676
|
+
},
|
677
|
+
{
|
678
|
+
"kind": "Content",
|
679
|
+
"text": ";"
|
680
|
+
}
|
681
|
+
],
|
682
|
+
"isReadonly": false,
|
683
|
+
"isOptional": false,
|
684
|
+
"releaseTag": "Public",
|
685
|
+
"name": "currentChannel$",
|
686
|
+
"propertyTypeTokenRange": {
|
687
|
+
"startIndex": 1,
|
688
|
+
"endIndex": 5
|
689
|
+
}
|
690
|
+
},
|
518
691
|
{
|
519
692
|
"kind": "MethodSignature",
|
520
693
|
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#findIntent:member(1)",
|
@@ -753,6 +926,125 @@
|
|
753
926
|
],
|
754
927
|
"name": "getOrCreateChannel"
|
755
928
|
},
|
929
|
+
{
|
930
|
+
"kind": "MethodSignature",
|
931
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#handleChannelCurrentContext:member(1)",
|
932
|
+
"docComment": "/**\n * Helper function to add a context listener on a channel with a handler for channel messages\n *\n * @param channel - channel instance for getting for getting current context\n *\n * @param contextType - context type of the channel to listen to\n *\n * @param callback - handler to for the channel context listener\n */\n",
|
933
|
+
"excerptTokens": [
|
934
|
+
{
|
935
|
+
"kind": "Content",
|
936
|
+
"text": "handleChannelCurrentContext(channel: "
|
937
|
+
},
|
938
|
+
{
|
939
|
+
"kind": "Reference",
|
940
|
+
"text": "Channel",
|
941
|
+
"canonicalReference": "@finos/fdc3!Channel:interface"
|
942
|
+
},
|
943
|
+
{
|
944
|
+
"kind": "Content",
|
945
|
+
"text": " | "
|
946
|
+
},
|
947
|
+
{
|
948
|
+
"kind": "Reference",
|
949
|
+
"text": "FDC3Channel",
|
950
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3Channel:interface"
|
951
|
+
},
|
952
|
+
{
|
953
|
+
"kind": "Content",
|
954
|
+
"text": ", contextType: "
|
955
|
+
},
|
956
|
+
{
|
957
|
+
"kind": "Content",
|
958
|
+
"text": "string"
|
959
|
+
},
|
960
|
+
{
|
961
|
+
"kind": "Content",
|
962
|
+
"text": ", listenerCallback: "
|
963
|
+
},
|
964
|
+
{
|
965
|
+
"kind": "Content",
|
966
|
+
"text": "(FDC3Context: any) => any"
|
967
|
+
},
|
968
|
+
{
|
969
|
+
"kind": "Content",
|
970
|
+
"text": "): "
|
971
|
+
},
|
972
|
+
{
|
973
|
+
"kind": "Reference",
|
974
|
+
"text": "Promise",
|
975
|
+
"canonicalReference": "!Promise:interface"
|
976
|
+
},
|
977
|
+
{
|
978
|
+
"kind": "Content",
|
979
|
+
"text": "<void>"
|
980
|
+
},
|
981
|
+
{
|
982
|
+
"kind": "Content",
|
983
|
+
"text": ";"
|
984
|
+
}
|
985
|
+
],
|
986
|
+
"isOptional": false,
|
987
|
+
"returnTypeTokenRange": {
|
988
|
+
"startIndex": 9,
|
989
|
+
"endIndex": 11
|
990
|
+
},
|
991
|
+
"releaseTag": "Public",
|
992
|
+
"overloadIndex": 1,
|
993
|
+
"parameters": [
|
994
|
+
{
|
995
|
+
"parameterName": "channel",
|
996
|
+
"parameterTypeTokenRange": {
|
997
|
+
"startIndex": 1,
|
998
|
+
"endIndex": 4
|
999
|
+
},
|
1000
|
+
"isOptional": false
|
1001
|
+
},
|
1002
|
+
{
|
1003
|
+
"parameterName": "contextType",
|
1004
|
+
"parameterTypeTokenRange": {
|
1005
|
+
"startIndex": 5,
|
1006
|
+
"endIndex": 6
|
1007
|
+
},
|
1008
|
+
"isOptional": false
|
1009
|
+
},
|
1010
|
+
{
|
1011
|
+
"parameterName": "listenerCallback",
|
1012
|
+
"parameterTypeTokenRange": {
|
1013
|
+
"startIndex": 7,
|
1014
|
+
"endIndex": 8
|
1015
|
+
},
|
1016
|
+
"isOptional": false
|
1017
|
+
}
|
1018
|
+
],
|
1019
|
+
"name": "handleChannelCurrentContext"
|
1020
|
+
},
|
1021
|
+
{
|
1022
|
+
"kind": "PropertySignature",
|
1023
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#isInteropFdc3:member",
|
1024
|
+
"docComment": "/**\n * Check if the interop global is available.\n *\n * @public\n */\n",
|
1025
|
+
"excerptTokens": [
|
1026
|
+
{
|
1027
|
+
"kind": "Content",
|
1028
|
+
"text": "isInteropFdc3: "
|
1029
|
+
},
|
1030
|
+
{
|
1031
|
+
"kind": "Content",
|
1032
|
+
"text": "() => boolean"
|
1033
|
+
},
|
1034
|
+
{
|
1035
|
+
"kind": "Content",
|
1036
|
+
"text": ";"
|
1037
|
+
}
|
1038
|
+
],
|
1039
|
+
"isReadonly": false,
|
1040
|
+
"isOptional": false,
|
1041
|
+
"releaseTag": "Public",
|
1042
|
+
"name": "isInteropFdc3",
|
1043
|
+
"propertyTypeTokenRange": {
|
1044
|
+
"startIndex": 1,
|
1045
|
+
"endIndex": 2
|
1046
|
+
}
|
1047
|
+
},
|
756
1048
|
{
|
757
1049
|
"kind": "PropertySignature",
|
758
1050
|
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#isReady:member",
|
@@ -780,6 +1072,38 @@
|
|
780
1072
|
"endIndex": 2
|
781
1073
|
}
|
782
1074
|
},
|
1075
|
+
{
|
1076
|
+
"kind": "PropertySignature",
|
1077
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#isReady$:member",
|
1078
|
+
"docComment": "/**\n * Observable indicating the FDC3 API is ready.\n *\n * @public\n */\n",
|
1079
|
+
"excerptTokens": [
|
1080
|
+
{
|
1081
|
+
"kind": "Content",
|
1082
|
+
"text": "isReady$: "
|
1083
|
+
},
|
1084
|
+
{
|
1085
|
+
"kind": "Reference",
|
1086
|
+
"text": "Observable",
|
1087
|
+
"canonicalReference": "rxjs!Observable:class"
|
1088
|
+
},
|
1089
|
+
{
|
1090
|
+
"kind": "Content",
|
1091
|
+
"text": "<true>"
|
1092
|
+
},
|
1093
|
+
{
|
1094
|
+
"kind": "Content",
|
1095
|
+
"text": ";"
|
1096
|
+
}
|
1097
|
+
],
|
1098
|
+
"isReadonly": false,
|
1099
|
+
"isOptional": false,
|
1100
|
+
"releaseTag": "Public",
|
1101
|
+
"name": "isReady$",
|
1102
|
+
"propertyTypeTokenRange": {
|
1103
|
+
"startIndex": 1,
|
1104
|
+
"endIndex": 3
|
1105
|
+
}
|
1106
|
+
},
|
783
1107
|
{
|
784
1108
|
"kind": "MethodSignature",
|
785
1109
|
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#joinChannel:member(1)",
|
@@ -906,6 +1230,66 @@
|
|
906
1230
|
}
|
907
1231
|
],
|
908
1232
|
"name": "raiseIntent"
|
1233
|
+
},
|
1234
|
+
{
|
1235
|
+
"kind": "MethodSignature",
|
1236
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3#raiseIntentForContext:member(1)",
|
1237
|
+
"docComment": "/**\n * Raises an intent against an application based purely on the context data.\n *\n * @param context - The context to use.\n *\n * @returns A promise that resolves with the result of the intent resolution.\n *\n * @public\n */\n",
|
1238
|
+
"excerptTokens": [
|
1239
|
+
{
|
1240
|
+
"kind": "Content",
|
1241
|
+
"text": "raiseIntentForContext(context: "
|
1242
|
+
},
|
1243
|
+
{
|
1244
|
+
"kind": "Reference",
|
1245
|
+
"text": "FDC3Context",
|
1246
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3Context:interface"
|
1247
|
+
},
|
1248
|
+
{
|
1249
|
+
"kind": "Content",
|
1250
|
+
"text": "): "
|
1251
|
+
},
|
1252
|
+
{
|
1253
|
+
"kind": "Reference",
|
1254
|
+
"text": "Promise",
|
1255
|
+
"canonicalReference": "!Promise:interface"
|
1256
|
+
},
|
1257
|
+
{
|
1258
|
+
"kind": "Content",
|
1259
|
+
"text": "<"
|
1260
|
+
},
|
1261
|
+
{
|
1262
|
+
"kind": "Reference",
|
1263
|
+
"text": "FDC3IntentResolution",
|
1264
|
+
"canonicalReference": "@genesislcap/foundation-fdc3!FDC3IntentResolution:interface"
|
1265
|
+
},
|
1266
|
+
{
|
1267
|
+
"kind": "Content",
|
1268
|
+
"text": ">"
|
1269
|
+
},
|
1270
|
+
{
|
1271
|
+
"kind": "Content",
|
1272
|
+
"text": ";"
|
1273
|
+
}
|
1274
|
+
],
|
1275
|
+
"isOptional": false,
|
1276
|
+
"returnTypeTokenRange": {
|
1277
|
+
"startIndex": 3,
|
1278
|
+
"endIndex": 7
|
1279
|
+
},
|
1280
|
+
"releaseTag": "Public",
|
1281
|
+
"overloadIndex": 1,
|
1282
|
+
"parameters": [
|
1283
|
+
{
|
1284
|
+
"parameterName": "context",
|
1285
|
+
"parameterTypeTokenRange": {
|
1286
|
+
"startIndex": 1,
|
1287
|
+
"endIndex": 2
|
1288
|
+
},
|
1289
|
+
"isOptional": false
|
1290
|
+
}
|
1291
|
+
],
|
1292
|
+
"name": "raiseIntentForContext"
|
909
1293
|
}
|
910
1294
|
],
|
911
1295
|
"extendsTokenRanges": []
|