import type { LixEngine } from "../../engine/boot.js"; import { type LixFileDescriptor } from "./schema-definition.js"; /** * Applies file-related database schema, including the file_history view. * * Consumers of file_history should always scope queries with * lixcol_root_commit_id (and typically lixcol_depth = 0) to avoid mixing * multiple timelines in one result set. */ export declare function applyFileDatabaseSchema(args: { engine: LixEngine; }): void; /** * Complete file type combining the descriptor with materialized data. * * Uses "Lix" prefix to avoid collision with JavaScript's built-in File type. * * IMPORTANT: File views are projections over multiple entities, not just the file descriptor. * However, they expose schema_key as 'lix_file_descriptor' to maintain foreign key integrity. * * ``` * ┌─────────────────────────────────────────────────────────────┐ * │ File View │ * │ (schema_key: 'lix_file_descriptor') │ * │ │ * │ ┌─────────────────────────┐ ┌─────────────────────────┐ │ * │ │ File Descriptor │ │ Plugin Entities │ │ * │ │ (lix_file_descriptor) │ │ │ │ * │ ├─────────────────────────┤ ├─────────────────────────┤ │ * │ │ • id │ │ • JSON properties │ │ * │ │ • path │ + │ • Markdown blocks │ │ * │ │ • metadata │ │ • CSV rows │ │ * │ │ • hidden │ │ • Future: thumbnails │ │ * │ └─────────────────────────┘ └─────────────────────────┘ │ * │ ↓ ↓ │ * │ ┌─────────────────────────────────┐ │ * │ │ Materialized as LixFile │ │ * │ │ • All descriptor fields │ │ * │ │ • data: Uint8Array (from │ │ * │ │ plugin entities) │ │ * │ └─────────────────────────────────┘ │ * └─────────────────────────────────────────────────────────────┘ * ``` * * This projection approach means: * - File views aggregate changes from ALL entities within the file * - The 'data' field is dynamically materialized from plugin entities * - A single file view row represents multiple underlying entities */ export type LixFile = LixFileDescriptor & { path: string; data: Uint8Array; }; //# sourceMappingURL=schema.d.ts.map