@openfin/core 40.100.3 → 40.100.6

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,52 +1,54 @@
1
- ℹ️ *Note: `@openfin/core` is changing the structure of its output. See [v33 Bundling Changes](#v33-bundling-changes)*
2
- ---
1
+ ## ℹ️ _Note: `@openfin/core` is changing the structure of its output. See [v33 Bundling Changes](#v33-bundling-changes)_
3
2
 
4
3
  # OpenFin Core
5
4
 
6
- This package contains the type definitions and API entry points for the OpenFin Core API. Start here to develop OpenFin applications in TypeScript.
5
+ This package contains the type definitions and API entry points for the OpenFin Core API. Start here to develop OpenFin applications in TypeScript.
7
6
 
8
7
  Libraries are also available for the following frameworks:
9
8
 
10
- * [Node.js](https://www.npmjs.com/package/openfin-adapter)
11
- * [.Net](https://developers.openfin.co/of-docs/docs/net-api)
12
- * [Java](https://developers.openfin.co/of-docs/docs/java-api)
9
+ - [Node.js](https://www.npmjs.com/package/openfin-adapter)
10
+ - [.Net](https://developers.openfin.co/of-docs/docs/net-api)
11
+ - [Java](https://developers.openfin.co/of-docs/docs/java-api)
13
12
 
14
13
  ## Installation
15
14
 
16
15
  This package cannot be installed as a dev dependency because it is not types-only.
17
16
 
18
17
  With npm:
18
+
19
19
  ```bash
20
20
  $ npm i -S @openfin/core
21
21
  ```
22
22
 
23
23
  With yarn:
24
+
24
25
  ```bash
25
26
  $ yarn add @openfin/core
26
27
  ```
27
28
 
28
29
  ## Usage
29
30
 
30
- The `fin` export is the primary API entry point. Type definitions are defined in the package's default export.
31
+ The `fin` export is the primary API entry point. Type definitions are defined in the package's default export.
31
32
 
32
- The static `fin.me` object contains some information about the current runtime environment even if imported outside of an OpenFin setting. In this case, the `isOpenFin` property of `fin.me` will be `false`. Outside of OpenFin environments, OpenFin API calls will nullop and throw an error.
33
+ The static `fin.me` object contains some information about the current runtime environment even if imported outside of an OpenFin setting. In this case, the `isOpenFin` property of `fin.me` will be `false`. Outside of OpenFin environments, OpenFin API calls will nullop and throw an error.
33
34
 
34
35
  ```typescript
35
- import OpenFin, { fin } from "@openfin/core";
36
+ import OpenFin, { fin } from '@openfin/core';
36
37
 
37
38
  const showWindow = async (identity: OpenFin.Identity) => {
38
- const win = await fin.Window.wrap(identity);
39
- await win.show();
39
+ const win = await fin.Window.wrap(identity);
40
+ await win.show();
40
41
 
41
- const isOpenFin = fin.me.isOpenFin; // false if not in OpenFin
42
- }
42
+ const isOpenFin = fin.me.isOpenFin; // false if not in OpenFin
43
+ };
43
44
  ```
44
45
 
45
46
  ### Importing the type
46
47
 
47
48
  To import the `OpenFin` namespace:
49
+
48
50
  ```typescript
49
- import OpenFin from "@openfin/core";
51
+ import OpenFin from '@openfin/core';
50
52
 
51
53
  type OFWindow = OpenFin.Window;
52
54
  ```
@@ -54,6 +56,7 @@ type OFWindow = OpenFin.Window;
54
56
  ### TSConfig types array
55
57
 
56
58
  To have the `OpenFin` available in your code automatically, just update your tsconfig `types` key:
59
+
57
60
  ```json
58
61
  {
59
62
  "compilerOptions": {
@@ -68,8 +71,8 @@ To have the `OpenFin` available in your code automatically, just update your tsc
68
71
 
69
72
  ## For more information
70
73
 
71
- - [Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
72
- - [API reference](https://developer.openfin.co/docs/javascript/stable/Platform.html)
74
+ - [Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
75
+ - [API reference](https://developer.openfin.co/docs/javascript/stable/Platform.html)
73
76
 
74
77
  ## Migrations
75
78
 
@@ -79,7 +82,7 @@ To have the `OpenFin` available in your code automatically, just update your tsc
79
82
 
80
83
  These changes will allow for improved API and type discoverability via code suggestion and type inspection, and create a clearer, more dependable usage contract for consumers of the package.
81
84
 
82
- Explicit imports from arbitrary files within the module directory (e.g. "@openfin/core/*") will no longer be supported in new versions of @openfin/core , for example:
85
+ Explicit imports from arbitrary files within the module directory (e.g. "@openfin/core/\*") will no longer be supported in new versions of @openfin/core , for example:
83
86
 
84
87
  ```js
85
88
  import { fin } from '@openfin/core/src/mock';
@@ -96,13 +99,3 @@ Until further notice, older versions of the `@openfin/core` package will be comp
96
99
  ## v30 Ambient type changes
97
100
 
98
101
  Prior to v30, the `OpenFin` namespace was ambiently declared and always available. Starting with v30, you must import it directly or specify it in the tsconfig.
99
-
100
- ## License
101
-
102
- Copyright 2020-2023 OpenFin
103
-
104
- The code in this package is distributed under the Apache License, Version 2.0.
105
-
106
- However, if you run this code, it may call on the OpenFin RVM or OpenFin Runtime, which are covered by OpenFin's Developer, Community, and Enterprise licenses. You can learn more about OpenFin licensing at the links listed below or email us at support@openfin.co with questions.
107
-
108
- - [Developer agreement](https://openfin.co/developer-agreement/)
@@ -593,6 +593,23 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
593
593
  * ```
594
594
  */
595
595
  setTrayIcon(icon: string): Promise<void>;
596
+ /**
597
+ * Set hover text for this application's system tray icon.
598
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
599
+ * @param toolTip
600
+ *
601
+ * @example
602
+ *
603
+ * ```js
604
+ * const app = fin.Application.getCurrentSync();
605
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
606
+ *
607
+ * await app.setTrayIcon(iconUrl);
608
+ *
609
+ * await app.setTrayIconToolTip('My Application');
610
+ * ```
611
+ */
612
+ setTrayIconToolTip(toolTip: string): Promise<void>;
596
613
  /**
597
614
  * Sets new application's shortcut configuration. Windows only.
598
615
  * @param config New application's shortcut configuration.
@@ -11800,6 +11817,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
11800
11817
  'set-tray-icon': ApplicationIdentityCall<{
11801
11818
  enabledIcon: string;
11802
11819
  }, void>;
11820
+ 'set-tray-icon-tooltip': ApplicationIdentityCall<{
11821
+ toolTip: string;
11822
+ }>;
11803
11823
  'set-shortcuts': ApplicationIdentityCall<{
11804
11824
  data: OpenFin_2.ShortCutConfig;
11805
11825
  }, void>;
@@ -593,6 +593,23 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
593
593
  * ```
594
594
  */
595
595
  setTrayIcon(icon: string): Promise<void>;
596
+ /**
597
+ * Set hover text for this application's system tray icon.
598
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
599
+ * @param toolTip
600
+ *
601
+ * @example
602
+ *
603
+ * ```js
604
+ * const app = fin.Application.getCurrentSync();
605
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
606
+ *
607
+ * await app.setTrayIcon(iconUrl);
608
+ *
609
+ * await app.setTrayIconToolTip('My Application');
610
+ * ```
611
+ */
612
+ setTrayIconToolTip(toolTip: string): Promise<void>;
596
613
  /**
597
614
  * Sets new application's shortcut configuration. Windows only.
598
615
  * @param config New application's shortcut configuration.
@@ -11800,6 +11817,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
11800
11817
  'set-tray-icon': ApplicationIdentityCall<{
11801
11818
  enabledIcon: string;
11802
11819
  }, void>;
11820
+ 'set-tray-icon-tooltip': ApplicationIdentityCall<{
11821
+ toolTip: string;
11822
+ }>;
11803
11823
  'set-shortcuts': ApplicationIdentityCall<{
11804
11824
  data: OpenFin_2.ShortCutConfig;
11805
11825
  }, void>;
@@ -593,6 +593,23 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
593
593
  * ```
594
594
  */
595
595
  setTrayIcon(icon: string): Promise<void>;
596
+ /**
597
+ * Set hover text for this application's system tray icon.
598
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
599
+ * @param toolTip
600
+ *
601
+ * @example
602
+ *
603
+ * ```js
604
+ * const app = fin.Application.getCurrentSync();
605
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
606
+ *
607
+ * await app.setTrayIcon(iconUrl);
608
+ *
609
+ * await app.setTrayIconToolTip('My Application');
610
+ * ```
611
+ */
612
+ setTrayIconToolTip(toolTip: string): Promise<void>;
596
613
  /**
597
614
  * Sets new application's shortcut configuration. Windows only.
598
615
  * @param config New application's shortcut configuration.
@@ -11800,6 +11817,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
11800
11817
  'set-tray-icon': ApplicationIdentityCall<{
11801
11818
  enabledIcon: string;
11802
11819
  }, void>;
11820
+ 'set-tray-icon-tooltip': ApplicationIdentityCall<{
11821
+ toolTip: string;
11822
+ }>;
11803
11823
  'set-shortcuts': ApplicationIdentityCall<{
11804
11824
  data: OpenFin_2.ShortCutConfig;
11805
11825
  }, void>;
package/out/mock.d.ts CHANGED
@@ -599,6 +599,23 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
599
599
  * ```
600
600
  */
601
601
  setTrayIcon(icon: string): Promise<void>;
602
+ /**
603
+ * Set hover text for this application's system tray icon.
604
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
605
+ * @param toolTip
606
+ *
607
+ * @example
608
+ *
609
+ * ```js
610
+ * const app = fin.Application.getCurrentSync();
611
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
612
+ *
613
+ * await app.setTrayIcon(iconUrl);
614
+ *
615
+ * await app.setTrayIconToolTip('My Application');
616
+ * ```
617
+ */
618
+ setTrayIconToolTip(toolTip: string): Promise<void>;
602
619
  /**
603
620
  * Sets new application's shortcut configuration. Windows only.
604
621
  * @param config New application's shortcut configuration.
@@ -12201,6 +12218,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
12201
12218
  'set-tray-icon': ApplicationIdentityCall<{
12202
12219
  enabledIcon: string;
12203
12220
  }, void>;
12221
+ 'set-tray-icon-tooltip': ApplicationIdentityCall<{
12222
+ toolTip: string;
12223
+ }>;
12204
12224
  'set-shortcuts': ApplicationIdentityCall<{
12205
12225
  data: OpenFin_2.ShortCutConfig;
12206
12226
  }, void>;
package/out/mock.js CHANGED
@@ -3230,6 +3230,25 @@ function requireInstance$1 () {
3230
3230
  })
3231
3231
  .then(() => undefined);
3232
3232
  }
3233
+ /**
3234
+ * Set hover text for this application's system tray icon.
3235
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
3236
+ * @param toolTip
3237
+ *
3238
+ * @example
3239
+ *
3240
+ * ```js
3241
+ * const app = fin.Application.getCurrentSync();
3242
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
3243
+ *
3244
+ * await app.setTrayIcon(iconUrl);
3245
+ *
3246
+ * await app.setTrayIconToolTip('My Application');
3247
+ * ```
3248
+ */
3249
+ async setTrayIconToolTip(toolTip) {
3250
+ await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
3251
+ }
3233
3252
  /**
3234
3253
  * Sets new application's shortcut configuration. Windows only.
3235
3254
  * @param config New application's shortcut configuration.
@@ -8438,11 +8457,12 @@ class ChannelProvider extends channel_1.ChannelBase {
8438
8457
  return [...__classPrivateFieldGet$9(this, _ChannelProvider_connections, "f")];
8439
8458
  }
8440
8459
  static handleClientDisconnection(channel, payload) {
8441
- const removeById = channel.connections.find((identity) => identity.endpointId === payload.endpointId);
8442
- if (removeById) {
8443
- __classPrivateFieldGet$9(channel, _ChannelProvider_removeEndpoint, "f").call(channel, removeById);
8460
+ if (payload?.endpointId) {
8461
+ const { uuid, name, endpointId, isLocalEndpointId } = payload;
8462
+ __classPrivateFieldGet$9(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8444
8463
  }
8445
8464
  else {
8465
+ // this is here to support older runtimes that did not have endpointId
8446
8466
  const multipleRemoves = channel.connections.filter((identity) => {
8447
8467
  return identity.uuid === payload.uuid && identity.name === payload.name;
8448
8468
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "40.100.3",
3
+ "version": "40.100.6",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/mock.js",