@openfin/core 38.83.80 → 38.83.85
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.
- package/README.md +20 -27
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,52 +1,54 @@
|
|
1
|
-
ℹ️
|
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.
|
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
|
-
|
11
|
-
|
12
|
-
|
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.
|
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.
|
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
|
36
|
+
import OpenFin, { fin } from '@openfin/core';
|
36
37
|
|
37
38
|
const showWindow = async (identity: OpenFin.Identity) => {
|
38
|
-
|
39
|
-
|
39
|
+
const win = await fin.Window.wrap(identity);
|
40
|
+
await win.show();
|
40
41
|
|
41
|
-
|
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
|
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
|
-
-
|
72
|
-
-
|
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
|
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/)
|