@genesislcap/foundation-fdc3 14.192.2-fdc3-enhancements.3 → 14.192.2-fdc3-enhancements.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -111,11 +111,11 @@ export interface FDC3 {
111
111
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
112
112
  /**
113
113
  * Helper function to add a context listener on a channel with a handler for channel messages
114
- * @param channelName - name of the channel
115
- * @param channelType - type of the channel
114
+ * @param channel - instance of a channel
115
+ * @param channelType - type of the channel context
116
116
  * @param callback - handler to for the channel context listener
117
117
  * */
118
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
118
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<Channel>;
119
119
  /**
120
120
  * Helper function to get the current channel of the application
121
121
  * */
@@ -140,7 +140,7 @@ export declare class DefaultFDC3 implements FDC3 {
140
140
  broadcastOnChannel(channelName: string, type: string, payload: any): Promise<void>;
141
141
  broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
142
142
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
143
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
143
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<FDC3Channel | Channel>;
144
144
  getCurrentChannel(): Promise<Channel>;
145
145
  private broadcastMessageOnChannel;
146
146
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fdc3.d.ts","sourceRoot":"","sources":["../../src/fdc3.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,SAAS,EACT,OAAO,EACP,OAAO,EACP,cAAc,EAOd,OAAO,EACP,gBAAgB,EAKjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,UAAU,EAAW,MAAM,MAAM,CAAC;AAI3C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,kBAA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ha
14
14
  */
15
15
  export interface ChannelConfig {
16
- channelName: string;
16
+ channelName?: string;
17
17
  channelType: string;
18
18
  callback: (any: any) => void;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fdc3-listener.d.ts","sourceRoot":"","sources":["../../../src/util/fdc3-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAGa,YAAa,SAAQ,iBAAiC;IAC3D,IAAI,EAAE,IAAI,CAAC;IAEjB,YAAY,EAAE,YAAY,EAAE,CAAM;IAElC,aAAa,EAAE,aAAa,EAAE,CAAM;IAEpC,OAAO,CAAC,mBAAmB,CAAsB;IAExC,SAAS,IAAI,IAAI;IA0B1B,iBAAiB;IAqBjB,oBAAoB;CAIrB"}
1
+ {"version":3,"file":"fdc3-listener.d.ts","sourceRoot":"","sources":["../../../src/util/fdc3-listener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAGa,YAAa,SAAQ,iBAAiC;IAC3D,IAAI,EAAE,IAAI,CAAC;IAEjB,YAAY,EAAE,YAAY,EAAE,CAAM;IAElC,aAAa,EAAE,aAAa,EAAE,CAAM;IAEpC,OAAO,CAAC,mBAAmB,CAAsB;IAExC,SAAS,IAAI,IAAI;IA0B1B,iBAAiB;IAsBjB,oBAAoB;CAIrB"}
package/dist/esm/fdc3.js CHANGED
@@ -92,9 +92,8 @@ export class DefaultFDC3 {
92
92
  });
93
93
  });
94
94
  }
95
- addChannelListener(channelName, channelType, callback) {
95
+ addChannelListener(channel, channelType, callback) {
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
- const channel = yield getOrCreateChannel(channelName);
98
97
  channel.addContextListener(channelType, callback);
99
98
  return channel;
100
99
  });
@@ -1,4 +1,5 @@
1
- import { __decorate } from "tslib";
1
+ import { __awaiter, __decorate } from "tslib";
2
+ import { getOrCreateChannel } from '@finos/fdc3';
2
3
  import { LifecycleMixin } from '@genesislcap/foundation-utils';
3
4
  import { customElement, FoundationElement } from '@genesislcap/web-core';
4
5
  import { Subscription } from 'rxjs';
@@ -42,16 +43,17 @@ let Fdc3Listener = class Fdc3Listener extends LifecycleMixin(FoundationElement)
42
43
  const listeners = new Map();
43
44
  this.intentConfig.forEach((intent) => listeners.set(intent.intent, intent.callback));
44
45
  this.fdc3.addIntentListeners(listeners);
45
- this.channelConfig.forEach((c) => {
46
+ this.channelConfig.forEach((c) => __awaiter(this, void 0, void 0, function* () {
46
47
  if (c.channelName) {
47
- this.fdc3.addChannelListener(c.channelName, c.channelType, c.callback);
48
+ const channel = yield getOrCreateChannel(c.channelName);
49
+ this.fdc3.addChannelListener(channel, c.channelType, c.callback);
48
50
  }
49
51
  else {
50
52
  this.channelSubscription.add(this.fdc3.currentChannelObs.subscribe((channel) => {
51
- this.fdc3.addChannelListener(channel.id, c.channelType, c.callback);
53
+ this.fdc3.addChannelListener(channel, c.channelType, c.callback);
52
54
  }));
53
55
  }
54
- });
56
+ }));
55
57
  }
56
58
  }
57
59
  disconnectedCallback() {
@@ -202,15 +202,25 @@
202
202
  {
203
203
  "kind": "MethodSignature",
204
204
  "canonicalReference": "@genesislcap/foundation-fdc3!FDC3#addChannelListener:member(1)",
205
- "docComment": "/**\n * Helper function to add a context listener on a channel with a handler for channel messages\n *\n * @param channelName - name of the channel\n *\n * @param channelType - type of the channel\n *\n * @param callback - handler to for the channel context listener\n */\n",
205
+ "docComment": "/**\n * Helper function to add a context listener on a channel with a handler for channel messages\n *\n * @param channel - instance of a channel\n *\n * @param channelType - type of the channel context\n *\n * @param callback - handler to for the channel context listener\n */\n",
206
206
  "excerptTokens": [
207
207
  {
208
208
  "kind": "Content",
209
- "text": "addChannelListener(channelName: "
209
+ "text": "addChannelListener(channel: "
210
+ },
211
+ {
212
+ "kind": "Reference",
213
+ "text": "FDC3Channel",
214
+ "canonicalReference": "@genesislcap/foundation-fdc3!FDC3Channel:interface"
210
215
  },
211
216
  {
212
217
  "kind": "Content",
213
- "text": "string"
218
+ "text": " | "
219
+ },
220
+ {
221
+ "kind": "Reference",
222
+ "text": "Channel",
223
+ "canonicalReference": "@finos/fdc3!Channel:interface"
214
224
  },
215
225
  {
216
226
  "kind": "Content",
@@ -257,33 +267,33 @@
257
267
  ],
258
268
  "isOptional": false,
259
269
  "returnTypeTokenRange": {
260
- "startIndex": 7,
261
- "endIndex": 11
270
+ "startIndex": 9,
271
+ "endIndex": 13
262
272
  },
263
273
  "releaseTag": "Public",
264
274
  "overloadIndex": 1,
265
275
  "parameters": [
266
276
  {
267
- "parameterName": "channelName",
277
+ "parameterName": "channel",
268
278
  "parameterTypeTokenRange": {
269
279
  "startIndex": 1,
270
- "endIndex": 2
280
+ "endIndex": 4
271
281
  },
272
282
  "isOptional": false
273
283
  },
274
284
  {
275
285
  "parameterName": "channelType",
276
286
  "parameterTypeTokenRange": {
277
- "startIndex": 3,
278
- "endIndex": 4
287
+ "startIndex": 5,
288
+ "endIndex": 6
279
289
  },
280
290
  "isOptional": false
281
291
  },
282
292
  {
283
293
  "parameterName": "callback",
284
294
  "parameterTypeTokenRange": {
285
- "startIndex": 5,
286
- "endIndex": 6
295
+ "startIndex": 7,
296
+ "endIndex": 8
287
297
  },
288
298
  "isOptional": false
289
299
  }
@@ -23,7 +23,7 @@ import { ViewTemplate } from '@microsoft/fast-element';
23
23
  * @alpha
24
24
  */
25
25
  export declare interface ChannelConfig {
26
- channelName: string;
26
+ channelName?: string;
27
27
  channelType: string;
28
28
  callback: (any: any) => void;
29
29
  }
@@ -47,7 +47,7 @@ export declare class DefaultFDC3 implements FDC3 {
47
47
  broadcastOnChannel(channelName: string, type: string, payload: any): Promise<void>;
48
48
  broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
49
49
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
50
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
50
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<FDC3Channel | Channel>;
51
51
  getCurrentChannel(): Promise<Channel>;
52
52
  private broadcastMessageOnChannel;
53
53
  }
@@ -132,11 +132,11 @@ export declare interface FDC3 {
132
132
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
133
133
  /**
134
134
  * Helper function to add a context listener on a channel with a handler for channel messages
135
- * @param channelName - name of the channel
136
- * @param channelType - type of the channel
135
+ * @param channel - instance of a channel
136
+ * @param channelType - type of the channel context
137
137
  * @param callback - handler to for the channel context listener
138
138
  * */
139
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
139
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<Channel>;
140
140
  /**
141
141
  * Helper function to get the current channel of the application
142
142
  * */
@@ -9,15 +9,15 @@ Helper function to add a context listener on a channel with a handler for channe
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
12
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<Channel>;
13
13
  ```
14
14
 
15
15
  ## Parameters
16
16
 
17
17
  | Parameter | Type | Description |
18
18
  | --- | --- | --- |
19
- | channelName | string | name of the channel |
20
- | channelType | string | type of the channel |
19
+ | channel | [FDC3Channel](./foundation-fdc3.fdc3channel.md) \| Channel | instance of a channel |
20
+ | channelType | string | type of the channel context |
21
21
  | callback | (any: any) =&gt; void | handler to for the channel context listener |
22
22
 
23
23
  **Returns:**
@@ -23,7 +23,7 @@ export interface FDC3
23
23
 
24
24
  | Method | Description |
25
25
  | --- | --- |
26
- | [addChannelListener(channelName, channelType, callback)](./foundation-fdc3.fdc3.addchannellistener.md) | Helper function to add a context listener on a channel with a handler for channel messages |
26
+ | [addChannelListener(channel, channelType, callback)](./foundation-fdc3.fdc3.addchannellistener.md) | Helper function to add a context listener on a channel with a handler for channel messages |
27
27
  | [addIntentListeners(listeners)](./foundation-fdc3.fdc3.addintentlisteners.md) | Adds intent listeners for the specified intents. |
28
28
  | [broadcastOnChannel(channelName, type, payload)](./foundation-fdc3.fdc3.broadcastonchannel.md) | Broadcasts a message on a given channel with a given type |
29
29
  | [broadcastOnChannelEventHandler(channelName, type)](./foundation-fdc3.fdc3.broadcastonchanneleventhandler.md) | Helper function to broadcast message on channel in response to dispatched event |
@@ -29,7 +29,7 @@ export interface ChannelConfig {
29
29
  // (undocumented)
30
30
  callback: (any: any) => void;
31
31
  // (undocumented)
32
- channelName: string;
32
+ channelName?: string;
33
33
  // (undocumented)
34
34
  channelType: string;
35
35
  }
@@ -40,7 +40,7 @@ export interface ChannelConfig {
40
40
  export class DefaultFDC3 implements FDC3 {
41
41
  constructor();
42
42
  // (undocumented)
43
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
43
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<FDC3Channel | Channel>;
44
44
  // (undocumented)
45
45
  addIntentListeners(listeners: Map<FDC3Intents, FDC3ContextHandler>): void;
46
46
  // (undocumented)
@@ -71,7 +71,7 @@ export class DefaultFDC3 implements FDC3 {
71
71
  //
72
72
  // @public
73
73
  export interface FDC3 {
74
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
74
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<Channel>;
75
75
  addIntentListeners(listeners: Map<FDC3Intents, FDC3ContextHandler>): void;
76
76
  broadcastOnChannel(channelName: string, type: string, payload: any): Promise<void>;
77
77
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-fdc3",
3
3
  "description": "Genesis Foundation FDC3",
4
- "version": "14.192.2-fdc3-enhancements.3",
4
+ "version": "14.192.2-fdc3-enhancements.4",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -59,22 +59,22 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@genesislcap/foundation-testing": "14.192.2-fdc3-enhancements.3",
63
- "@genesislcap/genx": "14.192.2-fdc3-enhancements.3",
64
- "@genesislcap/rollup-builder": "14.192.2-fdc3-enhancements.3",
65
- "@genesislcap/ts-builder": "14.192.2-fdc3-enhancements.3",
66
- "@genesislcap/uvu-playwright-builder": "14.192.2-fdc3-enhancements.3",
67
- "@genesislcap/vite-builder": "14.192.2-fdc3-enhancements.3",
68
- "@genesislcap/webpack-builder": "14.192.2-fdc3-enhancements.3",
62
+ "@genesislcap/foundation-testing": "14.192.2-fdc3-enhancements.4",
63
+ "@genesislcap/genx": "14.192.2-fdc3-enhancements.4",
64
+ "@genesislcap/rollup-builder": "14.192.2-fdc3-enhancements.4",
65
+ "@genesislcap/ts-builder": "14.192.2-fdc3-enhancements.4",
66
+ "@genesislcap/uvu-playwright-builder": "14.192.2-fdc3-enhancements.4",
67
+ "@genesislcap/vite-builder": "14.192.2-fdc3-enhancements.4",
68
+ "@genesislcap/webpack-builder": "14.192.2-fdc3-enhancements.4",
69
69
  "rimraf": "^5.0.0"
70
70
  },
71
71
  "dependencies": {
72
72
  "@finos/fdc3": "^1.2.0",
73
- "@genesislcap/foundation-logger": "14.192.2-fdc3-enhancements.3",
74
- "@genesislcap/foundation-notifications": "14.192.2-fdc3-enhancements.3",
75
- "@genesislcap/foundation-ui": "14.192.2-fdc3-enhancements.3",
76
- "@genesislcap/foundation-utils": "14.192.2-fdc3-enhancements.3",
77
- "@genesislcap/web-core": "14.192.2-fdc3-enhancements.3",
73
+ "@genesislcap/foundation-logger": "14.192.2-fdc3-enhancements.4",
74
+ "@genesislcap/foundation-notifications": "14.192.2-fdc3-enhancements.4",
75
+ "@genesislcap/foundation-ui": "14.192.2-fdc3-enhancements.4",
76
+ "@genesislcap/foundation-utils": "14.192.2-fdc3-enhancements.4",
77
+ "@genesislcap/web-core": "14.192.2-fdc3-enhancements.4",
78
78
  "@interopio/desktop": "^6.3.1",
79
79
  "@microsoft/fast-element": "^1.12.0",
80
80
  "@microsoft/fast-foundation": "^2.49.4",
@@ -89,5 +89,5 @@
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  },
92
- "gitHead": "48c1539e9542d91c58f9ea72decc26952aa0ad2c"
92
+ "gitHead": "d7f7350aa56a095dd9d9b989a7a5c3ea18ca48f9"
93
93
  }