import ts from "typescript"; export declare class TsHelpers { private static readonly OPERATOR_MAP_PROPS; /** * Returns true if the given TypeScript type looks like a Zod schema, * by checking for the presence of the `_input` and `_output` branded properties * that all Zod types expose (v3), or the `_zod` internal property (v4). */ static isZodType(type: ts.Type): boolean; /** * Returns true if the top-level Zod type IS a ZodPipe (produced by * `.transform()` or `z.preprocess()`) applied at the outermost level. * This is different from checking if the type string _contains_ "ZodPipe", * which would also match schemas whose shape contains such fields. */ static isZodEffects(checker: ts.TypeChecker, type: ts.Type): boolean; /** * Resolves the `_input` type of a Zod schema — i.e. the pre-transform shape, * which represents what a caller would send in an HTTP request. */ static getZodInputType(checker: ts.TypeChecker, zodType: ts.Type): ts.Type | undefined; /** * Resolves the `_output` type of a Zod schema — the post-transform inferred type, * equivalent to `z.infer`. */ static getZodOutputType(checker: ts.TypeChecker, zodType: ts.Type): ts.Type | undefined; /** * Returns true if a type has OperatorMap member properties ($eq, $ne, $in, etc.). */ private static isOperatorMapMember; /** * Detects if a resolved type looks like an `OperatorMap` — a union that * includes an object with filter operator properties ($eq, $ne, $in, etc.). */ static isOperatorMapType(type: ts.Type): boolean; /** Zod wrapper class names whose first type argument is the wrapped schema. */ private static readonly ZOD_WRAPPER_NAMES; /** * Structurally inspects a Zod schema's TypeScript type to determine whether * it represents an `OperatorMap` (the union produced by `createOperatorMap()`). * * This is used as a fallback when the schema's `_output` cannot be fully * resolved by the TypeScript compiler (e.g. because `applyAndAndOrOperators` * introduces a `z.lazy()` circular reference). Instead of relying on * `_output`, walk the Zod type-argument tree: unwrap `ZodOptional`/ * `ZodNullable`/`ZodDefault`/`ZodPipe`/..., descend into `ZodUnion` options, * and look for a `ZodObject` whose shape contains the operator keys * (`$eq`, `$ne`, `$in`, ...). */ static isOperatorMapZodSchema(checker: ts.TypeChecker, zodType: ts.Type): boolean; private static checkOperatorMapZod; /** * Returns a simplified display string for a TypeScript type, suitable for * use in error messages and diagnostics. */ static typeToDisplayString(checker: ts.TypeChecker, type: ts.Type): string; /** * Recursively walks a call expression chain to check if any call in the chain * uses the given function name. */ static callChainIncludes(node: ts.Node, funcName: string): boolean; /** * Returns true if the given type is plain `string` (not a literal or union). */ static isPlainString(type: ts.Type): boolean; /** * Returns true if the type is a string literal or a union of string literals. */ static isStringLiteralOrUnion(type: ts.Type): boolean; /** * Returns true if the type is a TypeScript string enum or a union of string * enum literals. */ static isStringEnumType(type: ts.Type): boolean; /** * Returns the set of string values from a string literal type or a union of * string literals. */ static getStringLiteralValues(type: ts.Type): Set; /** * Returns true if the given symbol has a `@http-validation-ignore` JSDoc tag. * Properties with this tag are excluded from compatibility validation. */ static hasHttpValidationIgnoreTag(symbol: ts.Symbol): boolean; /** * Checks whether the given node has an `export` modifier. */ static isExported(node: ts.Node): boolean; /** * Returns the first VariableDeclaration inside a VariableStatement. */ static getVariableDeclaration(stmt: ts.VariableStatement): ts.VariableDeclaration | undefined; /** * Reads the `@http-type-name` JSDoc tag value from the leading comments * of a VariableStatement node, if present. */ static readHttpTypeNameTag(node: ts.VariableStatement, sourceFile: ts.SourceFile): string | undefined; /** * Given a call expression like `WithAdditionalData(CreateCustomer)`, * returns the text of the first argument identifier ("CreateCustomer"). */ static getFirstCallArgName(node: ts.VariableDeclaration): string | undefined; /** * Checks whether a TypeScript type is a function type (as opposed to an object/Zod type). */ static isFunctionType(type: ts.Type): boolean; } //# sourceMappingURL=ts-helpers.d.ts.map