import { StrictValidator } from "typanion"; import { CommandOptionReturn, GeneralOptionFlags, WithArity } from "./utils"; export type StringOptionNoBoolean = GeneralOptionFlags & { env?: string; validator?: StrictValidator; tolerateBoolean?: false; arity?: Arity; }; export type StringOptionTolerateBoolean = GeneralOptionFlags & { env?: string; validator?: StrictValidator; tolerateBoolean: boolean; arity?: 0; }; export type StringOption = StringOptionNoBoolean | StringOptionTolerateBoolean; export type StringPositionalFlags = { validator?: StrictValidator; name?: string; required?: boolean; }; /** * Used to annotate positional options. Such options will be strings * unless they are provided a schema, which will then be used for coercion. * * Be careful: this function is order-dependent! Make sure to define your * positional options in the same order you expect to find them on the * command line. */ export declare function String(): CommandOptionReturn; export declare function String(opts: StringPositionalFlags & { required: false; }): CommandOptionReturn; export declare function String(opts: StringPositionalFlags): CommandOptionReturn; /** * Used to annotate string options. Such options will be typed as strings * unless they are provided a schema, which will then be used for coercion. * * @example * --foo=hello --bar world * ► {"foo": "hello", "bar": "world"} */ export declare function String(descriptor: string, opts: StringOptionNoBoolean & { required: true; }): CommandOptionReturn>; export declare function String(descriptor: string, opts?: StringOptionNoBoolean): CommandOptionReturn | undefined>; export declare function String(descriptor: string, initialValue: WithArity, opts?: Omit, 'required'>): CommandOptionReturn>; export declare function String(descriptor: string, opts: StringOptionTolerateBoolean & { required: true; }): CommandOptionReturn; export declare function String(descriptor: string, opts: StringOptionTolerateBoolean): CommandOptionReturn; export declare function String(descriptor: string, initialValue: string | boolean, opts: Omit, 'required'>): CommandOptionReturn;