@freeword/meta
Version:
Meta package for Freeword: exports all core types, constants, and utilities from the src/ directory.
189 lines • 8.78 kB
TypeScript
import type { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEnum, ZodLiteral, ZodNever, ZodNullable, ZodNumber, ZodPromise, ZodRecord, ZodString, ZodTuple, ZodTypeAny, ZodOptional, ZodReadonly, ZodPipeline, ZodBranded, ZodTypenames } from './ZodInternal.ts';
import type { ArrNZ, StrArrNZ } from '../types/TSTools.ts';
export declare function zcheckZodTypename(checker: ZodTypeAny): Zodname;
export declare function zcheckZodTypename(checker: any): Zodname | undefined;
export declare function zShapename(checker: ZodTypeAny): Primcheckname;
export declare function zShapename(checker: any): Primcheckname | 'nonChecker';
export declare function isChecker(checker: any): checker is ZodTypeAny;
export declare function isIdkChecker(check: ZodTypeAny): check is ZodAny;
export declare function isBigintChecker(check: ZodTypeAny): check is ZodBigInt;
export declare function isBoolChecker(check: ZodTypeAny): check is ZodBoolean;
export declare function isJsdateChecker(check: ZodTypeAny): check is ZodDate;
export declare function isZneverChecker(check: ZodTypeAny): check is ZodNever;
export declare function isNumChecker(check: ZodTypeAny): check is ZodNumber;
export declare function isBagChecker(check: ZodTypeAny): check is ZodRecord;
export declare function isStrChecker(check: ZodTypeAny): check is ZodString;
export declare function isTupleChecker(check: ZodTypeAny): check is ZodTuple;
export declare function isOneofChecker(check: ZodTypeAny): check is ZodEnum<StrArrNZ>;
export declare function isStrPipelineCk(check: ZodTypeAny): check is ZodPipeline<ZodTypeAny, ZodString>;
export declare function isPipelineCk(check: ZodTypeAny): check is ZodPipeline<ZodTypeAny, ZodTypeAny>;
export declare function isBrandedCk(check: ZodTypeAny): check is ZodBranded<ZodTypeAny, string | number | symbol>;
export declare function isUnwrappable(check: ZodTypeAny): check is ZodUnwrappable;
export declare function isStrArrChecker(check: ZodTypeAny): check is ZodArray<ZodString>;
export declare function isBoolArrChecker(check: ZodTypeAny): check is ZodArray<ZodBoolean>;
export declare function isNumArrChecker(check: ZodTypeAny): check is ZodArray<ZodNumber>;
export declare function isAnyArrChecker(check: ZodTypeAny): check is ZodArray<ZodTypeAny>;
export declare function isArrChecker(check: any): check is ZodArray<ZodTypeAny>;
export declare function isArrChecker<ST extends SimplePrimcheckname>(check: ZodTypeAny, subtype: ST): check is ZodArray<ZodSimpleRegistry[ST]>;
type SimplePrimcheckname = 'idk' | 'bigint' | 'bool' | 'jsdate' | 'znever' | 'num' | 'oneof' | 'bag' | 'str' | 'tuple' | 'litStr';
type OfsimplePrimcheckname = 'numArr' | 'strArr' | 'anyArr' | 'literal';
type FancyPrimcheckname = 'prom' | 'obj' | 'union' | 'arr' | 'tuple' | 'literal';
type WrappedPrimcheckname = 'nullable' | 'optional' | 'branded' | 'effects' | 'intersection' | 'pipeline' | 'readonly';
type Primcheckname = SimplePrimcheckname | FancyPrimcheckname | OfsimplePrimcheckname | WrappedPrimcheckname;
type Zodname = 'ZodAny' | 'ZodBigInt' | 'ZodBoolean' | 'ZodDate' | 'ZodNever' | 'ZodNumber' | 'ZodEnum' | 'ZodRecord' | 'ZodString' | 'ZodTuple' | 'ZodLiteral' | 'ZodArray' | 'ZodObject' | 'ZodPromise' | 'ZodUnion' | 'ZodNullable' | 'ZodOptional' | 'ZodBranded' | 'ZodEffects' | 'ZodIntersection' | 'ZodPipeline' | 'ZodReadonly';
type ZodUnwrappable = ZodNullable<any> | ZodOptional<any> | ZodPromise<any> | ZodReadonly<any>;
export declare const CuteToZodNameLookup: {
readonly idk: "ZodAny";
readonly bigint: "ZodBigInt";
readonly bool: "ZodBoolean";
readonly jsdate: "ZodDate";
readonly oneof: "ZodEnum";
readonly znever: "ZodNever";
readonly num: "ZodNumber";
readonly bag: "ZodRecord";
readonly str: "ZodString";
readonly literal: "ZodLiteral";
readonly prom: "ZodPromise";
readonly tuple: "ZodTuple";
readonly arr: "ZodArray";
readonly strArr: "ZodArray";
readonly numArr: "ZodArray";
readonly anyArr: "ZodArray";
readonly litStr: "ZodLiteral";
readonly obj: "ZodObject";
readonly union: "ZodUnion";
readonly nullable: "ZodNullable";
readonly branded: "ZodBranded";
readonly effects: "ZodEffects";
readonly intersection: "ZodIntersection";
readonly optional: "ZodOptional";
readonly pipeline: "ZodPipeline";
readonly readonly: "ZodReadonly";
};
export declare const ZodShortToZodnameLookup: {
readonly any: "ZodAny";
readonly bigInt: "ZodBigInt";
readonly boolean: "ZodBoolean";
readonly date: "ZodDate";
readonly enum: "ZodEnum";
readonly never: "ZodNever";
readonly number: "ZodNumber";
readonly record: "ZodRecord";
readonly string: "ZodString";
readonly literal: "ZodLiteral";
readonly promise: "ZodPromise";
readonly tuple: "ZodTuple";
readonly array: "ZodArray";
readonly union: "ZodUnion";
readonly object: "ZodObject";
readonly nullable: "ZodNullable";
readonly branded: "ZodBranded";
readonly effects: "ZodEffects";
readonly intersection: "ZodIntersection";
readonly optional: "ZodOptional";
readonly pipeline: "ZodPipeline";
readonly readonly: "ZodReadonly";
};
export declare const CuteToZodtstypeLookup: {
readonly idk: "ZodAny";
readonly bigint: "ZodBigInt";
readonly bool: "ZodBoolean";
readonly jsdate: "ZodDate";
readonly znever: "ZodNever";
readonly num: "ZodNumber";
readonly bag: "ZodRecord";
readonly str: "ZodString";
readonly tuple: "ZodTuple";
readonly literal: "ZodLiteral<any>";
readonly prom: "ZodPromise<any>";
readonly oneof: "ZodEnum<StrArrNZ>";
readonly arr: "ZodArray<ZodAny>";
readonly strArr: "ZodArray<ZodString>";
readonly numArr: "ZodArray<ZodNumber>";
readonly anyArr: "ZodArray<ZodAny>";
readonly obj: "ZodObject<any, any, any>";
readonly union: "ZodUnion<any[]>";
readonly litStr: "ZodLiteral<string>";
readonly other: "ZodTypeAny";
readonly nonChecker: "any";
};
export declare const ZodToCuteNameLookup: {
readonly ZodAny: "idk";
readonly ZodBigInt: "bigint";
readonly ZodBoolean: "bool";
readonly ZodDate: "jsdate";
readonly ZodNever: "znever";
readonly ZodNumber: "num";
readonly ZodEnum: "oneof";
readonly ZodRecord: "bag";
readonly ZodString: "str";
readonly ZodTuple: "tuple";
readonly ZodLiteral: "literal";
readonly ZodArray: "anyArr";
readonly ZodObject: "obj";
readonly ZodPromise: "prom";
readonly ZodUnion: "union";
readonly ZodBranded: "branded";
readonly ZodEffects: "effects";
readonly ZodPipeline: "pipeline";
readonly ZodIntersection: "intersection";
readonly ZodNullable: "nullable";
readonly ZodOptional: "optional";
readonly ZodReadonly: "readonly";
};
export declare function checkernameForZodname(zodname: Zodname): Primcheckname;
export declare function checkernameForZodname(zodname: string): Primcheckname | undefined;
export declare function zodtstypeForCheckername(checkername: Primcheckname): string;
export declare function zodtstypeForCheckername(checkername: string): string | undefined;
export declare function zodnameForCheckername(checkername: Primcheckname): Zodname;
export declare function zodnameForCheckername(checkername: string): Zodname | undefined;
export interface CheckerSummary {
typeName: ZodTypenames | '(prim)';
ofType?: ZodTypenames | '(prim)' | '??' | undefined;
shape?: Record<string, CheckerSummary>;
ofShape?: Record<string, CheckerSummary>;
type?: CheckerSummary;
innerType?: CheckerSummary;
catchall?: CheckerSummary;
items?: CheckerSummary[];
options?: CheckerSummary[];
}
export declare function summarizeCheckerDef(checker: ZodTypeAny): CheckerSummary;
export type ZodFancyRegistry<XT> = {
literal: ZodLiteral<XT>;
oneof: ZodEnum<ArrNZ<XT & string>>;
enum: ZodEnum<ArrNZ<XT & string>>;
arr: ZodArray<XT & ZodTypeAny>;
prom: ZodPromise<XT & ZodTypeAny>;
nullable: ZodNullable<XT & ZodTypeAny>;
};
export type ZodSimpleRegistry = {
idk: ZodAny;
bigint: ZodBigInt;
bool: ZodBoolean;
jsdate: ZodDate;
znever: ZodNever;
num: ZodNumber;
oneof: ZodEnum<ArrNZ<any>>;
bag: ZodRecord;
str: ZodString;
tuple: ZodTuple;
litStr: ZodLiteral<string>;
numArr: ZodArray<ZodNumber>;
strArr: ZodArray<ZodString>;
anyArr: ZodArray<ZodAny>;
any: ZodAny;
bigInt: ZodBigInt;
boolean: ZodBoolean;
date: ZodDate;
never: ZodNever;
number: ZodNumber;
record: ZodRecord;
string: ZodString;
literal: ZodLiteral<string>;
numberArray: ZodArray<ZodNumber>;
otherArray: ZodArray<ZodAny>;
stringArray: ZodArray<ZodString>;
};
export {};
//# sourceMappingURL=ZodTypeguards.d.ts.map