import { IZod2AstOpt } from "../core"; import * as Transpilers from "../transpilers"; type TargetKeys = keyof typeof Transpilers; type Target = (typeof Transpilers)[T]; type TargetOpt = ConstructorParameters>[0]; type AstOpt = Pick; /** * Class that provides the foundational structure for defining layered models, managing metadata, * and exposing transpile method for all supported languages. * It is intended to be extended by specific model implementations. * * @remarks * - Children classes require the `@Domain` or other layer decorators to define the layer metadata. * - It automatically collects properties of the model that are instances of `ZodType` and processes * them into AST nodes. * * @example * ```typescript * @Domain({ name: 'User', file: 'user.ts' }) * class UserModel extends Zod2XModel { * username = z.string(); * age = z.number(); * } * * const userModel = new UserModel({ modelName: 'User' }); * const userModelTypescript = userModel.transpile(Transpilers.Zod2Ts); * ``` */ export declare class Zod2XModel { private astNodes; private astNodesGeneration; private getModelName; private getLayerMetadata; /** * Reports an issue of the layered model: an error in strict mode, a warning otherwise. */ private reportLayerIssue; /** * Returns the issues of types declared by this model and by a model of the same layer in * another file, without one of them referencing the other. */ private getOwnershipTieIssues; private getAstNode; /** * Returns an AST of the model to know the files it imports: any AST built for the current * generation (strict mode does not change the imported files), or a non-strict one. */ private getImportsAstNode; /** * Checks that the file of this model does not import itself back through the files of other * layered models, for transpilers that do not support circular imports. */ private checkCircularImports; /** * Transpiles the model into a target language using the specified transpiler. * * @param target - The constructor of the target transpiler. * @param opt - The options required to initialize the target transpiler. * @param astOpt - Options for the AST generation. * * @returns A string representing the transpiled model in the target language. */ transpile(target: Target<"Zod2Cpp">, opt?: TargetOpt<"Zod2Cpp">, astOpt?: AstOpt): string; transpile(target: Target<"Zod2Cpp17">, opt?: TargetOpt<"Zod2Cpp17">, astOpt?: AstOpt): string; transpile(target: Target<"Zod2Ts">, opt?: TargetOpt<"Zod2Ts">, astOpt?: AstOpt): string; transpile(target: Target<"Zod2Py">, opt?: TargetOpt<"Zod2Py">, astOpt?: AstOpt): string; transpile(target: Target<"Zod2Go">, opt?: TargetOpt<"Zod2Go">, astOpt?: AstOpt): string; transpile(target: Target<"Zod2Dart">, opt?: TargetOpt<"Zod2Dart">, astOpt?: AstOpt): string; } export {};