/** * Structural Validation * * Validates that a document conforms to its template's structural requirements. */ import type { Data } from '@puckeditor/core'; import type { Template } from '../types.js'; export type ValidationErrorCode = 'MISSING_PINNED_COMPONENT' | 'PINNED_COMPONENT_OUT_OF_ORDER' | 'UNEXPECTED_COMPONENT_AT_PINNED_SLOT'; export interface ValidationError { code: ValidationErrorCode; message: string; componentType?: string; expectedIndex?: number; actualIndex?: number; } export interface ValidationResult { valid: boolean; errors: ValidationError[]; } /** * Validate that document data conforms to template structure. * * Conformance resolves by slot-id membership: every pinned slot must be * present somewhere in the document, and the pinned slots that share a list * must hold the template's relative order there. Components carrying non-slot * ids are allowed anywhere. A template with no pinned slots imposes nothing. */ export declare function validateStructure(data: Data, template: Template): ValidationResult;