@orbitinghail/sqlsync-worker
Version:
SQLSync is a collaborative offline-first wrapper around SQLite. It is designed to synchronize web application state between users, devices, and the edge.
13 lines (12 loc) • 740 B
TypeScript
import { SqlValue } from "../sqlsync-wasm/pkg/sqlsync_wasm";
import { Row } from "./types";
export type OmitUnion<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
export type NarrowTaggedEnum<E, T> = E extends {
tag: T;
} ? E : never;
export declare function assertUnreachable(err: string, x: never): never;
export declare function initWorker(workerUrl: string | URL): MessagePort;
export declare const serializeMutationAsJSON: <M>(mutation: M) => Uint8Array;
export declare function toRows<R extends Row = Row>(columns: string[], rows: SqlValue[][]): R[];
export declare const pendingPromise: <T = undefined>() => [Promise<T>, (v: T) => void];
export declare const sha256Digest: (data: Uint8Array) => Promise<Uint8Array>;