UNPKG

typescript-runtime-schemas

Version:

A TypeScript schema generation tool that extracts Zod schemas from TypeScript source files with runtime validation support. Generate validation schemas directly from your existing TypeScript types with support for computed types and constraint-based valid

28 lines (27 loc) 1.18 kB
import { TypeResolver } from "./type-resolver"; import { FileDiscoveryOptions } from "./file-discovery"; export interface TypeResolverFactoryOptions extends FileDiscoveryOptions { compilerOptions?: any; } export declare class TypeResolverFactory { /** * Create a TypeResolver with full import support */ static create(input: string, options?: TypeResolverFactoryOptions): Promise<TypeResolver>; /** * Create TypeResolver with explicit file discovery options */ static createFromFiles(input: string, fileOptions: FileDiscoveryOptions, compilerOptions?: any): Promise<TypeResolver>; /** * Create TypeResolver from directory with glob patterns */ static createFromDirectory(dirPath: string, glob: string | string[], exclude?: string | string[], compilerOptions?: any): Promise<TypeResolver>; /** * Create TypeResolver from a single file */ static createFromFile(filePath: string, compilerOptions?: any): Promise<TypeResolver>; /** * Create TypeResolver from source code (same as original constructor) */ static createFromSource(sourceCode: string, compilerOptions?: any): TypeResolver; }