import { TSchema } from '@sinclair/typebox'; /** * Unified Schema Export Utility * * Single source of truth for converting TypeBox schemas to JSON Schema format. * Eliminates duplication between generate-schemas.mjs and plugin/schema.ts */ /** * Configuration for a component schema */ interface ComponentSchemaConfig { schema: TSchema; title: string; description: string; requiresName?: boolean; enhanceForRichContent?: boolean; } /** * Fix TypeBox recursive references in a schema * * Resolves the bare `$ref` values TypeBox leaves behind ("T0", or a * `Type.Recursive` `$id`) into JSON Pointers. `rootDefinitionName` is only the * fallback for a reference that names nothing hoisted: a schema may carry * several recursive definitions — the DOCX document schema carries one per * renderer — and a bare reference that matches an actual definition resolves * to *that* one, which is what keeps the two renderer views apart. */ declare function fixSchemaReferences(schema: Record, rootDefinitionName?: string): void; /** * Convert TypeBox schema to JSON Schema format with proper definitions */ declare function convertToJsonSchema(schema: TSchema, options?: { $schema?: string; $id?: string; title?: string; description?: string; definitions?: Record; }): Record; /** * Create a component schema with proper structure */ declare function createComponentSchema(name: string, config: ComponentSchemaConfig, componentDefinitionSchema?: TSchema, rootDefinitionName?: string): Record; /** * Export schema to file with proper formatting */ declare function exportSchemaToFile(schema: Record, outputPath: string, options?: { prettyPrint?: boolean; }): Promise; /** * Component metadata registry * Single source of truth for component titles and descriptions */ declare const COMPONENT_METADATA: Record>; /** * Base schema metadata registry */ declare const BASE_SCHEMA_METADATA: Record; /** * Theme schema metadata */ declare const THEME_SCHEMA_METADATA: { theme: { title: string; description: string; }; }; export { BASE_SCHEMA_METADATA, COMPONENT_METADATA, type ComponentSchemaConfig, THEME_SCHEMA_METADATA, convertToJsonSchema, createComponentSchema, exportSchemaToFile, fixSchemaReferences };