@statesync/electron / ElectronSnapshotHandlerOptions
Interface: ElectronSnapshotHandlerOptions<T>
Defined in: main.ts:145
Configuration options for createElectronSnapshotHandler.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The application-specific snapshot data type. |
Properties
channel?
optional channel: string;Defined in: main.ts:183
Override the default IPC channel name for snapshot requests.
Defaults to statesync:<topic>:snapshot (produced by snapshotChannel).
getSnapshot()
getSnapshot: () => SnapshotEnvelope<T> | Promise<SnapshotEnvelope<T>>;Defined in: main.ts:158
Returns the current snapshot envelope for the given topic.
This callback may be invoked concurrently from multiple renderer windows (each renderer calls ipcRenderer.invoke() independently). Implementations must be safe for concurrent invocations and should avoid side effects.
Returns
SnapshotEnvelope<T> | Promise<SnapshotEnvelope<T>>
The current snapshot, synchronously or as a promise.
handle
handle: ElectronIpcMainHandle;Defined in: main.ts:167
The ipcMain.handle function (or a compatible mock).
Used to register the snapshot request handler on the IPC channel.
See
removeHandler
removeHandler: ElectronIpcMainRemoveHandler;Defined in: main.ts:176
The ipcMain.removeHandler function (or a compatible mock).
Used by ElectronSnapshotHandlerHandle.dispose to unregister the handler.
See
topic
topic: string;Defined in: main.ts:147
The sync topic identifier (e.g. "user-profile").
