@openfin/core 30.74.13 → 30.74.15
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 +37 -9
- package/package.json +1 -1
- package/src/api/events/webcontents.d.ts +54 -5
- package/src/mock.d.ts +1 -1
- package/src/mock.js +1 -6
package/README.md
CHANGED
|
@@ -8,19 +8,19 @@ Libraries are also available for the following frameworks:
|
|
|
8
8
|
* [.Net](https://developers.openfin.co/of-docs/docs/net-api)
|
|
9
9
|
* [Java](https://developers.openfin.co/of-docs/docs/java-api)
|
|
10
10
|
|
|
11
|
-
## Prerequsites
|
|
12
|
-
|
|
13
|
-
None.
|
|
14
|
-
|
|
15
11
|
## Installation
|
|
16
12
|
|
|
17
13
|
This package cannot be installed as a dev dependency because it is not types-only.
|
|
18
14
|
|
|
19
15
|
With npm:
|
|
20
|
-
|
|
16
|
+
```bash
|
|
17
|
+
$ npm i -S @openfin/core
|
|
18
|
+
```
|
|
21
19
|
|
|
22
20
|
With yarn:
|
|
23
|
-
|
|
21
|
+
```bash
|
|
22
|
+
$ yarn add @openfin/core
|
|
23
|
+
```
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
@@ -35,9 +35,38 @@ const showWindow = async (identity: OpenFin.Identity) => {
|
|
|
35
35
|
const win = await fin.Window.wrap(identity);
|
|
36
36
|
await win.show();
|
|
37
37
|
|
|
38
|
-
const isOpenFin = fin.me.isOpenFin; // false if not in OpenFin
|
|
38
|
+
const isOpenFin = fin.me.isOpenFin; // false if not in OpenFin
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Migrating to v30+
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
### Importing the type
|
|
47
|
+
|
|
48
|
+
To import the `OpenFin` namespace:
|
|
49
|
+
```typescript
|
|
50
|
+
import OpenFin from "@openfin/core";
|
|
51
|
+
|
|
52
|
+
type OFWindow = OpenFin.Window;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### TSConfig types array
|
|
56
|
+
|
|
57
|
+
To have the `OpenFin` available in your code automatically, just update your tsconfig `types` key:
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"compilerOptions": {
|
|
61
|
+
"target": ...,
|
|
62
|
+
"module": ...,
|
|
63
|
+
...,
|
|
64
|
+
"types": ["@openfin/core/OpenFin"]
|
|
65
|
+
}
|
|
39
66
|
}
|
|
67
|
+
|
|
40
68
|
```
|
|
69
|
+
|
|
41
70
|
## For more information
|
|
42
71
|
|
|
43
72
|
- [Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
|
|
@@ -45,11 +74,10 @@ const isOpenFin = fin.me.isOpenFin; // false if not in OpenFin
|
|
|
45
74
|
|
|
46
75
|
## License
|
|
47
76
|
|
|
48
|
-
Copyright 2020-
|
|
77
|
+
Copyright 2020-2023 OpenFin
|
|
49
78
|
|
|
50
79
|
The code in this package is distributed under the Apache License, Version 2.0.
|
|
51
80
|
|
|
52
81
|
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.
|
|
53
82
|
|
|
54
|
-
- [Licensing](https://www.openfin.co/licensing/)
|
|
55
83
|
- [Developer agreement](https://openfin.co/developer-agreement/)
|
package/package.json
CHANGED
|
@@ -67,10 +67,6 @@ export declare type FoundInPageEvent = NamedEvent & {
|
|
|
67
67
|
} & {
|
|
68
68
|
result: OpenFin.FindInPageResult;
|
|
69
69
|
};
|
|
70
|
-
/**
|
|
71
|
-
* A WebContents event that does not propagate to (republish on) parent topics.
|
|
72
|
-
*/
|
|
73
|
-
export declare type NonPropagatedWebContentsEvent = FoundInPageEvent | CertificateErrorEvent;
|
|
74
70
|
export declare type BlurredEvent = NamedEvent & {
|
|
75
71
|
type: 'blurred';
|
|
76
72
|
};
|
|
@@ -89,9 +85,62 @@ export declare type ChildContentOpenedInBrowserEvent = NamedEvent & {
|
|
|
89
85
|
export declare type ChildViewCreatedEvent = NamedEvent & {
|
|
90
86
|
type: 'child-view-created';
|
|
91
87
|
};
|
|
88
|
+
export declare type FileDownloadEvent = NamedEvent & {
|
|
89
|
+
state: 'started' | 'progressing' | 'cancelled' | 'interrupted' | 'completed';
|
|
90
|
+
/**
|
|
91
|
+
* The url from which the file is being downloaded.
|
|
92
|
+
*/
|
|
93
|
+
url: string;
|
|
94
|
+
mimeType: string;
|
|
95
|
+
/**
|
|
96
|
+
* Name used to save the file locally.
|
|
97
|
+
*/
|
|
98
|
+
fileName: string;
|
|
99
|
+
/**
|
|
100
|
+
* Original name of the file.
|
|
101
|
+
*/
|
|
102
|
+
originalFileName: string;
|
|
103
|
+
totalBytes: number;
|
|
104
|
+
/**
|
|
105
|
+
* The number of seconds since the UNIX epoch when the download was started.
|
|
106
|
+
*/
|
|
107
|
+
startTime: number;
|
|
108
|
+
/**
|
|
109
|
+
* The value of the Content-Disposition field from the response header.
|
|
110
|
+
*/
|
|
111
|
+
contentDisposition: string;
|
|
112
|
+
/**
|
|
113
|
+
* The value of the Last-Modified header.
|
|
114
|
+
*/
|
|
115
|
+
lastModifiedTime: Date;
|
|
116
|
+
/**
|
|
117
|
+
* The value of the ETag header.
|
|
118
|
+
*/
|
|
119
|
+
eTag: string;
|
|
120
|
+
/**
|
|
121
|
+
* The number of bytes of the item that have already been downloaded.
|
|
122
|
+
*/
|
|
123
|
+
downloadedBytes: number;
|
|
124
|
+
};
|
|
125
|
+
export declare type FileDownloadStartedEvent = FileDownloadEvent & {
|
|
126
|
+
type: 'file-download-started';
|
|
127
|
+
state: 'started';
|
|
128
|
+
};
|
|
129
|
+
export declare type FileDownloadProgressEvent = FileDownloadEvent & {
|
|
130
|
+
type: 'file-download-progress';
|
|
131
|
+
state: 'progressing' | 'interrupted';
|
|
132
|
+
};
|
|
133
|
+
export declare type FileDownloadCompletedEvent = FileDownloadEvent & {
|
|
134
|
+
type: 'file-download-completed';
|
|
135
|
+
state: 'completed' | 'interrupted' | 'cancelled';
|
|
136
|
+
};
|
|
92
137
|
/**
|
|
93
138
|
* A WebContents event that does propagate to (republish on) parent topics.
|
|
94
139
|
*/
|
|
95
|
-
export declare type WillPropagateWebContentsEvent = BlurredEvent | CertificateSelectionShownEvent | CrashedEvent | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | FaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent;
|
|
140
|
+
export declare type WillPropagateWebContentsEvent = BlurredEvent | CertificateSelectionShownEvent | CrashedEvent | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | FaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent;
|
|
141
|
+
/**
|
|
142
|
+
* A WebContents event that does not propagate to (republish on) parent topics.
|
|
143
|
+
*/
|
|
144
|
+
export declare type NonPropagatedWebContentsEvent = FoundInPageEvent | CertificateErrorEvent;
|
|
96
145
|
export declare type WebContentsEvent = NonPropagatedWebContentsEvent | WillPropagateWebContentsEvent;
|
|
97
146
|
export {};
|
package/src/mock.d.ts
CHANGED
package/src/mock.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fin = void 0;
|
|
4
|
-
|
|
5
|
-
/* eslint-disable spaced-comment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
7
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
8
|
-
/* eslint-disable class-methods-use-this */
|
|
9
|
-
/// <reference path="../OpenFin.d.ts"/>
|
|
4
|
+
const OpenFin = require("./OpenFin");
|
|
10
5
|
const fin_1 = require("./api/fin");
|
|
11
6
|
const transport_1 = require("./transport/transport");
|
|
12
7
|
const mockEnvironment_1 = require("./environment/mockEnvironment");
|