Type Alias: LixFile

LixFile = LixFileDescriptor & { data: Uint8Array; }

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

Type declaration

data

data: Uint8Array