/** * Absolute path to the directory containing JSON schema definitions for content metadefinitions. * * Used internally to load and register schemas for validation of pagetype, componenttype, * aspecttype, and other content asset definitions. */ export declare const CONTENT_SCHEMAS_DIR: string; /** Top-level schema types that users validate files against. */ export declare const CONTENT_SCHEMA_TYPES: readonly ["pagetype", "componenttype", "aspecttype", "cmsrecord", "customeditortype", "contentassetpageconfig", "contentassetcomponentconfig", "contentassetstructuredcontentdata", "image"]; export type ContentSchemaType = (typeof CONTENT_SCHEMA_TYPES)[number]; export interface MetaDefinitionValidationError { /** JSON pointer path to the error (e.g., "/region_definitions/0/id") */ path: string; /** Human-readable error message */ message: string; /** The name of the failing property or keyword */ property: string; } export interface MetaDefinitionValidationResult { /** Whether the data is valid against the schema */ valid: boolean; /** Detected or specified schema type */ schemaType: ContentSchemaType; /** Validation errors (empty if valid) */ errors: MetaDefinitionValidationError[]; /** Source file path (if validated from file) */ filePath?: string; } export interface ValidateMetaDefinitionOptions { /** Explicit schema type (overrides auto-detection) */ type?: ContentSchemaType; } /** * Error thrown when the schema type cannot be determined from the file path or data. */ export declare class MetaDefinitionDetectionError extends Error { constructor(message?: string); } /** * Detect the metadefinition schema type from a file path using Page Designer conventions. * * - `experience/pages/` → `pagetype` * - `experience/components/` → `componenttype` */ export declare function detectTypeFromPath(filePath: string): ContentSchemaType | null; /** * Detect the metadefinition schema type from the data's top-level properties. */ export declare function detectTypeFromData(data: Record): ContentSchemaType | null; /** * Detect the metadefinition schema type using a 3-tier strategy: * 1. File path convention (if filePath provided) * 2. Property heuristics from data * 3. Returns null if neither works (caller should use explicit --type or throw) */ export declare function detectMetaDefinitionType(data: Record, filePath?: string): ContentSchemaType | null; /** * Validate a parsed JSON object against a content metadefinition schema. * * @param data - The JSON object to validate against the detected or specified schema type * @param options - Validation options including optional schema type override * @returns A validation result containing the valid flag, detected schema type, and any validation errors * @throws {MetaDefinitionDetectionError} When the schema type cannot be detected and no explicit type is provided. */ export declare function validateMetaDefinition(data: Record, options?: ValidateMetaDefinitionOptions): MetaDefinitionValidationResult; /** * Validate a JSON metadefinition file against a content schema. * * Uses file path conventions for type detection before falling back to property heuristics. * * @param filePath - Absolute or relative path to the JSON metadefinition file * @param options - Optional validation options including explicit schema type override * @returns Validation result with valid flag, detected schema type, errors array, and source file path * @throws {MetaDefinitionDetectionError} When the schema type cannot be detected and no explicit type is provided. */ export declare function validateMetaDefinitionFile(filePath: string, options?: ValidateMetaDefinitionOptions): MetaDefinitionValidationResult;