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