@freeword/meta
Version:
Meta package for Freeword: exports all core types, constants, and utilities from the src/ directory.
69 lines • 3.51 kB
TypeScript
import * as ZImp from 'zod';
import type { ZodTypeAny } from 'zod';
import type { GoodOutcome } from '../types/UtilityTypes.ts';
export type { infer as Zcasted, input as Zsketch, ZodRawShape, ZodTypeAny, ZodType, ZodDefault, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodDate, ZodEffects, ZodEnum, ZodIntersection, ZodLiteral, ZodNever, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRecord, ZodString, ZodTuple, ZodUnion, ZodReadonly, ZodTypeDef, RefinementCtx as ZodCtx, RawCreateParams as ZodTypeParams, } from 'zod';
export type ZodTypenames = `${ZImp.ZodFirstPartyTypeKind}`;
export { ZodIssueCode, NEVER as FailedTransform, NEVER as FailedRefine, } from 'zod';
export type Zensure<TT, ZDT extends ZImp.ZodTypeDef = ZImp.ZodTypeDef> = ZImp.ZodType<TT, ZDT, TT | undefined>;
export type Zforced<TT, ZDT extends ZImp.ZodTypeDef = ZImp.ZodTypeDef> = ZImp.ZodType<TT, ZDT, never>;
export type Zobsketch<ZT extends ZImp.ZodRawShape> = ZImp.input<ZImp.ZodObject<ZT>>;
export type Zobcasted<ZT extends ZImp.ZodRawShape> = ZImp.output<ZImp.ZodObject<ZT>>;
interface Story {
act?: string | null | undefined;
}
type AnyBag = Record<string, any>;
export interface Zchecker<Output = any, _Def extends ZImp.ZodTypeDef = ZImp.ZodTypeDef, Input = Output> extends ZImp.ZodType<Output, _Def, Input> {
checkname: string;
hasDescription: boolean;
isChecker: true;
cast(data: Input, story?: Story | undefined, params?: Partial<ZImp.ParseParams> | undefined): Output;
check(subj: any, story?: Story | undefined, params?: Partial<ZImp.ParseParams> | undefined): boolean;
report<RT, Paths extends string>(subj: RT, story?: Story | undefined, params?: Partial<ZImp.ParseParams> | undefined): ParseReport<RT, Paths>;
}
export interface IssueDetails {
msg: string;
badpropStr: string;
badprop: any;
subIssues?: ZodSubIssue[];
}
export type ZodSubIssue = ZImp.ZodIssue & {
message: string;
badprop: any;
badpropStr: string;
};
export type ZIssue = ZImp.ZodIssue & {
message: string;
badprop: any;
badpropStr: string;
propmsg: string;
issues: ZodSubIssue[];
};
export type ProtoZodIssue = Omit<ZIssue, 'message'> & {
message: IssueDetails | string | undefined;
};
export type DetailedIssue = ProtoZodIssue & {
message: IssueDetails;
};
export interface TKZodError<RT, Paths extends string = string> extends ZImp.ZodError<RT> {
ok: false;
success: false;
pathed: Record<Paths, readonly ZIssue[]>;
messages: Record<Paths, string>;
badprops: Partial<RT> & Record<Paths, any>;
_repair(subj: any, checker: ZImp.ZodTypeAny, story?: Story): ThisType<TKZodError<RT>>;
story: Story;
extensions: AnyBag;
}
export interface BadParseReport<RT, Paths extends string> extends TKZodError<RT, Paths> {
}
export interface GoodParseReport<RT> extends GoodOutcome<RT> {
success: true;
}
export type ParseReport<RT, Paths extends string> = GoodOutcome<RT> | TKZodError<RT, Paths>;
export declare function demand<ZOT extends ZImp.ZodTypeAny>(zod: ZOT, obj: ZImp.infer<ZOT>, opts?: Partial<ZImp.ParseParams>): ZImp.infer<ZOT>;
export declare function ensureDescribed<ZT extends ZImp.ZodTypeAny>(zcheck: ZT, descr: string): ZT;
export declare function zShape(checker: ZImp.ZodTypeAny, depth?: number): any;
export declare function checknameFor(checker: ZodTypeAny): string;
export declare const Z: typeof ZImp.z;
export declare const ZLib: typeof ZImp;
//# sourceMappingURL=ZodInternal.d.ts.map