Implementation-defined shape of an application snapshot. Allows custom snapshot implementations for legacy applications to define their own snapshot format.
Provides access to the OpenFin representation of the current code context (usually a document
such as a View or Window), as well as to the current Interop
context.
Useful for debugging in the devtools console, where this will intelligently type itself based on the context in which the devtools panel was opened.
Call the SnapshotSource's applySnapshot method defined by init.
Call the SnapshotSource's getSnapshot method defined by init.
Method to determine if the SnapshotSource has been initialized.
Use when the parent application is starting up to ensure the SnapshotSource is able to accept and apply a snapshot using the applySnapshot method.
let snapshotSource = fin.SnapshotSource.wrapSync(fin.me);
const snapshotProvider = {
async getSnapshot() { return 'foo' },
async applySnapshot(snapshot) {
console.log(snapshot);
return undefined;
}
}
await fin.SnapshotSource.init(snapshotProvider);
try {
await snapshotSource.ready();
await snapshotSource.applySnapshot('foo');
} catch (err) {
console.log(err)
}
Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.