import type { AnySchema, VersionChainBuilder, Migration, VersionEntry, VersionId } from "./types.js"; /** * Runtime representation for one version in a normalized linear version chain. * * @internal */ export type InternalVersion = { /** Authored version identifier. */ readonly id: VersionId; /** Runtime schema used to validate this version's payload. */ readonly schema: AnySchema; /** Migration from the immediately previous version, absent on the first entry. */ readonly migrateFromPrevious?: Migration; }; /** * Runtime representation for the fluent version-chain builder. * * @internal */ export type InternalVersionChain = { /** Versions in authored chain order. */ readonly versions: readonly InternalVersion[]; }; /** * Start an explicit versioned schema chain. * * @remarks * Use this API when persisted version identifiers are durable external * protocol labels. Explicit version chains are linear in authored order and do not * require numeric contiguity. * * @example * ```ts * const versions = version(10, V1) * .becomes(20, V2, migrateV1ToV2) * .becomes(30, V3, migrateV2ToV3); * ``` * * @param versionId - Stable version identifier for the first schema. * @param schema - Schema for the first persisted payload shape. * @typeParam TId - Literal type of the first version identifier. * @typeParam TSchema - Schema type for the first payload. * @typeParam TContext - Migration context type. */ export declare function version(versionId: TId, schema: TSchema): VersionChainBuilder], TContext>; /** * Extract the normalized runtime version chain from a public builder. * * @throws {@link BecomesError} with `INVALID_VERSION_CHAIN` when the value was * not produced by {@link version}. * * @internal */ export declare function getInternalVersionChain(versions: unknown): InternalVersionChain; //# sourceMappingURL=version-chain.d.ts.map