/** * Schema versioning and migrations. * * A Page Spec declares its own `version`, independent of the package version. * Older supported versions are upgraded in memory before validation, so a * document that was valid when it was written keeps working. Removing a * supported version is a major release; see `docs/release-policy.md`. */ import type { DiagnosticBag } from '../diagnostics.js'; export declare const CURRENT_SPEC_VERSION = 1; export interface Migration { from: number; to: number; description: string; apply(document: Record): Record; } export declare const MIGRATIONS: readonly Migration[]; export declare function supportedVersions(): number[]; /** The declared version, or 0 for the pre-versioning shape, or undefined. */ export declare function detectSpecVersion(document: unknown): number | undefined; export interface MigrationResult { document: Record; /** Version the document was written in, before any migration. */ originalVersion: number; applied: string[]; } /** * Detect, validate, and apply migrations. Returns the document in the current * schema version. Reports diagnostics instead of throwing so `validate()` can * surface every problem at once. */ export declare function migrateSpec(document: unknown, bag: DiagnosticBag): MigrationResult | undefined; //# sourceMappingURL=migrate.d.ts.map