@done-coding/cli-utils 0.7.3-alpha.0 → 0.7.4-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/types/index.d.ts +13 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-utils",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4-alpha.0",
|
|
4
4
|
"description": "cli utils",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"semver": "^7.5.4",
|
|
68
68
|
"yargs": "^17.7.2"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "a1acffae69586b12aec17d0ad76d6f75ad1d0ca0"
|
|
71
71
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare const checkCurrentIsRebasing: (rootDir: string) => boolean;
|
|
|
45
45
|
export declare type CliHandlerArgv<O> = ArgumentsCamelCase<O> | O;
|
|
46
46
|
|
|
47
47
|
/** cli 信息 */
|
|
48
|
-
export declare interface CliInfo {
|
|
48
|
+
export declare interface CliInfo<O extends Record<string, any> = Record<string, any>, P extends Record<string, any> = Record<string, any>> {
|
|
49
49
|
/** 命令 */
|
|
50
50
|
command?: string;
|
|
51
51
|
/** 用法 */
|
|
@@ -57,15 +57,11 @@ export declare interface CliInfo {
|
|
|
57
57
|
/** 必传命令数 */
|
|
58
58
|
demandCommandCount?: number;
|
|
59
59
|
/** 选项 */
|
|
60
|
-
options?:
|
|
61
|
-
[key in string]: YargsOptions;
|
|
62
|
-
};
|
|
60
|
+
options?: YargsOptionsRecord<O>;
|
|
63
61
|
/** 子命令 */
|
|
64
62
|
subcommands?: CommandModule[];
|
|
65
63
|
/** 位置信息 */
|
|
66
|
-
positionals?:
|
|
67
|
-
[key in string]: Parameters<typeof yargs.positional>[1];
|
|
68
|
-
};
|
|
64
|
+
positionals?: YargsPositionalsRecord<P>;
|
|
69
65
|
/** 处理函数 */
|
|
70
66
|
handler?: CommandModule["handler"];
|
|
71
67
|
/** 根命令 */
|
|
@@ -522,6 +518,16 @@ export { YargsArgv }
|
|
|
522
518
|
|
|
523
519
|
export { YargsOptions }
|
|
524
520
|
|
|
521
|
+
/** yargs options 记录 */
|
|
522
|
+
export declare type YargsOptionsRecord<T extends Record<string, any>> = {
|
|
523
|
+
[key in keyof T]: YargsOptions;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/** yargs 位置参数 */
|
|
527
|
+
export declare type YargsPositionalsRecord<T extends Record<string, any>> = {
|
|
528
|
+
[key in keyof T]: Parameters<typeof yargs.positional>[1];
|
|
529
|
+
};
|
|
530
|
+
|
|
525
531
|
|
|
526
532
|
export * from "json5";
|
|
527
533
|
|