import { Snapshot } from "@canvas-js/interfaces"; import type { PropertyType } from "@canvas-js/modeldb"; import { Canvas } from "./Canvas.js"; import { ContractClass, ModelSchema, ModelValue } from "./types.js"; export declare const isIndexInit: (value: unknown) => value is string[]; export declare const isPropertyTypish: (value: unknown) => value is PropertyType; export type CreateTableChange = { change: "create_table"; table: string; }; export type DropTableChange = { change: "drop_table"; table: string; }; export type AddColumnChange = { change: "add_column"; table: string; column: string; propertyType: PropertyType; }; export type RemoveColumnChange = { change: "remove_column"; table: string; column: string; }; export type MakeOptionalColumnChange = { change: "make_optional_column"; table: string; column: string; }; export type TableChange = CreateTableChange | DropTableChange | AddColumnChange | RemoveColumnChange | MakeOptionalColumnChange; export declare function hashContract>(contract: T | string): string; export type RowChange = { type: "delete"; } | { type: "create"; value: ModelValue; } | { type: "update"; value: ModelValue; }; export type CreateSnapshotArgs = { changesets?: TableChange[]; changedRows?: Record>; newRows?: Record; }; /** * Create a `Snapshot` of the application's current database state. * * If changesets are provided, then apply them to snapshotted tables, so * the new snapshot can be used with a contract matching them immediately. */ export declare function createSnapshot(app: Canvas, changes?: CreateSnapshotArgs): Promise; export declare const generateChangesets: (before: ModelSchema, after: ModelSchema) => TableChange[];