API reference / @evolu/common / Worker
Worker
Cross-platform worker abstraction
Interfaces
| Interface | Description |
|---|---|
| Worker | Cross-platform worker abstraction. |
| WorkerPostMessageDep | - |
Type Aliases
| Type Alias | Description |
|---|---|
| MessageHandlers | Type helper to extract message types from a union type |
| WithErrorReporting | Error reporting wrapper that catches synchronous errors in handlers and converts them to transferable error messages sent to the main thread. |
Functions
| Function | Description |
|---|---|
| createInitializedWorker | Creates a Worker that supports initialization with dependencies and safe error handling. |
| createInitializedWorkerWithHandlers | Creates a Worker with type-safe message handlers for each message type. This provides better type safety and organization compared to a single onMessage handler. |