@openfin/core 30.73.21 → 30.73.22
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/package.json +1 -1
- package/src/OpenFin.d.ts +14 -0
- package/src/api/platform/Instance.d.ts +12 -0
- package/src/api/platform/Instance.js +15 -0
package/package.json
CHANGED
package/src/OpenFin.d.ts
CHANGED
|
@@ -429,6 +429,12 @@ export declare type ConstViewOptions = {
|
|
|
429
429
|
enableBeforeUnload: boolean;
|
|
430
430
|
accelerator?: Partial<Accelerator>;
|
|
431
431
|
};
|
|
432
|
+
export declare type ViewState = ViewCreationOptions & {
|
|
433
|
+
backgroundThrottling: boolean;
|
|
434
|
+
componentName: 'view';
|
|
435
|
+
initialUrl: string;
|
|
436
|
+
minWidth?: number;
|
|
437
|
+
};
|
|
432
438
|
export declare type Certificate = {
|
|
433
439
|
data: string;
|
|
434
440
|
fingerprint: string;
|
|
@@ -673,6 +679,14 @@ export declare type PlatformProvider = {
|
|
|
673
679
|
* @return { Promise<Snapshot> } Snapshot of current platform state.
|
|
674
680
|
*/
|
|
675
681
|
getSnapshot(payload: undefined, identity: Identity): Promise<Snapshot>;
|
|
682
|
+
/**
|
|
683
|
+
* Gets the current state of a single view and returns an object with the options needed to restore that view as part of a snapshot.
|
|
684
|
+
* @param { Identity } payload Identity of the view.
|
|
685
|
+
* @return { Promise<ViewState> }
|
|
686
|
+
*/
|
|
687
|
+
getViewSnapshot(payload: {
|
|
688
|
+
viewIdentity: Identity;
|
|
689
|
+
}): Promise<ViewState>;
|
|
676
690
|
/**
|
|
677
691
|
* Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen.
|
|
678
692
|
* Returns an array of windows with modified positions, such that any off-screen windows are positioned in the top left
|
|
@@ -65,6 +65,18 @@ export declare class Platform extends EmitterBase<PlatformEvents> {
|
|
|
65
65
|
* @tutorial Platform.getSnapshot
|
|
66
66
|
*/
|
|
67
67
|
getSnapshot(): Promise<OpenFin.Snapshot>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns a snapshot of a single view's options in its current state.
|
|
70
|
+
*
|
|
71
|
+
* Can be used to restore a view to a previous state.
|
|
72
|
+
*
|
|
73
|
+
* NOTE: this method is meant for advanced usage only, it is not recommended to manage the state of individual views.
|
|
74
|
+
*
|
|
75
|
+
* @param { Identity } viewIdentity View identity
|
|
76
|
+
* @returns { Promise<ViewState> }
|
|
77
|
+
* @tutorial Platform.getViewSnapshot
|
|
78
|
+
*/
|
|
79
|
+
getViewSnapshot(viewIdentity: OpenFin.Identity): Promise<OpenFin.ViewState>;
|
|
68
80
|
/**
|
|
69
81
|
* Adds a snapshot to a running Platform.
|
|
70
82
|
* Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
|
|
@@ -173,6 +173,21 @@ class Platform extends base_1.EmitterBase {
|
|
|
173
173
|
const client = await this.getClient();
|
|
174
174
|
return client.dispatch('get-snapshot');
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Returns a snapshot of a single view's options in its current state.
|
|
178
|
+
*
|
|
179
|
+
* Can be used to restore a view to a previous state.
|
|
180
|
+
*
|
|
181
|
+
* NOTE: this method is meant for advanced usage only, it is not recommended to manage the state of individual views.
|
|
182
|
+
*
|
|
183
|
+
* @param { Identity } viewIdentity View identity
|
|
184
|
+
* @returns { Promise<ViewState> }
|
|
185
|
+
* @tutorial Platform.getViewSnapshot
|
|
186
|
+
*/
|
|
187
|
+
async getViewSnapshot(viewIdentity) {
|
|
188
|
+
const client = await this.getClient();
|
|
189
|
+
return client.dispatch('get-view-snapshot', { viewIdentity });
|
|
190
|
+
}
|
|
176
191
|
/**
|
|
177
192
|
* Adds a snapshot to a running Platform.
|
|
178
193
|
* Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
|