import type { CharacterBuild } from './types.js'; /** Structured error thrown when a build cannot be deserialized. */ export type BuildLoadErrorShape = { code: 'BUILD_MALFORMED' | 'BUILD_VERSION_UNSUPPORTED'; message: string; hint: string; }; export declare class BuildLoadError extends Error { readonly code: BuildLoadErrorShape['code']; readonly hint: string; constructor(shape: BuildLoadErrorShape); } /** Serialize a character build to a JSON string. Stamps the current schema version. */ export declare function serializeBuild(build: CharacterBuild): string; /** * Deserialize a character build from a JSON string. * Throws a structured BuildLoadError (never a raw SyntaxError) on invalid * input. Legacy builds without a version field are stamped with the current * schema version; builds from a newer schema are rejected. */ export declare function deserializeBuild(json: string): CharacterBuild; /** Validate a JSON string as a valid CharacterBuild shape. */ export declare function validateSerializedBuild(json: string): { ok: boolean; errors: string[]; }; //# sourceMappingURL=serialize.d.ts.map