import type { ModelInsertable } from './types.js'; import type { GenerateContext } from '../../context/GenerateContext.js'; import type { ContentSettings } from '../ContentSettings.js'; import type { GeneratedDefinition, GenerationType } from '../../types/GeneratedValue.js'; import type { GeneratedValue } from '../../types/GeneratedValue.js'; import type { RefName } from '../../types/RefName.js'; type CreateModelArgs = { context: GenerateContext; insertable: ModelInsertable; refName: RefName; generation?: T; destinationPath?: string; rootRef?: RefName; noExport?: boolean; }; /** * Driver class responsible for managing model generation lifecycle. * * @template V - The generated value type * @template T - The generation type * @template EnrichmentType - Optional enrichment type */ export declare class ModelDriver { /** The generation context */ context: GenerateContext; /** The insertable model configuration */ insertable: ModelInsertable; /** Reference name for the model */ refName: RefName; /** Content settings for the model */ settings: ContentSettings; /** Optional destination path for the generated file */ destinationPath?: string; /** The generated definition */ definition: GeneratedDefinition; /** Optional root reference name */ rootRef?: RefName; /** Whether to skip export declaration */ noExport?: boolean; /** * Creates a new ModelDriver instance. * * @param args - Constructor arguments * @param args.context - Generation context * @param args.insertable - Model insertable configuration * @param args.refName - Reference name for the model * @param args.generation - Optional generation type * @param args.destinationPath - Optional destination path * @param args.rootRef - Optional root reference name * @param args.noExport - Whether to skip export declaration */ constructor({ context, insertable, refName, generation, destinationPath, rootRef, noExport }: CreateModelArgs); /** * Applies generation configuration to create the model definition. * * This method handles the core generation logic, including identifier resolution, * export path management, and import registration for cross-file dependencies. * * @template T - The generation type * @param args - Apply configuration arguments * @param args.generation - Optional generation type (unused currently) * @param args.destinationPath - Optional destination path for imports * @returns Generated definition for the model */ private apply; /** * Retrieves or creates a definition for the model. * * This method first checks for cached definitions to avoid duplicate generation, * then creates a new definition if none exists. It handles the complete model * transformation process including schema resolution and value generation. * * @param args - Definition retrieval arguments * @param args.identifier - The identifier for the definition * @param args.exportPath - The export path for the definition * @returns Model definition instance */ private getDefinition; /** * Type guard to verify a definition matches the expected generated value type. * * This method performs type narrowing to ensure a cached definition is compatible * with the current generation requirements, including export path validation. * * @template V - The expected generated value type * @param definition - The definition to verify (may be undefined) * @param exportPath - Expected export path for validation * @returns True if definition matches expected type and constraints */ private affirmDefinition; } export {}; //# sourceMappingURL=ModelDriver.d.ts.map