@@ -25,11 +25,18 @@ npm i -g code-genius
25
25
| cup | --ignore <match > | 清理运行时生成的文件 |
26
26
| ihooks | -- | 使用且有修改 git-simple-hooks 后需要重新初始化 |
27
27
28
- ## 编程方式
28
+ ## API
29
29
30
- | API | 参数 | 返回 |
31
- | ----------------------------------- | -------------------------------------------------------------------------------------- | --------------- |
32
- | ` gitCommit(types, scopes, options) ` | ` types: Array<CommitType> ` , ` scopes: Array<CommitScope> ` , ` options: GitCommitOptions) ` | ` Promise<void> ` |
30
+ | 序号 | API | 参数 | 返回 |
31
+ | ---- | ----------------------------------- | -------------------------------------------------------------------------------------- | --------------- |
32
+ | 1 | ` gitCommit(types, scopes, options) ` | ` types: Array<CommitType> ` , ` scopes: Array<CommitScope> ` , ` options: GitCommitOptions) ` | ` Promise<void> ` |
33
+ | 2 | ` gitCommitVerify() ` | ` -- ` | ` Promise<void> ` |
34
+ | 3 | ` cleanUp(paths) ` | ` paths: string[] ` | ` Promise<void> ` |
35
+ | 4 | ` gitInitSimpleHooks(cwd) ` | ` cwd?: string ` | ` Promise<void> ` |
36
+
37
+ ## API 示例
38
+
39
+ gitCommit()
33
40
34
41
``` typescript
35
42
// ./index.ts
@@ -41,11 +48,7 @@ gitCommit(gitCommitTypes, gitCommitScopes, { enableEmoji: true });
41
48
npx esno index .ts
42
49
```
43
50
44
- 2 . ` gitCommitVerify: () => Promise<void> `
45
-
46
- | API | 参数 | 返回 |
47
- | ------------------- | ---- | --------------- |
48
- | ` gitCommitVerify() ` | ` -- ` | ` Promise<void> ` |
51
+ gitCommitVerify()
49
52
50
53
``` typescript
51
54
// ./index.ts
@@ -57,9 +60,7 @@ gitCommitVerify();
57
60
npx esno index .ts
58
61
```
59
62
60
- | API | 参数 | 返回 |
61
- | ---------------- | ----------------- | --------------- |
62
- | ` cleanUp(paths) ` | ` paths: string[] ` | ` Promise<void> ` |
63
+ cleanUp()
63
64
64
65
``` typescript
65
66
// ./index.ts
@@ -71,9 +72,7 @@ cleanUp(cleanUpDirs);
71
72
npx esno index .ts
72
73
```
73
74
74
- | API | 参数 | 返回 |
75
- | ------------------------- | -------------- | --------------- |
76
- | ` gitInitSimpleHooks(cwd) ` | ` cwd?: string ` | ` Promise<void> ` |
75
+ gitInitSimpleHooks()
77
76
78
77
``` typescript
79
78
// ./index.ts
0 commit comments