@cloud-copilot/cli
Version:
A standardized library for CLI building TypeScript CLI applications
17 lines • 802 B
TypeScript
import { Argument, PerArgumentArgs, ValidatedValues } from './argument.js';
type SingleValueValidator<ValueType> = (rawValue: string) => Promise<ValidatedValues<ValueType>> | ValidatedValues<ValueType>;
type ArgumentWithDefault<ValueType> = {
defaultValue: ValueType;
} & PerArgumentArgs;
type ArgumentWithoutDefault<ValueType> = {
defaultValue?: undefined;
} & PerArgumentArgs;
/**
* Creates a single value argument factory for a specific type
*/
export declare function singleValueArgument<ValueType>(validator: SingleValueValidator<ValueType>, descriptionSuffix?: string): {
(options: ArgumentWithDefault<ValueType>): Argument<ValueType>;
(options: ArgumentWithoutDefault<ValueType>): Argument<ValueType | undefined>;
};
export {};
//# sourceMappingURL=singleValueArgument.d.ts.map