y-cap-sqlite
Version:
y-cap-sqlite is a persistence provider for [Yjs](https://github.com/yjs/yjs) that uses [@capacitor-community/sqlite](https://github.com/capacitor-community/sqlite) to store document changes in a SQLite database. This is useful for Capacitor projects that
27 lines (24 loc) • 1.15 kB
text/typescript
import * as _capacitor_community_sqlite from '@capacitor-community/sqlite';
import { capConnectionOptions, SQLiteDBConnection, SQLiteConnection } from '@capacitor-community/sqlite';
import * as Y from 'yjs';
import { ObservableV2 } from 'lib0/observable';
declare class CapSQLitePersistence extends ObservableV2<{
synced: (persistence: CapSQLitePersistence) => void;
}> {
doc: Y.Doc;
config: Omit<capConnectionOptions, "database">;
whenSynced: Promise<this>;
name: string;
db: SQLiteDBConnection | undefined;
con: SQLiteConnection;
synced: boolean;
_dbref: number;
_dbsize: number;
_destroyed: boolean;
constructor(config: Omit<capConnectionOptions, "database">, doc: Y.Doc, name: string, sqlite: SQLiteConnection);
initDb(): Promise<void>;
static create(config: Omit<capConnectionOptions, "database">, doc: Y.Doc, name: string, sqlite: SQLiteConnection): Promise<CapSQLitePersistence>;
_storeUpdate(update: Uint8Array, origin: any): Promise<void | _capacitor_community_sqlite.capSQLiteChanges> | undefined;
destroy(): Promise<void> | undefined;
}
export { CapSQLitePersistence };