import type { TSchema, Static } from '@sinclair/typebox'; import type { CustomComponent } from './createComponent'; import type { ReportComponentDefinition } from '../types'; import { type ComponentValidationResult } from '@json-to-office/shared/plugin'; import type { ValidationResult } from '@json-to-office/shared'; export { DuplicateComponentError, ComponentValidationError, UnknownPreservedComponentError, } from '@json-to-office/shared/plugin'; /** * Validate a component props against a schema. * Accepts a narrower interface — only needs { propsSchema }. */ export declare function validateComponentProps(schema: { propsSchema: TPropsSchema; }, props: unknown, componentName?: string, opts?: { clean?: boolean; applyDefaults?: boolean; }): ComponentValidationResult; /** * Validate document and all custom components (version-aware). * * Standard components (paragraph, section, …) are validated against their * schemas via the unified validator, which is told the registered custom names * so it neither rejects them as unknown nor checks them against a standard * schema. Custom component props are then validated version-aware below. Errors * from both passes are merged so a single call reports the whole document. */ export declare function validateDocument(document: ReportComponentDefinition, customComponents: CustomComponent[], options?: { allowUnknownFields?: boolean; }): ValidationResult & { success: boolean; }; /** * Validates component props and returns the typed props or throws. */ export declare function getValidatedProps(schema: { propsSchema: TPropsSchema; }, props: unknown): Static; export type { ValidationError } from '@json-to-office/shared-docx/validation/unified'; export type { ComponentValidationResult } from '@json-to-office/shared/plugin'; export declare const cleanComponentProps: typeof getValidatedProps; //# sourceMappingURL=validation.d.ts.map