/** One block in a page document: stable id, registered type, typed props. */ export declare interface PageBlock { id: string type: string props: Record } export declare interface BlockPropDefinition { rule: BlockPropRule required?: boolean } export declare interface BlockDefinition { type: string label: string component: string schema: Record icon?: string } export declare interface BlockError { index: number type?: string prop?: string message: string } /** * A prop validator: return true for valid, or a message for invalid. Kept * structural (not tied to ts-validation's class) so block schemas can use * `schema.*` rules or plain functions interchangeably. */ export type BlockPropRule = | { validate: (value: unknown) => boolean | Promise } | ((value: unknown) => boolean | string); export type ValidateBlocksResult = | { ok: true, blocks: PageBlock[] } | { ok: false, errors: BlockError[] }