/**
 * A single forward migration. `up` must be a PURE function: it takes a plain
 * doc object (already at version `from`) and returns a NEW doc at version
 * `to` — it never mutates its input and never touches disk. `to` should be
 * exactly `from + 1`; chaining handles multi-step upgrades.
 */
export interface Migration {
    /** Schema version this migration upgrades FROM. */
    from: number;
    /** Schema version this migration upgrades TO (conventionally `from + 1`). */
    to: number;
    /** Human-readable id for logs / tests, e.g. `"legacy-track-ids"`. */
    id: string;
    /** Pure doc→doc transform. Must not mutate input or perform IO. */
    up: (doc: unknown) => unknown;
}
/** The doc kinds that carry a `schemaVersion` and can be chained by `migrate`. */
export type MigratableKind = "composition" | "carousel";
/**
 * Read a doc's declared `schemaVersion`. Absent / non-numeric ⇒ 1 (the
 * implicit version of every pre-I10 on-disk file). Mirrors the zod
 * `.default(1)` on both schemas so `migrate` and `parse` agree on the floor.
 */
export declare function readSchemaVersion(doc: unknown): number;
/**
 * Run the registered migration chain for `kind` against `doc`, upgrading it to
 * the latest version. Pure: returns a NEW doc, never mutates the input, never
 * touches disk. If `doc` is already at (or somehow beyond) the latest version,
 * it is returned with its `schemaVersion` normalised but otherwise untouched.
 *
 * Determinism: migrations are applied in ascending `from` order. We look up
 * the migration whose `from === currentVersion` at each step; a missing step
 * is a registry bug (gap in the chain) and throws loudly rather than silently
 * skipping a transform.
 */
export declare function migrate(kind: MigratableKind, doc: unknown): unknown;
/**
 * The latest schemaVersion reachable for `kind` = 1 (base) + number of
 * registered forward migrations, since each migration bumps the version by
 * one. With zero migrations registered this is 1 (the floor), which is the
 * v0.1.1 state for both kinds — the skeleton is in place but no behaviour-
 * changing version bump has shipped yet.
 */
export declare function latestVersion(kind: MigratableKind): number;
/**
 * Register a forward migration for a kind. Idempotency is NOT assumed —
 * registering the same id twice throws so a double-import can't silently
 * duplicate a version bump (which would corrupt `latestVersion`).
 */
export declare function registerMigration(kind: MigratableKind, migration: Migration): void;
/** Read-only view of the registered chain for a kind (tests / introspection). */
export declare function listMigrations(kind: MigratableKind): readonly Migration[];
//# sourceMappingURL=registry.d.ts.map