import type { Generated, Insertable, Selectable, Updateable } from "kysely"; import type { SqliteWasmDatabase } from "sqlite-wasm-kysely"; import { Declaration, Pattern, VariableReference } from "../json-schema/pattern.js"; export declare function applySchema(args: { sqlite: SqliteWasmDatabase; }): void; export type InlangDatabaseSchema = { bundle: BundleTable; message: MessageTable; variant: VariantTable; }; type BundleTable = { id: Generated; declarations: Generated>; }; type MessageTable = { id: Generated; bundleId: string; locale: string; selectors: Generated>; }; type VariantTable = { id: Generated; messageId: string; matches: Generated>; pattern: Generated; }; /** * A match is a variable reference that is either a literal or a catch-all. * * https://github.com/opral/inlang/issues/205 * * @example * match = { type: "match", name: "gender", value: { type: "literal", value: "male" }} */ export type Match = LiteralMatch | CatchAllMatch; export type LiteralMatch = { type: "literal-match"; key: VariableReference["name"]; value: string; }; export type CatchAllMatch = { type: "catchall-match"; key: VariableReference["name"]; }; export type Bundle = Selectable; export type NewBundle = Insertable; export type BundleUpdate = Updateable; export type Message = Selectable; export type NewMessage = Insertable; export type MessageUpdate = Updateable; export type Variant = Selectable; export type NewVariant = Insertable; export type VariantUpdate = Updateable; export type MessageNested = Message & { variants: Variant[]; }; export type NewMessageNested = NewMessage & { variants: NewVariant[]; }; export type MessageNestedUpdate = Updateable & { variants: VariantUpdate[]; }; export type BundleNested = Bundle & { messages: MessageNested[]; }; export type NewBundleNested = NewBundle & { messages: NewMessageNested[]; }; export type BundleNestedUpdate = BundleUpdate & { messages: MessageNestedUpdate[]; }; export {}; //# sourceMappingURL=schema.d.ts.map