import { SyncBackend } from '../collection-utils.js'; import { TableWithRequiredFields } from '../syncableTable.js'; import { SQLInterceptor } from './types.js'; import 'drizzle-orm'; import 'drizzle-valibot'; import '@firtoz/db-helpers'; import 'valibot'; import '@tanstack/db'; import 'drizzle-orm/sqlite-core'; type SqliteDriverMode = "async" | "sync"; interface SqliteTableSyncBackendConfig { /** drizzle-orm SQLite database (async WASM/libsql or sync Durable Object) */ drizzle: any; table: TTable; tableName: string; debug?: boolean; checkpoint?: () => Promise; interceptor?: SQLInterceptor; /** * `async`: libsql/WASM — use `await db.transaction(async (tx) => …)`. * `sync`: Cloudflare DO SQLite — `transactionSync` requires a **synchronous** callback; use `.all()` / `.run()` on builders inside `tx`. */ driverMode: SqliteDriverMode; } declare function createSqliteTableSyncBackend(config: SqliteTableSyncBackendConfig): SyncBackend; export { type SqliteDriverMode, type SqliteTableSyncBackendConfig, createSqliteTableSyncBackend };