Add shared types for web workers

This commit is contained in:
omaroughriss 2025-11-27 16:52:19 +01:00
parent 66a27cb03c
commit 6fa04317b6

View File

@ -0,0 +1,33 @@
/**
* Shared types for Web Workers
*/
export interface StoreDefinition {
name: string;
options: IDBObjectStoreParameters;
indices: IndexDefinition[];
}
export interface IndexDefinition {
name: string;
keyPath: string | string[];
options: IDBIndexParameters;
}
export interface WorkerMessagePayload {
type: string;
payload?: any;
id: number;
}
export interface WorkerMessageResponse {
id: number;
type: 'SUCCESS' | 'ERROR';
result?: any;
error?: string;
}
export interface BatchWriteItem {
key?: IDBValidKey;
object: any;
}