1 | export declare type ParseFn<T> = (input: string) => T;
|
2 | export interface IArg<T = string> {
|
3 | name: string;
|
4 | description?: string;
|
5 | required?: boolean;
|
6 | hidden?: boolean;
|
7 | parse?: ParseFn<T>;
|
8 | default?: T | (() => T);
|
9 | options?: string[];
|
10 | }
|
11 | export interface ArgBase<T> {
|
12 | name?: string;
|
13 | description?: string;
|
14 | hidden?: boolean;
|
15 | parse: ParseFn<T>;
|
16 | default?: T | (() => T);
|
17 | input?: string;
|
18 | options?: string[];
|
19 | }
|
20 | export declare type RequiredArg<T> = ArgBase<T> & {
|
21 | required: true;
|
22 | value: T;
|
23 | };
|
24 | export declare type OptionalArg<T> = ArgBase<T> & {
|
25 | required: false;
|
26 | value?: T;
|
27 | };
|
28 | export declare type Arg<T> = RequiredArg<T> | OptionalArg<T>;
|
29 | export declare function newArg<T>(arg: IArg<T> & {
|
30 | Parse: ParseFn<T>;
|
31 | }): Arg<T>;
|
32 | export declare function newArg(arg: IArg): Arg<string>;
|
33 | export interface Output {
|
34 | [name: string]: any;
|
35 | }
|
36 | export declare type Input = IArg<any>[];
|
37 |
|
\ | No newline at end of file |