UNPKG

type-compiler

Version:

A TypeScript compiler plugin for enhanced runtime type checking and analysis with Zod validation

19 lines (18 loc) 931 B
import ts from 'typescript'; import { TypeCompilerOptions } from './types'; /** * Convert a TypeScript type to a Zod schema */ export declare function typeToZodSchema(type: ts.Type, typeChecker: ts.TypeChecker, program?: ts.Program, options?: TypeCompilerOptions): string; /** * Generate a validator for function parameters */ export declare function generateFunctionParamsValidator(node: ts.FunctionDeclaration | ts.MethodDeclaration, typeChecker: ts.TypeChecker, options?: TypeCompilerOptions): string; /** * Generate validators for class methods */ export declare function generateClassValidators(node: ts.ClassDeclaration, typeChecker: ts.TypeChecker, zodSchemaPrefix?: string, options?: TypeCompilerOptions): ts.Statement[]; /** * Process a type with a worker thread */ export declare function processTypeWithWorker(type: ts.Type, typeChecker: ts.TypeChecker, options?: TypeCompilerOptions, workerPool?: any): string;