@openfin/core 30.73.17 → 30.73.19
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/OpenFin.d.ts +1 -1752
- package/fdc3.js +2 -0
- package/fdc3.ts +264 -0
- package/fin.d.ts +3 -4
- package/package.json +1 -1
- package/src/GlobalOpenFin.d.ts +4 -0
- package/src/OpenFin.d.ts +1404 -0
- package/src/OpenFin.js +2 -0
- package/src/api/application/Factory.d.ts +1 -0
- package/src/api/application/Instance.d.ts +1 -0
- package/src/api/base.d.ts +1 -0
- package/src/api/clipboard/index.d.ts +1 -0
- package/src/api/events/application.d.ts +3 -2
- package/src/api/events/channel.d.ts +1 -1
- package/src/api/events/externalApplication.d.ts +1 -1
- package/src/api/events/globalHotkey.d.ts +2 -1
- package/src/api/events/system.d.ts +2 -1
- package/src/api/events/view.d.ts +3 -2
- package/src/api/events/webcontents.d.ts +1 -0
- package/src/api/events/window.d.ts +4 -3
- package/src/api/external-application/Factory.d.ts +1 -0
- package/src/api/external-application/Instance.d.ts +1 -0
- package/src/api/fin.d.ts +1 -0
- package/src/api/frame/Factory.d.ts +1 -0
- package/src/api/frame/Instance.d.ts +1 -0
- package/src/api/global-hotkey/index.d.ts +1 -0
- package/src/api/interappbus/channel/channel.d.ts +1 -0
- package/src/api/interappbus/channel/client.d.ts +1 -0
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
- package/src/api/interappbus/channel/connection-manager.js +6 -2
- package/src/api/interappbus/channel/index.d.ts +1 -0
- package/src/api/interappbus/channel/index.js +4 -3
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +1 -0
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +1 -1
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +1 -0
- package/src/api/interappbus/channel/protocols/strategy.d.ts +1 -0
- package/src/api/interappbus/channel/provider.d.ts +1 -0
- package/src/api/interop/Factory.d.ts +1 -0
- package/src/api/interop/Factory.js +1 -1
- package/src/api/interop/InteropBroker.d.ts +33 -2
- package/src/api/interop/InteropBroker.js +63 -15
- package/src/api/interop/InteropClient.d.ts +1 -0
- package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +2 -0
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +2 -0
- package/src/api/interop/fdc3/fdc3-1.2.js +1 -1
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +3 -0
- package/src/api/interop/fdc3/fdc3-2.0.js +6 -13
- package/src/api/interop/fdc3/utils.d.ts +2 -0
- package/src/api/interop/utils.d.ts +2 -0
- package/src/api/interop/utils.js +9 -1
- package/src/api/me.d.ts +1 -0
- package/src/api/platform/Factory.d.ts +1 -0
- package/src/api/platform/Instance.d.ts +1 -0
- package/src/api/platform/common-utils.d.ts +1 -0
- package/src/api/platform/layout/Factory.d.ts +1 -0
- package/src/api/platform/layout/Instance.d.ts +1 -0
- package/src/api/platform/layout/Instance.js +0 -1
- package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
- package/src/api/platform/layout/shapes.d.ts +1 -0
- package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
- package/src/api/snapshot-source/Factory.d.ts +1 -0
- package/src/api/snapshot-source/Factory.js +1 -1
- package/src/api/snapshot-source/Instance.d.ts +1 -0
- package/src/api/snapshot-source/utils.d.ts +1 -0
- package/src/api/system/index.d.ts +2 -1
- package/src/api/system/index.js +1 -1
- package/src/api/view/Factory.d.ts +1 -0
- package/src/api/view/Instance.d.ts +1 -0
- package/src/api/webcontents/main.d.ts +1 -0
- package/src/api/window/Factory.d.ts +1 -0
- package/src/api/window/Instance.d.ts +2 -1
- package/src/api/window/Instance.js +1 -1
- package/src/browser.d.ts +4 -4
- package/src/environment/browser.d.ts +1 -0
- package/src/environment/environment.d.ts +1 -0
- package/src/environment/node-env.d.ts +1 -0
- package/src/environment/openfin-env.d.ts +1 -0
- package/src/mock.d.ts +1 -1
- package/src/mock.js +3 -1
- package/src/shapes/WebOptions.d.ts +1 -0
- package/src/shapes/WindowOptions.d.ts +1 -0
- package/src/shapes/protocol.d.ts +1 -0
- package/src/transport/transport.d.ts +2 -1
package/fdc3.js
ADDED
package/fdc3.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import * as OpenFin from './src/OpenFin';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
4
|
+
export declare namespace FDC3 {
|
|
5
|
+
interface DesktopAgent {
|
|
6
|
+
addContextListener(contextType: string | null, handler: OpenFin.ContextHandler): Listener & Promise<Listener>;
|
|
7
|
+
broadcast(context: OpenFin.Context): Promise<void>;
|
|
8
|
+
getSystemChannels(): Promise<OpenFin.ContextGroupInfo[]>;
|
|
9
|
+
joinChannel(channelId: string): Promise<void>;
|
|
10
|
+
leaveCurrentChannel(): Promise<void>;
|
|
11
|
+
addIntentListener(intent: string, handler: OpenFin.ContextHandler): Listener & Promise<Listener>;
|
|
12
|
+
raiseIntent(intent: string, context: OpenFin.Context, app?: TargetApp): Promise<IntentResolution>;
|
|
13
|
+
findIntent(intent: string, context?: OpenFin.Context): Promise<AppIntent>;
|
|
14
|
+
findIntentsByContext(context: OpenFin.Context): Promise<Array<AppIntent>>;
|
|
15
|
+
raiseIntentForContext(context: OpenFin.Context, app?: TargetApp): Promise<IntentResolution>;
|
|
16
|
+
getInfo(): ImplementationMetadata;
|
|
17
|
+
open(app: FDC3.TargetApp, context?: OpenFin.Context): Promise<void>;
|
|
18
|
+
getOrCreateChannel(channelId: string): Promise<Channel>;
|
|
19
|
+
getCurrentChannel(): Promise<Channel | null>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Listener {
|
|
23
|
+
unsubscribe(): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface AppMetadata {
|
|
27
|
+
name: string;
|
|
28
|
+
appId?: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
tooltip?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
icons?: Array<string>;
|
|
34
|
+
images?: Array<string>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type TargetApp = string | AppMetadata;
|
|
38
|
+
|
|
39
|
+
type Intent = OpenFin.Intent<IntentMetadata>;
|
|
40
|
+
|
|
41
|
+
type IntentMetadata = OpenFin.IntentMetadata<TargetApp>;
|
|
42
|
+
|
|
43
|
+
interface IntentResolution {
|
|
44
|
+
source: TargetApp | null;
|
|
45
|
+
version: string | null;
|
|
46
|
+
data?: any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface DisplayMetadata {
|
|
50
|
+
name?: string;
|
|
51
|
+
color?: string;
|
|
52
|
+
glpyh?: string;
|
|
53
|
+
}
|
|
54
|
+
interface Channel {
|
|
55
|
+
id: string;
|
|
56
|
+
type: string;
|
|
57
|
+
displayMetadata?: DisplayMetadata;
|
|
58
|
+
addContextListener(contextType: string, handler: OpenFin.ContextHandler): Listener & Promise<Listener>;
|
|
59
|
+
broadcast(context: OpenFin.Context): Promise<void>;
|
|
60
|
+
getCurrentContext(contextType?: string): Promise<OpenFin.Context | null>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface AppIntent {
|
|
64
|
+
intent: Intent;
|
|
65
|
+
apps: Array<AppMetadata>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface ImplementationMetadata {
|
|
69
|
+
fdc3Version: string;
|
|
70
|
+
provider: string;
|
|
71
|
+
providerVersion?: string;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
76
|
+
export declare namespace FDC3v2 {
|
|
77
|
+
interface DesktopAgent {
|
|
78
|
+
// apps
|
|
79
|
+
open(app: AppIdentifier | FDC3.TargetApp, context?: OpenFin.Context): Promise<AppIdentifier | void>;
|
|
80
|
+
findInstances(app: AppIdentifier): Promise<Array<AppIdentifier>>;
|
|
81
|
+
getAppMetadata(app: AppIdentifier): Promise<AppMetadata>;
|
|
82
|
+
|
|
83
|
+
// context
|
|
84
|
+
broadcast(context: OpenFin.Context): Promise<void>;
|
|
85
|
+
addContextListener(contextType: string | null, handler: OpenFin.ContextHandler): Promise<FDC3.Listener>;
|
|
86
|
+
|
|
87
|
+
// intents
|
|
88
|
+
findIntent(intent: string, context?: OpenFin.Context, resultType?: string): Promise<AppIntent>;
|
|
89
|
+
findIntentsByContext(context: OpenFin.Context, resultType?: string): Promise<Array<AppIntent>>;
|
|
90
|
+
raiseIntent(
|
|
91
|
+
intent: string,
|
|
92
|
+
context: OpenFin.Context,
|
|
93
|
+
app?: AppIdentifier | FDC3.TargetApp
|
|
94
|
+
): Promise<IntentResolution>;
|
|
95
|
+
raiseIntentForContext(
|
|
96
|
+
context: OpenFin.Context,
|
|
97
|
+
app?: AppIdentifier | FDC3.TargetApp
|
|
98
|
+
): Promise<IntentResolution>;
|
|
99
|
+
addIntentListener(intent: string, handler: IntentHandler): Promise<FDC3.Listener>;
|
|
100
|
+
|
|
101
|
+
// channels
|
|
102
|
+
getOrCreateChannel(channelId: string): Promise<FDC3.Channel>;
|
|
103
|
+
createPrivateChannel(): Promise<PrivateChannel | void>;
|
|
104
|
+
getUserChannels(): Promise<Array<OpenFin.ContextGroupInfo>>;
|
|
105
|
+
|
|
106
|
+
// OPTIONAL channel management functions
|
|
107
|
+
joinUserChannel(channelId: string): Promise<void>;
|
|
108
|
+
getCurrentChannel(): Promise<FDC3.Channel | null>;
|
|
109
|
+
leaveCurrentChannel(): Promise<void>;
|
|
110
|
+
|
|
111
|
+
// implementation info
|
|
112
|
+
getInfo(): Promise<FDC3.ImplementationMetadata>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface AppIdentifier {
|
|
116
|
+
appId: string;
|
|
117
|
+
instanceId?: string;
|
|
118
|
+
}
|
|
119
|
+
interface Listener {
|
|
120
|
+
unsubscribe(): Promise<void>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface Channel {
|
|
124
|
+
id: string;
|
|
125
|
+
type: string;
|
|
126
|
+
displayMetadata?: FDC3.DisplayMetadata;
|
|
127
|
+
addContextListener(contextType: string, handler: OpenFin.ContextHandler): Promise<FDC3v2.Listener>;
|
|
128
|
+
broadcast(context: OpenFin.Context): Promise<void>;
|
|
129
|
+
getCurrentContext(contextType?: string): Promise<OpenFin.Context | null>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface PrivateChannel extends FDC3v2.Channel {
|
|
133
|
+
// methods
|
|
134
|
+
onAddContextListener(handler: (contextType?: string) => void): FDC3v2.Listener;
|
|
135
|
+
onUnsubscribe(handler: (contextType?: string) => void): FDC3v2.Listener;
|
|
136
|
+
onDisconnect(handler: () => void): FDC3v2.Listener;
|
|
137
|
+
disconnect(): void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface FindIntentsByContextOptions {
|
|
141
|
+
context: OpenFin.Context;
|
|
142
|
+
resultType?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface ContextMetadata {
|
|
146
|
+
/** Identifier for the app instance that sent the context and/or intent.
|
|
147
|
+
* @experimental
|
|
148
|
+
*/
|
|
149
|
+
readonly source: AppIdentifier;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface IntentMetadata {
|
|
153
|
+
/** The unique name of the intent that can be invoked by the raiseIntent call. */
|
|
154
|
+
readonly name: string;
|
|
155
|
+
|
|
156
|
+
/** A friendly display name for the intent that should be used to render UI
|
|
157
|
+
* elements.
|
|
158
|
+
*/
|
|
159
|
+
readonly displayName: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
type ContextHandler = (context: OpenFin.Context, metadata?: ContextMetadata) => void;
|
|
163
|
+
type IntentHandler = (context: OpenFin.Context, metadata?: ContextMetadata) => Promise<IntentResult> | void;
|
|
164
|
+
|
|
165
|
+
type IntentResult = OpenFin.Context | FDC3.Channel | PrivateChannel;
|
|
166
|
+
interface Icon {
|
|
167
|
+
src: string;
|
|
168
|
+
size?: string;
|
|
169
|
+
type?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface Image {
|
|
173
|
+
src: string;
|
|
174
|
+
size?: string;
|
|
175
|
+
type?: string;
|
|
176
|
+
label?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface AppMetadata extends AppIdentifier {
|
|
180
|
+
name?: string;
|
|
181
|
+
instanceMetadata?: Record<string, any>;
|
|
182
|
+
title?: string;
|
|
183
|
+
tooltip?: string;
|
|
184
|
+
description?: string;
|
|
185
|
+
icons?: Array<Icon>;
|
|
186
|
+
screenshots?: Array<Image>;
|
|
187
|
+
resultType?: string | null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface IntentResolution {
|
|
191
|
+
/** Identifier for the app instance that was selected (or started) to resolve
|
|
192
|
+
* the intent. `source.instanceId` MUST be set, indicating the specific app
|
|
193
|
+
* instance that received the intent.
|
|
194
|
+
*/
|
|
195
|
+
readonly source: AppIdentifier;
|
|
196
|
+
|
|
197
|
+
/** The intent that was raised. May be used to determine which intent the user
|
|
198
|
+
* chose in response to `fdc3.raiseIntentForContext()`.
|
|
199
|
+
*/
|
|
200
|
+
readonly intent: string;
|
|
201
|
+
|
|
202
|
+
/** The version number of the Intents schema being used.
|
|
203
|
+
*/
|
|
204
|
+
readonly version?: string;
|
|
205
|
+
|
|
206
|
+
/** Retrieves a promise that will resolve to either `Context` data returned
|
|
207
|
+
* by the application that resolves the raised intent or a `Channel`
|
|
208
|
+
* established and returned by the app resolving the intent.
|
|
209
|
+
*
|
|
210
|
+
* A `Channel` returned MAY be of the `PrivateChannel` type. The
|
|
211
|
+
* client can then `addContextListener()` on that channel to, for example,
|
|
212
|
+
* receive a stream of data.
|
|
213
|
+
*
|
|
214
|
+
* If an error occurs (i.e. an error is thrown by the handler function,
|
|
215
|
+
* the promise it returns is rejected, or a promise is not returned by the
|
|
216
|
+
* handler function) then the Desktop Agent MUST reject the promise returned
|
|
217
|
+
* by the `getResult()` function of the `IntentResolution` with a string from
|
|
218
|
+
* the `ResultError` enumeration.
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
// getResult() will be implemented in a future PR
|
|
222
|
+
getResult(): Promise<IntentResult>;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
interface ImplementationMetadata {
|
|
226
|
+
/** The version number of the FDC3 specification that the implementation
|
|
227
|
+
* provides. The string must be a numeric semver version, e.g. 1.2 or 1.2.1.
|
|
228
|
+
*/
|
|
229
|
+
readonly fdc3Version: string;
|
|
230
|
+
|
|
231
|
+
/** The name of the provider of the FDC3 Desktop Agent Implementation
|
|
232
|
+
* (e.g.Finsemble, Glue42, OpenFin etc.).
|
|
233
|
+
*/
|
|
234
|
+
readonly provider: string;
|
|
235
|
+
|
|
236
|
+
/** The version of the provider of the FDC3 Desktop Agent Implementation
|
|
237
|
+
* (e.g. 5.3.0).
|
|
238
|
+
*/
|
|
239
|
+
readonly providerVersion?: string;
|
|
240
|
+
|
|
241
|
+
/** Metadata indicating whether the Desktop Agent implements optional features of
|
|
242
|
+
* the Desktop Agent API.
|
|
243
|
+
*/
|
|
244
|
+
readonly optionalFeatures: {
|
|
245
|
+
/** Used to indicate whether the exposure of 'originating app metadata' for
|
|
246
|
+
* context and intent messages is supported by the Desktop Agent. */
|
|
247
|
+
OriginatingAppMetadata: boolean;
|
|
248
|
+
/** Used to indicate whether the optional `fdc3.joinUserChannel`,
|
|
249
|
+
* `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by
|
|
250
|
+
* the Desktop Agent. */
|
|
251
|
+
UserChannelMembershipAPIs: boolean;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/** The calling application instance's own metadata, according to the
|
|
255
|
+
* Desktop Agent (MUST include at least the `appId` and `instanceId`).
|
|
256
|
+
*/
|
|
257
|
+
readonly appMetadata: AppMetadata;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface AppIntent {
|
|
261
|
+
intent: IntentMetadata;
|
|
262
|
+
apps: Array<AppMetadata>;
|
|
263
|
+
}
|
|
264
|
+
}
|
package/fin.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const fin: import('./src/api/fin').FinApi<'window' | 'view'>;
|
|
1
|
+
/// <reference path="./src/GlobalOpenFin.d.ts"/>
|
|
2
|
+
|
|
3
|
+
declare const fin: import("./src/api/fin").FinApi<'window' | 'view'>;
|
package/package.json
CHANGED