zod-opts
Version:
node.js CLI option parser / validator using Zod
8 lines (7 loc) • 634 B
TypeScript
import { type ZodUnionDef } from "zod";
import type { BaseType, BaseTypeT, InternalOption, InternalPositionalArgument, Option, PositionalArgument, ZodDef } from "./type";
export declare function getDefaultValue(def: ZodDef): string[] | number[] | BaseTypeT | undefined;
export declare function toInternalType(def: ZodDef, isPositional?: boolean): BaseType;
export declare function toInternalTypeForZodUnion(def: ZodUnionDef): BaseType;
export declare function optionToInternal(option: Option, name: string): InternalOption;
export declare function positionalArgumentToInternal(option: PositionalArgument): InternalPositionalArgument;