@openfin/core 28.71.14 → 28.71.17
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 +26 -0
- package/package.json +1 -1
- package/src/api/application/Factory.d.ts +2 -1
- package/src/api/application/Factory.js +3 -2
- package/src/api/application/Instance.d.ts +6 -0
- package/src/api/application/Instance.js +8 -0
- package/src/api/interop/Factory.d.ts +1 -1
- package/src/api/interop/Factory.js +8 -2
- package/src/api/interop/InteropBroker.d.ts +11 -2
- package/src/api/interop/InteropBroker.js +61 -27
- package/src/api/interop/InteropClient.d.ts +9 -2
- package/src/api/interop/InteropClient.js +21 -16
- package/src/api/interop/SessionContextGroupClient.js +3 -0
- package/src/api/interop/utils.d.ts +1 -0
- package/src/api/interop/utils.js +12 -1
- package/src/api/platform/layout/Factory.js +5 -1
- package/src/api/platform/layout/SplitterController/bounds-observer.d.ts +17 -0
- package/src/api/platform/layout/SplitterController/bounds-observer.js +49 -0
- package/src/api/platform/layout/SplitterController/index.d.ts +29 -0
- package/src/api/platform/layout/SplitterController/index.js +81 -0
- package/src/api/platform/layout/SplitterController/view-overlay.d.ts +23 -0
- package/src/api/platform/layout/SplitterController/view-overlay.js +30 -0
- package/src/api/system/index.d.ts +8 -0
- package/src/api/system/index.js +10 -0
- package/src/api/view/Instance.d.ts +6 -2
- package/src/api/view/Instance.js +6 -2
- package/src/api/window/Instance.d.ts +25 -7
- package/src/api/window/Instance.js +25 -7
- package/src/shapes/protocol.d.ts +39 -92
package/OpenFin.d.ts
CHANGED
|
@@ -254,6 +254,19 @@ declare namespace OpenFin {
|
|
|
254
254
|
|
|
255
255
|
export type WindowOptions = MutableWindowOptions & ConstWindowOptions;
|
|
256
256
|
|
|
257
|
+
export interface ShowViewOnWindowResizeOptions {
|
|
258
|
+
enabled?: boolean;
|
|
259
|
+
paintIntervalMs?: number;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface ShowViewOnSplitterDragOptions {
|
|
263
|
+
enabled?: boolean;
|
|
264
|
+
}
|
|
265
|
+
export type ViewVisibilityOptions = {
|
|
266
|
+
showViewsOnWindowResize?: ShowViewOnWindowResizeOptions;
|
|
267
|
+
showViewsOnSplitterDrag?: ShowViewOnSplitterDragOptions;
|
|
268
|
+
};
|
|
269
|
+
|
|
257
270
|
export type WindowState = 'maximized' | 'minimized' | 'normal';
|
|
258
271
|
|
|
259
272
|
export type ConstWindowOptions = {
|
|
@@ -294,6 +307,8 @@ declare namespace OpenFin {
|
|
|
294
307
|
y: number;
|
|
295
308
|
experimental?: any;
|
|
296
309
|
fdc3InteropApi?: string;
|
|
310
|
+
// Platform only
|
|
311
|
+
viewVisibility?: ViewVisibilityOptions;
|
|
297
312
|
};
|
|
298
313
|
|
|
299
314
|
export type MutableWindowOptions = {
|
|
@@ -1114,6 +1129,7 @@ declare namespace OpenFin {
|
|
|
1114
1129
|
export type RvmLaunchOptions = {
|
|
1115
1130
|
noUi?: boolean;
|
|
1116
1131
|
userAppConfigArgs?: object;
|
|
1132
|
+
timeToLive?: number;
|
|
1117
1133
|
};
|
|
1118
1134
|
|
|
1119
1135
|
export type ShortCutConfig = {
|
|
@@ -1692,4 +1708,14 @@ declare namespace OpenFin {
|
|
|
1692
1708
|
| 'navigateForward'
|
|
1693
1709
|
| 'navigateBack'
|
|
1694
1710
|
| 'print';
|
|
1711
|
+
|
|
1712
|
+
export type InteropBrokerDisconnectionEvent = {
|
|
1713
|
+
type: string;
|
|
1714
|
+
topic: string;
|
|
1715
|
+
brokerName: string;
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
export type InteropClientOnDisconnectionListener = (
|
|
1719
|
+
InteropBrokerDisconnectionEvent: InteropBrokerDisconnectionEvent
|
|
1720
|
+
) => any;
|
|
1695
1721
|
}
|
package/package.json
CHANGED
|
@@ -111,12 +111,13 @@ export default class ApplicationModule extends Base {
|
|
|
111
111
|
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
112
112
|
* Returns once the RVM is finished attempting to launch the applications.
|
|
113
113
|
* @param { Array.<ManifestInfo> } applications
|
|
114
|
+
* @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
|
|
114
115
|
* @return {Promise.<void>}
|
|
115
116
|
* @static
|
|
116
117
|
* @tutorial Application.startManyManifests
|
|
117
118
|
* @experimental
|
|
118
119
|
*/
|
|
119
|
-
startManyManifests(applications: Array<OpenFin.ManifestInfo
|
|
120
|
+
startManyManifests(applications: Array<OpenFin.ManifestInfo>, opts?: OpenFin.RvmLaunchOptions): Promise<void>;
|
|
120
121
|
/**
|
|
121
122
|
* Asynchronously returns an Application object that represents the current application
|
|
122
123
|
* @return {Promise.<Application>}
|
|
@@ -156,13 +156,14 @@ class ApplicationModule extends base_1.Base {
|
|
|
156
156
|
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
157
157
|
* Returns once the RVM is finished attempting to launch the applications.
|
|
158
158
|
* @param { Array.<ManifestInfo> } applications
|
|
159
|
+
* @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
|
|
159
160
|
* @return {Promise.<void>}
|
|
160
161
|
* @static
|
|
161
162
|
* @tutorial Application.startManyManifests
|
|
162
163
|
* @experimental
|
|
163
164
|
*/
|
|
164
|
-
async startManyManifests(applications) {
|
|
165
|
-
return this.wire.sendAction('run-applications', { applications }).then(() => undefined);
|
|
165
|
+
async startManyManifests(applications, opts) {
|
|
166
|
+
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
166
167
|
}
|
|
167
168
|
/**
|
|
168
169
|
* Asynchronously returns an Application object that represents the current application
|
|
@@ -264,6 +264,12 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvents>
|
|
|
264
264
|
* @tutorial Application.getTrayIconInfo
|
|
265
265
|
*/
|
|
266
266
|
getTrayIconInfo(): Promise<OpenFin.TrayInfo>;
|
|
267
|
+
/**
|
|
268
|
+
* @summary Checks if the application has an associated tray icon.
|
|
269
|
+
* @return {Promise.<boolean>}
|
|
270
|
+
* @tutorial Application.hasTrayIcon
|
|
271
|
+
*/
|
|
272
|
+
hasTrayIcon(): Promise<boolean>;
|
|
267
273
|
/**
|
|
268
274
|
* Closes the application by terminating its process.
|
|
269
275
|
* @return {Promise.<void>}
|
|
@@ -363,6 +363,14 @@ class Application extends base_1.EmitterBase {
|
|
|
363
363
|
getTrayIconInfo() {
|
|
364
364
|
return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
|
|
365
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* @summary Checks if the application has an associated tray icon.
|
|
368
|
+
* @return {Promise.<boolean>}
|
|
369
|
+
* @tutorial Application.hasTrayIcon
|
|
370
|
+
*/
|
|
371
|
+
hasTrayIcon() {
|
|
372
|
+
return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
|
|
373
|
+
}
|
|
366
374
|
/**
|
|
367
375
|
* Closes the application by terminating its process.
|
|
368
376
|
* @return {Promise.<void>}
|
|
@@ -29,10 +29,16 @@ class InteropModule extends base_1.Base {
|
|
|
29
29
|
this.wire.sendAction('interop-init').catch((e) => {
|
|
30
30
|
// don't expose, analytics-only call
|
|
31
31
|
});
|
|
32
|
-
const provider = await this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
|
|
33
32
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
34
33
|
const options = await this.fin.Application.getCurrentSync().getInfo();
|
|
35
|
-
|
|
34
|
+
let provider;
|
|
35
|
+
const getProvider = () => {
|
|
36
|
+
if (!provider) {
|
|
37
|
+
provider = this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
|
|
38
|
+
}
|
|
39
|
+
return provider;
|
|
40
|
+
};
|
|
41
|
+
return override(InteropBroker_1.InteropBroker, this.wire, getProvider, options.initialOptions.interopBrokerConfiguration || {});
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* Connects a client to an Interop broker. This is called under-the-hood for Views in a Platform.
|
|
@@ -124,13 +124,14 @@ import Identity = OpenFin.Identity;
|
|
|
124
124
|
* @class
|
|
125
125
|
*/
|
|
126
126
|
export declare class InteropBroker extends Base {
|
|
127
|
-
private
|
|
127
|
+
private getProvider;
|
|
128
128
|
private interopClients;
|
|
129
129
|
private contextGroupsById;
|
|
130
130
|
private intentClientMap;
|
|
131
131
|
private lastContextMap;
|
|
132
132
|
private sessionContextGroupMap;
|
|
133
|
-
|
|
133
|
+
private channel;
|
|
134
|
+
constructor(wire: Transport, getProvider: () => Promise<OpenFin.ChannelProvider>, options?: any);
|
|
134
135
|
/**
|
|
135
136
|
* SetContextOptions interface
|
|
136
137
|
* @typedef { object } SetContextOptions
|
|
@@ -314,6 +315,13 @@ export declare class InteropBroker extends Base {
|
|
|
314
315
|
* @experimental
|
|
315
316
|
*/
|
|
316
317
|
handleFiredIntentForContext(contextForIntent: OpenFin.ContextForIntent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
318
|
+
/**
|
|
319
|
+
* Provides the identity of any Interop Client that disconnects from the Interop Broker. It is meant to be overriden.
|
|
320
|
+
* @param clientIdentity
|
|
321
|
+
* @return { Promise<void> }
|
|
322
|
+
* @tutorial interop.clientDisconnected
|
|
323
|
+
*/
|
|
324
|
+
clientDisconnected(clientIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
317
325
|
decorateSnapshot(snapshot: OpenFin.Snapshot): OpenFin.Snapshot;
|
|
318
326
|
applySnapshot(snapshot: OpenFin.Snapshot, options: OpenFin.ApplySnapshotOptions): void;
|
|
319
327
|
updateExistingClients(contextGroupStates: OpenFin.ContextGroupStates): void;
|
|
@@ -345,6 +353,7 @@ export declare class InteropBroker extends Base {
|
|
|
345
353
|
static isContextTypeCompatible(contextType: string, registeredContextType: string | undefined): boolean;
|
|
346
354
|
private setContextGroupMap;
|
|
347
355
|
private static setCurrentContextGroupInClientOptions;
|
|
356
|
+
private setupChannelProvider;
|
|
348
357
|
private wireChannel;
|
|
349
358
|
/**
|
|
350
359
|
* Can be used to completely prevent a connection. Return false to prevent connections. Allows all connections by default.
|
|
@@ -171,9 +171,9 @@ let contextGroups = [
|
|
|
171
171
|
* @class
|
|
172
172
|
*/
|
|
173
173
|
class InteropBroker extends base_1.Base {
|
|
174
|
-
constructor(wire,
|
|
174
|
+
constructor(wire, getProvider, options) {
|
|
175
175
|
super(wire);
|
|
176
|
-
this.
|
|
176
|
+
this.getProvider = getProvider;
|
|
177
177
|
this.interopClients = new Map();
|
|
178
178
|
this.contextGroupsById = new Map();
|
|
179
179
|
if (options.contextGroups) {
|
|
@@ -183,7 +183,7 @@ class InteropBroker extends base_1.Base {
|
|
|
183
183
|
this.lastContextMap = new Map();
|
|
184
184
|
this.sessionContextGroupMap = new Map();
|
|
185
185
|
this.setContextGroupMap();
|
|
186
|
-
this.
|
|
186
|
+
this.setupChannelProvider();
|
|
187
187
|
}
|
|
188
188
|
/*
|
|
189
189
|
Client API
|
|
@@ -321,19 +321,24 @@ class InteropBroker extends base_1.Base {
|
|
|
321
321
|
await this.addClientToContextGroup({ contextGroupId }, target);
|
|
322
322
|
}
|
|
323
323
|
// Sanity check here in case a single app has multiple connections
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
324
|
+
try {
|
|
325
|
+
const allConnections = this.channel.connections.filter((x) => x.uuid === target.uuid && x.name === target.name);
|
|
326
|
+
if (!allConnections.length) {
|
|
327
|
+
throw new Error(`Given Identity ${target.uuid} ${target.name} is not connected to the Interop Broker.`);
|
|
328
|
+
}
|
|
329
|
+
if (allConnections.length > 1) {
|
|
330
|
+
// Should figure out how we want to handle this situation. In the meantime, just change context group for all connections.
|
|
331
|
+
console.warn(`More than one connection found for identity ${target.uuid} ${target.name}`);
|
|
332
|
+
}
|
|
333
|
+
const promises = [];
|
|
334
|
+
for (const connection of allConnections) {
|
|
335
|
+
promises.push(this.addClientToContextGroup({ contextGroupId }, connection));
|
|
336
|
+
}
|
|
337
|
+
await Promise.all(promises);
|
|
331
338
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
promises.push(this.addClientToContextGroup({ contextGroupId }, connection));
|
|
339
|
+
catch (error) {
|
|
340
|
+
throw new Error(error);
|
|
335
341
|
}
|
|
336
|
-
await Promise.all(promises);
|
|
337
342
|
}
|
|
338
343
|
else {
|
|
339
344
|
// No target provided, add the sender to the context group.
|
|
@@ -402,19 +407,24 @@ class InteropBroker extends base_1.Base {
|
|
|
402
407
|
if (InteropBroker.hasEndpointId(target)) {
|
|
403
408
|
await this.removeClientFromContextGroup(target);
|
|
404
409
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
try {
|
|
411
|
+
// Sanity check here in case a single app has multiple connections
|
|
412
|
+
const allConnections = this.channel.connections.filter((x) => x.uuid === target.uuid && x.name === target.name);
|
|
413
|
+
if (!allConnections.length) {
|
|
414
|
+
throw new Error(`No connection found for given Identity ${target.uuid} ${target.name}`);
|
|
415
|
+
}
|
|
416
|
+
if (allConnections.length > 1) {
|
|
417
|
+
console.warn(`More than one connection found for identity ${target.uuid} ${target.name}`);
|
|
418
|
+
}
|
|
419
|
+
const promises = [];
|
|
420
|
+
for (const connection of allConnections) {
|
|
421
|
+
promises.push(this.removeClientFromContextGroup(connection));
|
|
422
|
+
}
|
|
423
|
+
await Promise.all(promises);
|
|
412
424
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
promises.push(this.removeClientFromContextGroup(connection));
|
|
425
|
+
catch (error) {
|
|
426
|
+
throw new Error(error);
|
|
416
427
|
}
|
|
417
|
-
await Promise.all(promises);
|
|
418
428
|
}
|
|
419
429
|
else {
|
|
420
430
|
// No target provided, remove the sender from the context group.
|
|
@@ -592,6 +602,17 @@ class InteropBroker extends base_1.Base {
|
|
|
592
602
|
console.warn(warning);
|
|
593
603
|
throw new Error(utils_1.BROKER_ERRORS.fireIntentForContext);
|
|
594
604
|
}
|
|
605
|
+
/**
|
|
606
|
+
* Provides the identity of any Interop Client that disconnects from the Interop Broker. It is meant to be overriden.
|
|
607
|
+
* @param clientIdentity
|
|
608
|
+
* @return { Promise<void> }
|
|
609
|
+
* @tutorial interop.clientDisconnected
|
|
610
|
+
*/
|
|
611
|
+
// eslint-disable-next-line class-methods-use-this
|
|
612
|
+
async clientDisconnected(clientIdentity) {
|
|
613
|
+
// This function is called in channel.onDisconnection.
|
|
614
|
+
// It is meant to be overridden to inform when an Interop Client has been disconnected.
|
|
615
|
+
}
|
|
595
616
|
/*
|
|
596
617
|
Snapshot APIs
|
|
597
618
|
*/
|
|
@@ -706,8 +727,10 @@ class InteropBroker extends base_1.Base {
|
|
|
706
727
|
}
|
|
707
728
|
// Used to invoke a client's context handler
|
|
708
729
|
invokeContextHandler(clientIdentity, handlerId, context) {
|
|
709
|
-
this.
|
|
710
|
-
|
|
730
|
+
this.getProvider().then((channel) => {
|
|
731
|
+
channel.dispatch(clientIdentity, handlerId, context).catch((e) => {
|
|
732
|
+
console.error(`Error invoking context handler ${handlerId} for context type ${context.type} in client ${clientIdentity.uuid}/${clientIdentity.name}/${clientIdentity.endpointId}`, e);
|
|
733
|
+
});
|
|
711
734
|
});
|
|
712
735
|
}
|
|
713
736
|
// Used to remove a context handler for a client
|
|
@@ -826,6 +849,16 @@ class InteropBroker extends base_1.Base {
|
|
|
826
849
|
console.warn(`Setting Current Context Group: Entity with identity ${clientIdentity.uuid}, ${clientIdentity.name} is not a window or view. It is a ${entityInfo.entityType} instead.`);
|
|
827
850
|
}
|
|
828
851
|
}
|
|
852
|
+
async setupChannelProvider() {
|
|
853
|
+
try {
|
|
854
|
+
const channel = await this.getProvider();
|
|
855
|
+
this.channel = channel;
|
|
856
|
+
this.wireChannel(channel);
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
throw new Error(`Error setting up Interop Broker Channel Provider: ${error}`);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
829
862
|
// Setup Channel Connection Logic
|
|
830
863
|
wireChannel(channel) {
|
|
831
864
|
channel.onConnection((clientIdentity, payload) => {
|
|
@@ -857,6 +890,7 @@ class InteropBroker extends base_1.Base {
|
|
|
857
890
|
this.sessionContextGroupMap.forEach((sessionContextGroup) => {
|
|
858
891
|
sessionContextGroup.onDisconnection(clientIdentity);
|
|
859
892
|
});
|
|
893
|
+
this.clientDisconnected(clientIdentity);
|
|
860
894
|
});
|
|
861
895
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
862
896
|
// @ts-ignore
|
|
@@ -138,7 +138,7 @@ import { Base } from '../base';
|
|
|
138
138
|
*/
|
|
139
139
|
export declare class InteropClient extends Base {
|
|
140
140
|
#private;
|
|
141
|
-
constructor(wire: Transport, name: string, interopConfig
|
|
141
|
+
constructor(wire: Transport, name: string, interopConfig?: OpenFin.InteropConfig);
|
|
142
142
|
/**
|
|
143
143
|
* Sets a context for the context group of the current entity.
|
|
144
144
|
* @param { Context } context - New context to set.
|
|
@@ -264,5 +264,12 @@ export declare class InteropClient extends Base {
|
|
|
264
264
|
* @experimental
|
|
265
265
|
*/
|
|
266
266
|
joinSessionContextGroup(sessionContextGroupId: string): Promise<OpenFin.SessionContextGroup>;
|
|
267
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Register a listener that is called when the Interop Client has been disconnected from the Interop Broker.
|
|
269
|
+
* Only one listener per Interop Client can be set.
|
|
270
|
+
* @param listener
|
|
271
|
+
* @return { Promise<void> }
|
|
272
|
+
* @tutorial interop.onDisconnection
|
|
273
|
+
*/
|
|
274
|
+
onDisconnection(listener: OpenFin.InteropClientOnDisconnectionListener): Promise<void>;
|
|
268
275
|
}
|
|
@@ -155,7 +155,7 @@ const utils_1 = require("./utils");
|
|
|
155
155
|
* @class
|
|
156
156
|
*/
|
|
157
157
|
class InteropClient extends base_1.Base {
|
|
158
|
-
constructor(wire, name, interopConfig) {
|
|
158
|
+
constructor(wire, name, interopConfig = {}) {
|
|
159
159
|
super(wire);
|
|
160
160
|
_clientPromise.set(this, void 0);
|
|
161
161
|
_sessionContextGroups.set(this, void 0);
|
|
@@ -193,6 +193,9 @@ class InteropClient extends base_1.Base {
|
|
|
193
193
|
this.wire.sendAction('interop-client-add-context-handler').catch((e) => {
|
|
194
194
|
// don't expose, analytics-only call
|
|
195
195
|
});
|
|
196
|
+
if (typeof handler !== 'function') {
|
|
197
|
+
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
198
|
+
}
|
|
196
199
|
const client = await __classPrivateFieldGet(this, _clientPromise);
|
|
197
200
|
let handlerId;
|
|
198
201
|
if (contextType) {
|
|
@@ -327,7 +330,7 @@ class InteropClient extends base_1.Base {
|
|
|
327
330
|
});
|
|
328
331
|
const client = await __classPrivateFieldGet(this, _clientPromise);
|
|
329
332
|
const handlerId = `intent-handler-${intentName}`;
|
|
330
|
-
const wrappedHandler =
|
|
333
|
+
const wrappedHandler = utils_1.wrapIntentHandler(handler, handlerId);
|
|
331
334
|
try {
|
|
332
335
|
await client.register(handlerId, wrappedHandler);
|
|
333
336
|
await client.dispatch('intentHandlerRegistered', { handlerId });
|
|
@@ -430,20 +433,22 @@ class InteropClient extends base_1.Base {
|
|
|
430
433
|
throw error;
|
|
431
434
|
}
|
|
432
435
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
436
|
+
/**
|
|
437
|
+
* Register a listener that is called when the Interop Client has been disconnected from the Interop Broker.
|
|
438
|
+
* Only one listener per Interop Client can be set.
|
|
439
|
+
* @param listener
|
|
440
|
+
* @return { Promise<void> }
|
|
441
|
+
* @tutorial interop.onDisconnection
|
|
442
|
+
*/
|
|
443
|
+
async onDisconnection(listener) {
|
|
444
|
+
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
|
445
|
+
// don't expose, analytics-only call
|
|
446
|
+
});
|
|
447
|
+
const client = await __classPrivateFieldGet(this, _clientPromise);
|
|
448
|
+
return client.onDisconnection((event) => {
|
|
449
|
+
const { uuid } = event;
|
|
450
|
+
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
|
451
|
+
});
|
|
447
452
|
}
|
|
448
453
|
}
|
|
449
454
|
exports.InteropClient = InteropClient;
|
|
@@ -53,6 +53,9 @@ class SessionContextGroupClient extends base_1.Base {
|
|
|
53
53
|
this.wire.sendAction('interop-session-context-group-add-handler').catch((e) => {
|
|
54
54
|
// don't expose, analytics-only call
|
|
55
55
|
});
|
|
56
|
+
if (typeof contextHandler !== 'function') {
|
|
57
|
+
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
58
|
+
}
|
|
56
59
|
const client = await __classPrivateFieldGet(this, _clientPromise);
|
|
57
60
|
let handlerId;
|
|
58
61
|
if (contextType) {
|
package/src/api/interop/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
|
|
3
|
+
exports.wrapIntentHandler = exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
|
|
4
4
|
exports.generateId = () => `${Math.random()}${Date.now()}`;
|
|
5
5
|
exports.wrapInTryCatch = (f, prefix) => (...args) => {
|
|
6
6
|
try {
|
|
@@ -34,3 +34,14 @@ exports.BROKER_ERRORS = {
|
|
|
34
34
|
getInfoForIntent: exports.generateOverrideError('getInfoForIntent', 'handleInfoForIntent'),
|
|
35
35
|
getInfoForIntentsByContext: exports.generateOverrideError('getInfoForIntentsByContext', 'handleInfoForIntentsByContext')
|
|
36
36
|
};
|
|
37
|
+
exports.wrapIntentHandler = (handler, handlerId) => {
|
|
38
|
+
return async (intent) => {
|
|
39
|
+
try {
|
|
40
|
+
await handler(intent);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error(`Error thrown by handler ${handlerId}: ${error}`);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -18,6 +18,8 @@ exports.LayoutModule = void 0;
|
|
|
18
18
|
/* eslint-disable no-undef, import/prefer-default-export */
|
|
19
19
|
const Instance_1 = require("./Instance");
|
|
20
20
|
const base_1 = require("../../base");
|
|
21
|
+
const SplitterController_1 = require("./SplitterController");
|
|
22
|
+
const view_overlay_1 = require("./SplitterController/view-overlay");
|
|
21
23
|
/**
|
|
22
24
|
* InitLayoutOptions interface
|
|
23
25
|
* @typedef { object } InitLayoutOptions
|
|
@@ -105,7 +107,9 @@ class LayoutModule extends base_1.Base {
|
|
|
105
107
|
}
|
|
106
108
|
// We need to go through environment to make sure it is only imported/bundled in OpenFin.
|
|
107
109
|
const ManagerConstructor = await this.wire.environment.getManagerConstructor();
|
|
108
|
-
|
|
110
|
+
const viewOverlay = new view_overlay_1.ViewOverlay(this.wire);
|
|
111
|
+
const splitterController = new SplitterController_1.SplitterController(viewOverlay);
|
|
112
|
+
__classPrivateFieldSet(this, _layoutManager, new ManagerConstructor(splitterController));
|
|
109
113
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
110
114
|
// @ts-ignore - layout warning here for backwards compatibility, can remove layout check in .52
|
|
111
115
|
let { layout, containerId } = options;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observes the bounding client box rectangle of the given element for changes.
|
|
3
|
+
*
|
|
4
|
+
* This solution only works for 2 scenarios, though could be updated to support more
|
|
5
|
+
* (e.g. via polling).
|
|
6
|
+
*
|
|
7
|
+
* MutationObserver will only pick up changes to bounds if they are specified via fixed
|
|
8
|
+
* style rules in the element's attribtues.
|
|
9
|
+
*
|
|
10
|
+
* ResizeObserver will pick up all changes to an element's width and height but will not capture
|
|
11
|
+
* any changes to position.
|
|
12
|
+
*
|
|
13
|
+
* @param element The element to observe the bounding box for (i.e. position, width, height)
|
|
14
|
+
* @param onChange Called every time the bounding box changes.
|
|
15
|
+
* @returns Function which disposes the observers when invoked.
|
|
16
|
+
*/
|
|
17
|
+
export declare const observeBounds: (element: Element, onChange: (bounds: DOMRect) => void) => () => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.observeBounds = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Observes the bounding client box rectangle of the given element for changes.
|
|
6
|
+
*
|
|
7
|
+
* This solution only works for 2 scenarios, though could be updated to support more
|
|
8
|
+
* (e.g. via polling).
|
|
9
|
+
*
|
|
10
|
+
* MutationObserver will only pick up changes to bounds if they are specified via fixed
|
|
11
|
+
* style rules in the element's attribtues.
|
|
12
|
+
*
|
|
13
|
+
* ResizeObserver will pick up all changes to an element's width and height but will not capture
|
|
14
|
+
* any changes to position.
|
|
15
|
+
*
|
|
16
|
+
* @param element The element to observe the bounding box for (i.e. position, width, height)
|
|
17
|
+
* @param onChange Called every time the bounding box changes.
|
|
18
|
+
* @returns Function which disposes the observers when invoked.
|
|
19
|
+
*/
|
|
20
|
+
exports.observeBounds = (element, onChange) => {
|
|
21
|
+
let lastBounds;
|
|
22
|
+
const isDomRectEqual = (a, b) => {
|
|
23
|
+
if (a.top !== b.top
|
|
24
|
+
|| a.left !== b.left
|
|
25
|
+
|| a.width !== b.width
|
|
26
|
+
|| a.height !== b.height
|
|
27
|
+
|| a.x !== b.x
|
|
28
|
+
|| a.y !== b.y) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
const checkBounds = () => {
|
|
34
|
+
const currentBounds = element.getBoundingClientRect();
|
|
35
|
+
if (!lastBounds || !isDomRectEqual(lastBounds, currentBounds)) {
|
|
36
|
+
lastBounds = currentBounds;
|
|
37
|
+
onChange(element.getBoundingClientRect());
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const resizeObserver = new ResizeObserver(() => checkBounds());
|
|
41
|
+
const mutationObserver = new MutationObserver(() => checkBounds());
|
|
42
|
+
resizeObserver.observe(element, { box: 'content-box' });
|
|
43
|
+
mutationObserver.observe(element, { attributes: true, attributeFilter: ['style'] });
|
|
44
|
+
checkBounds();
|
|
45
|
+
return () => {
|
|
46
|
+
resizeObserver.disconnect();
|
|
47
|
+
mutationObserver.disconnect();
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ViewOverlay } from './view-overlay';
|
|
2
|
+
export declare type SplitterItem = GoldenLayout.ContentItem & {
|
|
3
|
+
viewEventsAdded: boolean;
|
|
4
|
+
isVertical: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Utility class for managing Golden Layout splitter drag interactions.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SplitterController {
|
|
10
|
+
private readonly viewOverlay;
|
|
11
|
+
constructor(viewOverlay: ViewOverlay);
|
|
12
|
+
private teardown?;
|
|
13
|
+
private tryTeardown;
|
|
14
|
+
/**
|
|
15
|
+
* Disables the pointer events on the splitters, preventing them from being dragged.
|
|
16
|
+
*/
|
|
17
|
+
preventSplitterResize: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Ends a splitter drag move, if one is in progress.
|
|
20
|
+
*/
|
|
21
|
+
endMove: () => Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Initialises a splitter drag move, rendering a view on top of the splitter
|
|
24
|
+
* to allow it to render on top of the views within a layout (as they will always
|
|
25
|
+
* have a higher z-index to the platform window itself).
|
|
26
|
+
* @param splitterItem The Golden Layout splitter item that is currently being dragged.
|
|
27
|
+
*/
|
|
28
|
+
startMove: (splitterItem: SplitterItem) => Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SplitterController = void 0;
|
|
4
|
+
const bounds_observer_1 = require("./bounds-observer");
|
|
5
|
+
const applyBoundsOffset = (bounds, offsets = {}) => {
|
|
6
|
+
const sum = (bound, offset) => {
|
|
7
|
+
return bound + (offset || 0);
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
left: sum(bounds.left, offsets.left),
|
|
11
|
+
top: sum(bounds.top, offsets.top),
|
|
12
|
+
width: sum(bounds.width, offsets.width),
|
|
13
|
+
height: sum(bounds.height, offsets.height)
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Utility class for managing Golden Layout splitter drag interactions.
|
|
18
|
+
*/
|
|
19
|
+
class SplitterController {
|
|
20
|
+
// eslint-disable-next-line
|
|
21
|
+
constructor(viewOverlay) {
|
|
22
|
+
this.viewOverlay = viewOverlay;
|
|
23
|
+
this.tryTeardown = () => {
|
|
24
|
+
if (this.teardown) {
|
|
25
|
+
this.teardown();
|
|
26
|
+
this.teardown = undefined;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Disables the pointer events on the splitters, preventing them from being dragged.
|
|
31
|
+
*/
|
|
32
|
+
this.preventSplitterResize = () => {
|
|
33
|
+
document.querySelectorAll('.lm_splitter').forEach((splitter) => {
|
|
34
|
+
splitter.style.pointerEvents = 'none';
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Ends a splitter drag move, if one is in progress.
|
|
39
|
+
*/
|
|
40
|
+
this.endMove = async () => {
|
|
41
|
+
try {
|
|
42
|
+
this.viewOverlay.detachOverlay();
|
|
43
|
+
this.tryTeardown();
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new Error(`Failed to end splitter move: ${error.stack}`);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Initialises a splitter drag move, rendering a view on top of the splitter
|
|
51
|
+
* to allow it to render on top of the views within a layout (as they will always
|
|
52
|
+
* have a higher z-index to the platform window itself).
|
|
53
|
+
* @param splitterItem The Golden Layout splitter item that is currently being dragged.
|
|
54
|
+
*/
|
|
55
|
+
this.startMove = async (splitterItem) => {
|
|
56
|
+
try {
|
|
57
|
+
if (this.teardown) {
|
|
58
|
+
console.warn('Splitter move started before other move has been torn down.');
|
|
59
|
+
this.tryTeardown();
|
|
60
|
+
}
|
|
61
|
+
const splitterDiv = splitterItem.element.get(0);
|
|
62
|
+
const { backgroundColor } = getComputedStyle(splitterDiv);
|
|
63
|
+
const initialVisibility = splitterDiv.style.visibility;
|
|
64
|
+
splitterDiv.style.visibility = 'hidden';
|
|
65
|
+
const onBoundsChange = (bounds) => {
|
|
66
|
+
const offsetBounds = applyBoundsOffset(bounds, { height: splitterItem.isVertical ? 0 : 2 });
|
|
67
|
+
this.viewOverlay.renderOverlay({ bounds: offsetBounds, backgroundColor });
|
|
68
|
+
};
|
|
69
|
+
const teardownBoundsObserver = bounds_observer_1.observeBounds(splitterDiv, onBoundsChange);
|
|
70
|
+
this.teardown = () => {
|
|
71
|
+
teardownBoundsObserver();
|
|
72
|
+
splitterDiv.style.visibility = initialVisibility;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw new Error(`Failed to start splitter move: ${error.stack}`);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.SplitterController = SplitterController;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Transport from "../../../../transport/transport";
|
|
2
|
+
/**
|
|
3
|
+
* Api client allowing an empty electron BrowserView to be rendered
|
|
4
|
+
* in the current window with the specified bounds.
|
|
5
|
+
*
|
|
6
|
+
* Please note, only one view based overlay can be rendered at a time per runtime.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewOverlay {
|
|
9
|
+
private wire;
|
|
10
|
+
constructor(wire: Transport);
|
|
11
|
+
/**
|
|
12
|
+
* Renders the overlay at the specified position relative to the calling window.
|
|
13
|
+
* @param options Bounds and background color to display in the overlay.
|
|
14
|
+
*/
|
|
15
|
+
renderOverlay: (options: {
|
|
16
|
+
bounds: OpenFin.Bounds;
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Removes the overlay from the current window.
|
|
21
|
+
*/
|
|
22
|
+
detachOverlay: () => Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViewOverlay = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Api client allowing an empty electron BrowserView to be rendered
|
|
6
|
+
* in the current window with the specified bounds.
|
|
7
|
+
*
|
|
8
|
+
* Please note, only one view based overlay can be rendered at a time per runtime.
|
|
9
|
+
*/
|
|
10
|
+
class ViewOverlay {
|
|
11
|
+
// eslint-disable-next-line
|
|
12
|
+
constructor(wire) {
|
|
13
|
+
this.wire = wire;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the overlay at the specified position relative to the calling window.
|
|
16
|
+
* @param options Bounds and background color to display in the overlay.
|
|
17
|
+
*/
|
|
18
|
+
this.renderOverlay = async (options) => {
|
|
19
|
+
const { bounds, backgroundColor } = options;
|
|
20
|
+
await this.wire.sendAction('render-overlay', { bounds, backgroundColor });
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Removes the overlay from the current window.
|
|
24
|
+
*/
|
|
25
|
+
this.detachOverlay = async () => {
|
|
26
|
+
await this.wire.sendAction('detach-overlay');
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ViewOverlay = ViewOverlay;
|
|
@@ -13,6 +13,7 @@ import EntityInfo = OpenFin.EntityInfo;
|
|
|
13
13
|
import Entity = OpenFin.ApplicationType;
|
|
14
14
|
import ApplicationState = OpenFin.ApplicationState;
|
|
15
15
|
import ApplicationWindowInfo = OpenFin.ApplicationWindowInfo;
|
|
16
|
+
import PrinterInfo = OpenFin.PrinterInfo;
|
|
16
17
|
/**
|
|
17
18
|
* AppAssetInfo interface
|
|
18
19
|
* @typedef { object } AppAssetInfo
|
|
@@ -397,6 +398,7 @@ import ApplicationWindowInfo = OpenFin.ApplicationWindowInfo;
|
|
|
397
398
|
* @typedef { object } RvmLaunchOptions
|
|
398
399
|
* @property { boolean } [noUi] true if no UI when launching
|
|
399
400
|
* @property { object } [userAppConfigArgs] The user app configuration args
|
|
401
|
+
* @property { number } [timeToLive] Timeout in seconds until RVM launch request expires
|
|
400
402
|
*/
|
|
401
403
|
/**
|
|
402
404
|
* ServiceIdentifier interface
|
|
@@ -957,4 +959,10 @@ export default class System extends EmitterBase<SystemEvents> {
|
|
|
957
959
|
* @tutorial System.registerUsage
|
|
958
960
|
*/
|
|
959
961
|
registerUsage({ data, type }: OpenFin.RegisterUsageData): Promise<void>;
|
|
962
|
+
/**
|
|
963
|
+
* Returns an array with all printers of the caller and not all the printers on the desktop.
|
|
964
|
+
* @return { Promise.Array.<PrinterInfo> }
|
|
965
|
+
* @tutorial System.getPrinters
|
|
966
|
+
*/
|
|
967
|
+
getPrinters(): Promise<PrinterInfo[]>;
|
|
960
968
|
}
|
package/src/api/system/index.js
CHANGED
|
@@ -387,6 +387,7 @@ const window_1 = require("../window");
|
|
|
387
387
|
* @typedef { object } RvmLaunchOptions
|
|
388
388
|
* @property { boolean } [noUi] true if no UI when launching
|
|
389
389
|
* @property { object } [userAppConfigArgs] The user app configuration args
|
|
390
|
+
* @property { number } [timeToLive] Timeout in seconds until RVM launch request expires
|
|
390
391
|
*/
|
|
391
392
|
/**
|
|
392
393
|
* ServiceIdentifier interface
|
|
@@ -1237,5 +1238,14 @@ class System extends base_1.EmitterBase {
|
|
|
1237
1238
|
async registerUsage({ data, type }) {
|
|
1238
1239
|
await this.wire.sendAction('register-usage', { data, type });
|
|
1239
1240
|
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Returns an array with all printers of the caller and not all the printers on the desktop.
|
|
1243
|
+
* @return { Promise.Array.<PrinterInfo> }
|
|
1244
|
+
* @tutorial System.getPrinters
|
|
1245
|
+
*/
|
|
1246
|
+
async getPrinters() {
|
|
1247
|
+
const { payload } = await this.wire.sendAction('system-get-printers');
|
|
1248
|
+
return payload.data;
|
|
1249
|
+
}
|
|
1240
1250
|
}
|
|
1241
1251
|
exports.default = System;
|
|
@@ -57,11 +57,14 @@ import UpdatableViewOptions = OpenFin.UpdatableViewOptions;
|
|
|
57
57
|
* @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page.
|
|
58
58
|
*
|
|
59
59
|
* @property {any} [customData=""] - _Updatable._
|
|
60
|
-
* A field that the user can attach serializable data to
|
|
60
|
+
* A field that the user can attach serializable data to be ferried around with the view options.
|
|
61
61
|
* _When omitted, the default value of this property is the empty string (`""`)._
|
|
62
62
|
*
|
|
63
|
+
* @property {any} [customContext=""] - _Updatable._
|
|
64
|
+
* A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot}
|
|
65
|
+
* is called.
|
|
63
66
|
* When omitted, the default value of this property is the empty string (`""`).
|
|
64
|
-
* As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
67
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
65
68
|
*
|
|
66
69
|
* @property {object[]} [hotkeys=[]] - _Updatable._
|
|
67
70
|
* Defines the list of hotkeys that will be emitted as a `hotkey` event on the view. For usage example see [example]{@tutorial hotkeys}.
|
|
@@ -248,6 +251,7 @@ export declare class View extends WebContents<ViewEvents> {
|
|
|
248
251
|
*/
|
|
249
252
|
/**
|
|
250
253
|
* Returns an array with all system printers
|
|
254
|
+
* @deprecated use System.getPrinters instead
|
|
251
255
|
* @function getPrinters
|
|
252
256
|
* @memberOf View
|
|
253
257
|
* @instance
|
package/src/api/view/Instance.js
CHANGED
|
@@ -60,11 +60,14 @@ const window_1 = require("../window");
|
|
|
60
60
|
* @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page.
|
|
61
61
|
*
|
|
62
62
|
* @property {any} [customData=""] - _Updatable._
|
|
63
|
-
* A field that the user can attach serializable data to
|
|
63
|
+
* A field that the user can attach serializable data to be ferried around with the view options.
|
|
64
64
|
* _When omitted, the default value of this property is the empty string (`""`)._
|
|
65
65
|
*
|
|
66
|
+
* @property {any} [customContext=""] - _Updatable._
|
|
67
|
+
* A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot}
|
|
68
|
+
* is called.
|
|
66
69
|
* When omitted, the default value of this property is the empty string (`""`).
|
|
67
|
-
* As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
70
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
68
71
|
*
|
|
69
72
|
* @property {object[]} [hotkeys=[]] - _Updatable._
|
|
70
73
|
* Defines the list of hotkeys that will be emitted as a `hotkey` event on the view. For usage example see [example]{@tutorial hotkeys}.
|
|
@@ -220,6 +223,7 @@ class View extends main_1.WebContents {
|
|
|
220
223
|
*/
|
|
221
224
|
/**
|
|
222
225
|
* Returns an array with all system printers
|
|
226
|
+
* @deprecated use System.getPrinters instead
|
|
223
227
|
* @function getPrinters
|
|
224
228
|
* @memberOf View
|
|
225
229
|
* @instance
|
|
@@ -171,16 +171,16 @@ import WindowEvents = OpenFin.WindowEvents;
|
|
|
171
171
|
* @property {number} [cornerRounding.height=0] The height in pixels.
|
|
172
172
|
* @property {number} [cornerRounding.width=0] The width in pixels.
|
|
173
173
|
*
|
|
174
|
-
* @property {any} [customContext=""] - _Updatable._
|
|
174
|
+
* @property {any} [customContext=""] - _Updatable. Inheritable._
|
|
175
175
|
* A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot}
|
|
176
176
|
* is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
|
|
177
177
|
* {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
|
|
178
|
-
*
|
|
179
|
-
* As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
178
|
+
* _When omitted, _inherits_ from the parent application._
|
|
179
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
180
180
|
*
|
|
181
|
-
* @property {any} [customData=""] - _Updatable._
|
|
182
|
-
* A field that the user can attach serializable data to
|
|
183
|
-
* _When omitted,
|
|
181
|
+
* @property {any} [customData=""] - _Updatable. Inheritable._
|
|
182
|
+
* A field that the user can attach serializable data to be ferried around with the window options.
|
|
183
|
+
* _When omitted, _inherits_ from the parent application._
|
|
184
184
|
*
|
|
185
185
|
* @property {object[]} [customRequestHeaders]
|
|
186
186
|
* Defines list of custom headers for requests sent by the window.
|
|
@@ -235,7 +235,7 @@ import WindowEvents = OpenFin.WindowEvents;
|
|
|
235
235
|
*
|
|
236
236
|
* @property {string} [icon] - _Updatable. Inheritable._
|
|
237
237
|
* A URL for the icon to be shown in the window title bar and the taskbar.
|
|
238
|
-
*
|
|
238
|
+
* When omitted, inherits from the parent application._
|
|
239
239
|
* note: Window OS caches taskbar icons, therefore an icon change might only be visible after the cache is removed or the uuid is changed.
|
|
240
240
|
*
|
|
241
241
|
* @property {number} [maxHeight=-1] - _Updatable._
|
|
@@ -333,6 +333,23 @@ import WindowEvents = OpenFin.WindowEvents;
|
|
|
333
333
|
* @property {boolean} [waitForPageLoad=false]
|
|
334
334
|
* When set to `true`, the window will not appear until the `window` object's `load` event fires.
|
|
335
335
|
* When set to `false`, the window will appear immediately without waiting for content to be loaded.
|
|
336
|
+
*
|
|
337
|
+
* @property {ViewVisibility} [viewVisibility]
|
|
338
|
+
* _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
|
|
339
|
+
*/
|
|
340
|
+
/**
|
|
341
|
+
* @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
|
|
342
|
+
* @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
|
|
343
|
+
* @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
|
|
344
|
+
*/
|
|
345
|
+
/**
|
|
346
|
+
* @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
|
347
|
+
* @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
|
|
348
|
+
* @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
|
|
349
|
+
*/
|
|
350
|
+
/**
|
|
351
|
+
* @typedef {Object} ShowViewsOnSplitterDrag _Platform Windows Only_. Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
|
|
352
|
+
* @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
|
|
336
353
|
*/
|
|
337
354
|
/**
|
|
338
355
|
* @typedef {object} CapturePageOptions
|
|
@@ -610,6 +627,7 @@ export declare class _Window extends WebContents<WindowEvents> {
|
|
|
610
627
|
*/
|
|
611
628
|
/**
|
|
612
629
|
* Returns an array with all system printers
|
|
630
|
+
* @deprecated use System.getPrinters instead
|
|
613
631
|
* @function getPrinters
|
|
614
632
|
* @memberOf Window
|
|
615
633
|
* @instance
|
|
@@ -178,16 +178,16 @@ const view_1 = require("../view");
|
|
|
178
178
|
* @property {number} [cornerRounding.height=0] The height in pixels.
|
|
179
179
|
* @property {number} [cornerRounding.width=0] The width in pixels.
|
|
180
180
|
*
|
|
181
|
-
* @property {any} [customContext=""] - _Updatable._
|
|
181
|
+
* @property {any} [customContext=""] - _Updatable. Inheritable._
|
|
182
182
|
* A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot}
|
|
183
183
|
* is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
|
|
184
184
|
* {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
|
|
185
|
-
*
|
|
186
|
-
* As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
185
|
+
* _When omitted, _inherits_ from the parent application._
|
|
186
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
|
|
187
187
|
*
|
|
188
|
-
* @property {any} [customData=""] - _Updatable._
|
|
189
|
-
* A field that the user can attach serializable data to
|
|
190
|
-
* _When omitted,
|
|
188
|
+
* @property {any} [customData=""] - _Updatable. Inheritable._
|
|
189
|
+
* A field that the user can attach serializable data to be ferried around with the window options.
|
|
190
|
+
* _When omitted, _inherits_ from the parent application._
|
|
191
191
|
*
|
|
192
192
|
* @property {object[]} [customRequestHeaders]
|
|
193
193
|
* Defines list of custom headers for requests sent by the window.
|
|
@@ -242,7 +242,7 @@ const view_1 = require("../view");
|
|
|
242
242
|
*
|
|
243
243
|
* @property {string} [icon] - _Updatable. Inheritable._
|
|
244
244
|
* A URL for the icon to be shown in the window title bar and the taskbar.
|
|
245
|
-
*
|
|
245
|
+
* When omitted, inherits from the parent application._
|
|
246
246
|
* note: Window OS caches taskbar icons, therefore an icon change might only be visible after the cache is removed or the uuid is changed.
|
|
247
247
|
*
|
|
248
248
|
* @property {number} [maxHeight=-1] - _Updatable._
|
|
@@ -340,6 +340,23 @@ const view_1 = require("../view");
|
|
|
340
340
|
* @property {boolean} [waitForPageLoad=false]
|
|
341
341
|
* When set to `true`, the window will not appear until the `window` object's `load` event fires.
|
|
342
342
|
* When set to `false`, the window will appear immediately without waiting for content to be loaded.
|
|
343
|
+
*
|
|
344
|
+
* @property {ViewVisibility} [viewVisibility]
|
|
345
|
+
* _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
|
|
346
|
+
*/
|
|
347
|
+
/**
|
|
348
|
+
* @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
|
|
349
|
+
* @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
|
|
350
|
+
* @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
|
|
351
|
+
*/
|
|
352
|
+
/**
|
|
353
|
+
* @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
|
354
|
+
* @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
|
|
355
|
+
* @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
|
|
356
|
+
*/
|
|
357
|
+
/**
|
|
358
|
+
* @typedef {Object} ShowViewsOnSplitterDrag _Platform Windows Only_. Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
|
|
359
|
+
* @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
|
|
343
360
|
*/
|
|
344
361
|
/**
|
|
345
362
|
* @typedef {object} CapturePageOptions
|
|
@@ -620,6 +637,7 @@ class _Window extends main_1.WebContents {
|
|
|
620
637
|
*/
|
|
621
638
|
/**
|
|
622
639
|
* Returns an array with all system printers
|
|
640
|
+
* @deprecated use System.getPrinters instead
|
|
623
641
|
* @function getPrinters
|
|
624
642
|
* @memberOf Window
|
|
625
643
|
* @instance
|
package/src/shapes/protocol.d.ts
CHANGED
|
@@ -68,98 +68,29 @@ export interface ProtocolMap extends ProtocolMapBase {
|
|
|
68
68
|
request: OpenFin.Identity;
|
|
69
69
|
response: void;
|
|
70
70
|
};
|
|
71
|
-
'fdc3-add-context-listener':
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
'fdc3-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
'
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
'
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
'interop-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
'interop-client-set-context': {
|
|
96
|
-
request: void;
|
|
97
|
-
response: void;
|
|
98
|
-
};
|
|
99
|
-
'interop-client-add-context-handler': {
|
|
100
|
-
request: void;
|
|
101
|
-
response: void;
|
|
102
|
-
};
|
|
103
|
-
'interop-client-get-context-groups': {
|
|
104
|
-
request: void;
|
|
105
|
-
response: void;
|
|
106
|
-
};
|
|
107
|
-
'interop-client-join-context-group': {
|
|
108
|
-
request: void;
|
|
109
|
-
response: void;
|
|
110
|
-
};
|
|
111
|
-
'interop-client-remove-from-context-group': {
|
|
112
|
-
request: void;
|
|
113
|
-
response: void;
|
|
114
|
-
};
|
|
115
|
-
'interop-client-get-all-clients-in-context-group': {
|
|
116
|
-
request: void;
|
|
117
|
-
response: void;
|
|
118
|
-
};
|
|
119
|
-
'interop-client-get-info-for-context-group': {
|
|
120
|
-
request: void;
|
|
121
|
-
response: void;
|
|
122
|
-
};
|
|
123
|
-
'interop-broker-add-client-to-context-group': {
|
|
124
|
-
request: void;
|
|
125
|
-
response: void;
|
|
126
|
-
};
|
|
127
|
-
'interop-broker-get-all-clients-in-context-group': {
|
|
128
|
-
request: void;
|
|
129
|
-
response: void;
|
|
130
|
-
};
|
|
131
|
-
'interop-broker-get-context-groups': {
|
|
132
|
-
request: void;
|
|
133
|
-
response: void;
|
|
134
|
-
};
|
|
135
|
-
'interop-broker-get-info-for-context-group': {
|
|
136
|
-
request: void;
|
|
137
|
-
response: void;
|
|
138
|
-
};
|
|
139
|
-
'interop-broker-is-action-authorized': {
|
|
140
|
-
request: void;
|
|
141
|
-
response: void;
|
|
142
|
-
};
|
|
143
|
-
'interop-broker-is-connection-authorized': {
|
|
144
|
-
request: void;
|
|
145
|
-
response: void;
|
|
146
|
-
};
|
|
147
|
-
'interop-broker-join-context-group': {
|
|
148
|
-
request: void;
|
|
149
|
-
response: void;
|
|
150
|
-
};
|
|
151
|
-
'interop-broker-remove-client-from-context-group': {
|
|
152
|
-
request: void;
|
|
153
|
-
response: void;
|
|
154
|
-
};
|
|
155
|
-
'interop-broker-remove-from-context-group': {
|
|
156
|
-
request: void;
|
|
157
|
-
response: void;
|
|
158
|
-
};
|
|
159
|
-
'interop-broker-set-context': {
|
|
160
|
-
request: void;
|
|
161
|
-
response: void;
|
|
162
|
-
};
|
|
71
|
+
'fdc3-add-context-listener': VoidCall;
|
|
72
|
+
'fdc3-broadcast': VoidCall;
|
|
73
|
+
'fdc3-get-system-channels': VoidCall;
|
|
74
|
+
'fdc3-join-channel': VoidCall;
|
|
75
|
+
'fdc3-leave-current-channel': VoidCall;
|
|
76
|
+
'interop-connect-sync': VoidCall;
|
|
77
|
+
'interop-client-set-context': VoidCall;
|
|
78
|
+
'interop-client-add-context-handler': VoidCall;
|
|
79
|
+
'interop-client-get-context-groups': VoidCall;
|
|
80
|
+
'interop-client-join-context-group': VoidCall;
|
|
81
|
+
'interop-client-remove-from-context-group': VoidCall;
|
|
82
|
+
'interop-client-get-all-clients-in-context-group': VoidCall;
|
|
83
|
+
'interop-client-get-info-for-context-group': VoidCall;
|
|
84
|
+
'interop-broker-add-client-to-context-group': VoidCall;
|
|
85
|
+
'interop-broker-get-all-clients-in-context-group': VoidCall;
|
|
86
|
+
'interop-broker-get-context-groups': VoidCall;
|
|
87
|
+
'interop-broker-get-info-for-context-group': VoidCall;
|
|
88
|
+
'interop-broker-is-action-authorized': VoidCall;
|
|
89
|
+
'interop-broker-is-connection-authorized': VoidCall;
|
|
90
|
+
'interop-broker-join-context-group': VoidCall;
|
|
91
|
+
'interop-broker-remove-client-from-context-group': VoidCall;
|
|
92
|
+
'interop-broker-remove-from-context-group': VoidCall;
|
|
93
|
+
'interop-broker-set-context': VoidCall;
|
|
163
94
|
'query-permission-for-current-context': {
|
|
164
95
|
request: {
|
|
165
96
|
apiName: string;
|
|
@@ -188,7 +119,23 @@ export interface ProtocolMap extends ProtocolMapBase {
|
|
|
188
119
|
};
|
|
189
120
|
response: void;
|
|
190
121
|
};
|
|
122
|
+
'render-overlay': {
|
|
123
|
+
request: {
|
|
124
|
+
bounds: OpenFin.Bounds;
|
|
125
|
+
backgroundColor: string;
|
|
126
|
+
};
|
|
127
|
+
response: void;
|
|
128
|
+
};
|
|
129
|
+
'detach-overlay': VoidCall;
|
|
130
|
+
'system-get-printers': {
|
|
131
|
+
request: void;
|
|
132
|
+
response: OpenFin.PrinterInfo[];
|
|
133
|
+
};
|
|
191
134
|
}
|
|
135
|
+
declare type VoidCall = {
|
|
136
|
+
request: void;
|
|
137
|
+
response: void;
|
|
138
|
+
};
|
|
192
139
|
interface ProtocolMapBase {
|
|
193
140
|
[action: string]: {
|
|
194
141
|
request: any;
|