API reference › @evolu/common › local‑first/Shared › SharedWorkerOutput
type SharedWorkerOutput =
| DbWorkerInit
| {
error:
| DatabaseHeldError
| OtherBuildRunningError
| UnknownError
| UnsupportedDbVersionError;
type: "Error";
}
| {
type: "Waiting";
workerId: SharedWorkerId;
}
| {
syncStateChannelName: string;
type: "Connected";
workerId: SharedWorkerId;
};
Defined in: packages/common/src/local-first/Shared.ts:448
Union Members
Type Literal
{
error: | DatabaseHeldError
| OtherBuildRunningError
| UnknownError
| UnsupportedDbVersionError;
type: "Error";
}
| Name | Type | Description | Defined in |
|---|---|---|---|
error | | DatabaseHeldError | OtherBuildRunningError | UnknownError | UnsupportedDbVersionError | - | packages/common/src/local-first/Shared.ts:456 |
type | "Error" | Sent to one tab only: its database is refused, a mutation it made could not be stored, or another build keeps this worker waiting. | packages/common/src/local-first/Shared.ts:455 |
Type Literal
{
type: "Waiting";
workerId: SharedWorkerId;
}
| Name | Type | Description | Defined in |
|---|---|---|---|
type | "Waiting" | Sent to a tab that connects while the worker waits for the build lock; see Builds. Connected follows once the worker holds it. | packages/common/src/local-first/Shared.ts:467 |
workerId | SharedWorkerId | - | packages/common/src/local-first/Shared.ts:468 |
Type Literal
{
syncStateChannelName: string;
type: "Connected";
workerId: SharedWorkerId;
}
| Name | Type | Description | Defined in |
|---|---|---|---|
syncStateChannelName | string | - | packages/common/src/local-first/Shared.ts:479 |
type | "Connected" | Sent to a connecting tab once the worker holds the build lock; see Builds in this module's documentation. The tab elects the host of the worker's DbWorkers among the worker's tabs, scoped by workerId, and listens for SyncState on syncStateChannelName. | packages/common/src/local-first/Shared.ts:477 |
workerId | SharedWorkerId | - | packages/common/src/local-first/Shared.ts:478 |