1 | export declare type IDescribeArgs<P = {}> = {
|
2 | title: string;
|
3 | } & Partial<ICommand<P>>;
|
4 | export declare type ICommand<P = {}> = {
|
5 | title: string;
|
6 | handler: CommandHandler<P>;
|
7 | children: ICommand[];
|
8 | };
|
9 | export declare type ICommandBuilder<P = {}> = ICommand & {
|
10 | length: number;
|
11 | children: ICommandBuilder[];
|
12 | add(title: string, handler?: CommandHandler<P>): ICommandBuilder<P>;
|
13 | add(args: IDescribeArgs): ICommandBuilder;
|
14 | toObject(): ICommand<P>;
|
15 | clone(options?: {
|
16 | deep?: boolean;
|
17 | }): ICommandBuilder<P>;
|
18 | };
|
19 | export declare type CommandHandler<P = {}> = (e: ICommandHandlerArgs<P>) => any;
|
20 | export declare type ICommandHandlerArgs<P = {}> = {
|
21 | props: P;
|
22 | get<K extends keyof P>(key: K): P[K];
|
23 | set<K extends keyof P>(key: K, value: P[K]): ICommandHandlerArgs<P>;
|
24 | clear: () => ICommandHandlerArgs<P>;
|
25 | };
|