AboutSupportDeveloper GuideVersion 41.133.100.79

Static namespace for OpenFin API methods that interact with the SnapshotSource class, available under fin.SnapshotSource.

Hierarchy

  • Base
    • SnapshotSourceModule

Accessors

Methods

Accessors

  • get me(): Identity
  • Returns Identity

    me should only be accessed from the fin global (FinApi.me); access through entity classes is not guaranteed to behave sensibly in all calling contexts.

Methods

  • Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.

    Type Parameters

    • Snapshot = unknown

      Implementation-defined shape of an application snapshot. Allows custom snapshot implementations for legacy applications to define their own snapshot format.

    Parameters

    Returns Promise<void>

    const snapshotProvider = {
    async getSnapshot() {
    const bounds = await fin.me.getBounds();
    return bounds;
    },
    async applySnapshot(snapshot) {
    await fin.me.setBounds(snapshot);
    return undefined;
    }
    }

    await fin.SnapshotSource.init(snapshotProvider);
  • Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.

    Parameters

    Returns Promise<SnapshotSource<unknown>>

    const snapshotSource = await fin.SnapshotSource.wrap(fin.me);
    // Use wrapped instance's getSnapshot method, e.g.:
    const snapshot = await snapshotSource.getSnapshot();
  • Synchronously returns a SnapshotSource object that represents the current SnapshotSource.

    Parameters

    Returns SnapshotSource<unknown>

    const snapshotSource = fin.SnapshotSource.wrapSync(fin.me);
    // Use wrapped instance's getSnapshot method, e.g.:
    const snapshot = await snapshotSource.getSnapshot();