@nexica/nestjs-trpc
Version:
NestJS TRPC Bridge
42 lines (41 loc) • 1.41 kB
TypeScript
import z from 'zod/v4';
interface ProcedureInfo {
input?: ZodTypeAny;
output?: ZodTypeAny;
}
interface SchemaInfo {
name: string;
definition: string;
typeName: string;
typeDefinition: string;
dependencies?: string[];
schema: ZodTypeAny;
}
type ZodTypeAny = z.ZodType;
export declare class SchemaGenerator {
schemaRegistry: Map<string, SchemaInfo>;
processedSchemas: Set<string>;
private schemaNameCache;
private processingSchemas;
private schemaHashCache;
private schemaProcessingQueue;
clear(): void;
getSchemaTypeDefinition(schemaName: string): string;
collectSchemas(routerName: string, procedures: Record<string, ProcedureInfo>): void;
private isSimpleSchemaReference;
private isComplexDefinition;
private queueSchemaForProcessing;
private isSchemaInQueue;
private processSchemaQueue;
private processSingleSchema;
isZodObject(schema: ZodTypeAny): schema is z.ZodObject;
generateSchemaName(routerName: string, procedureName: string, type: 'Input' | 'Output'): string;
private expandZodObjectInline;
private getZodDefinitionStringIterative;
private generateNestedSchemaNameSafe;
generateNestedSchemaNameSafeForRouter(schema: z.ZodObject): string;
private createSchemaHashSafe;
topologicalSort(): string[];
getTransformationForm(schema: ZodTypeAny): string | null;
}
export {};