export type VersionedFieldKind = "boolean" | "int32" | "uint32" | "float32" | "float64" | "string" | "array" | "object";
export interface VersionedSchemaField {
    readonly name: string;
    readonly kind: VersionedFieldKind;
    readonly required?: boolean;
    readonly defaultValue?: unknown;
    readonly elementKind?: VersionedFieldKind;
    readonly schema?: VersionedSchema;
}
export interface VersionedSchemaValidation {
    readonly ok: boolean;
    readonly issues: readonly string[];
}
export declare class VersionedSchema {
    readonly name: string;
    readonly version: number;
    private readonly fields;
    constructor(name: string, version: number);
    addField(field: VersionedSchemaField): this;
    getField(name: string): VersionedSchemaField | undefined;
    getFields(): readonly VersionedSchemaField[];
    validate(data: unknown): VersionedSchemaValidation;
    serialize(data: unknown): Record<string, unknown>;
    deserialize(data: unknown): Record<string, unknown>;
    static builder(name: string, version: number): VersionedSchemaBuilder;
}
export declare class VersionedSchemaBuilder {
    private readonly schema;
    constructor(name: string, version: number);
    boolean(name: string, options?: FieldOptions<boolean>): this;
    int32(name: string, options?: FieldOptions<number>): this;
    uint32(name: string, options?: FieldOptions<number>): this;
    float32(name: string, options?: FieldOptions<number>): this;
    string(name: string, options?: FieldOptions<string>): this;
    array(name: string, elementKind: VersionedFieldKind, options?: FieldOptions<readonly unknown[]>): this;
    object(name: string, schema?: VersionedSchema, options?: FieldOptions<Record<string, unknown>>): this;
    field(field: VersionedSchemaField): this;
    build(): VersionedSchema;
}
export interface FieldOptions<T> {
    readonly required?: boolean;
    readonly defaultValue?: T;
}
export interface MigrationDefinition<T = unknown> {
    readonly from: number;
    readonly to: number;
    readonly description?: string;
    migrate(data: T): T;
}
export declare class MigrationRegistry<T = unknown> {
    private readonly migrations;
    register(migration: MigrationDefinition<T>): this;
    canMigrate(from: number, to: number): boolean;
    migrate(data: T, from: number, to: number): T;
    list(): readonly MigrationDefinition<T>[];
    private plan;
}
export type SaveSlotFormat = "json" | "binary";
export interface SaveSlotMetadata {
    readonly name?: string;
    readonly description?: string;
    readonly playTime?: number;
    readonly version?: string;
    readonly autoSave?: boolean;
    readonly [key: string]: unknown;
}
export interface SerializedSaveSlot {
    readonly id: string;
    readonly format: SaveSlotFormat;
    readonly timestamp: number;
    readonly metadata: SaveSlotMetadata;
    readonly compressed: boolean;
    readonly data: string;
}
export declare class SaveSlot {
    readonly id: string;
    private data;
    private format;
    private timestamp;
    private metadata;
    private compressed;
    constructor(id: string, timestamp?: number);
    setData(data: string | Uint8Array, format: SaveSlotFormat, options?: {
        readonly compressed?: boolean;
    }): void;
    getData(): string | Uint8Array | null;
    getFormat(): SaveSlotFormat;
    getTimestamp(): number;
    getMetadata(): SaveSlotMetadata;
    setMetadata(metadata: SaveSlotMetadata): void;
    isCompressed(): boolean;
    getSize(): number;
    toJSON(): SerializedSaveSlot;
    static fromJSON(serialized: SerializedSaveSlot): SaveSlot;
}
//# sourceMappingURL=VersionedSerialization.d.ts.map