/* tslint:disable */ /* eslint-disable */ export class CitadelDb { free(): void; [Symbol.dispose](): void; /** * Create a named key-value table. Errors if it already exists. */ createTable(table: string): void; /** * Delete a key from the default table. * Returns true if the key existed. */ delete(key: Uint8Array): boolean; /** * Execute a SQL statement (DDL or DML). * Returns the number of rows affected. */ execute(sql: string): number; /** * Execute multiple SQL statements separated by semicolons. */ executeBatch(sql: string): void; /** * Get a value by key from the default table. * Returns null if not found. */ get(key: Uint8Array): any; /** * Create a new in-memory encrypted database. */ constructor(passphrase: string); /** * Put a key-value pair into the default table. */ put(key: Uint8Array, value: Uint8Array): void; /** * Execute a SQL query and return results as a JS object. * * Returns `{ columns: string[], rows: any[][] }`. */ query(sql: string): any; /** * Execute `;`-separated SQL statements. Returns an array of * tagged outcome objects, one per statement. */ run(sql: string): Array; /** * Get database statistics. * Returns `{ entryCount: number, totalPages: number, treeDepth: number }`. */ stats(): any; /** * Delete a key from a named table. * Returns true if the key existed. */ tableDelete(table: string, key: Uint8Array): boolean; /** * Get a value by key from a named table. * Returns null if not found. */ tableGet(table: string, key: Uint8Array): any; /** * Put a key-value pair into a named table. */ tablePut(table: string, key: Uint8Array, value: Uint8Array): void; } export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_citadeldb_free: (a: number, b: number) => void; readonly citadeldb_createTable: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_delete: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_execute: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_executeBatch: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_get: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_new: (a: number, b: number, c: number) => void; readonly citadeldb_put: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly citadeldb_query: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_run: (a: number, b: number, c: number, d: number) => void; readonly citadeldb_stats: (a: number, b: number) => void; readonly citadeldb_tableDelete: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly citadeldb_tableGet: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly citadeldb_tablePut: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void; readonly __wbindgen_export: (a: number) => void; readonly __wbindgen_export2: (a: number, b: number, c: number) => void; readonly __wbindgen_export3: (a: number, b: number) => number; readonly __wbindgen_export4: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. * * @returns {InitOutput} */ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;