import { RawTable, RawTableType } from './RawTable.js'; import { RowType, Table } from './Table.js'; type SchemaType = Record>; export type SchemaTableType = { [K in keyof S]: RowType; }; /** * A schema is a collection of tables. It is used to define the structure of a database. */ export declare class Schema { readonly types: SchemaTableType; readonly props: S; readonly tables: Table[]; readonly rawTables: RawTable[]; constructor(tables: Table[] | S); /** * Adds raw tables to this schema. Raw tables are identified by their name, but entirely managed by the application * developer instead of automatically by PowerSync. * Since raw tables are not backed by JSON, running complex queries on them may be more efficient. Further, they allow * using client-side table and column constraints. * Note that raw tables are only supported when using the new `SyncClientImplementation.rust` sync client. * * @param tables An object of (table name, raw table definition) entries. * @experimental Note that the raw tables API is still experimental and may change in the future. */ withRawTables(tables: Record): void; validate(): void; toJSON(): { tables: { local_only: boolean | undefined; insert_only: boolean | undefined; include_old: any; include_old_only_when_changed: boolean; include_metadata: boolean | undefined; ignore_empty_update: boolean | undefined; name: string; view_name: string; columns: { name: string; type: import("./Column.js").ColumnType | undefined; }[]; indexes: { name: string; columns: { name: string; ascending: boolean | undefined; type: import("./Column.js").ColumnType; }[]; }[]; }[]; raw_tables: unknown[]; }; /** * Returns a representation of the raw table that is understood by the PowerSync SQLite core extension. * * The output of this can be passed through `JSON.serialize` and then used in `powersync_create_raw_table_crud_trigger` * to define triggers for this table. */ static rawTableToJson(table: RawTable): unknown; } export {};