Skip to content

Commit e0a3651

Browse files
committed
docs(docs): 更新使用文档
1 parent a3e8374 commit e0a3651

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ npm i -g code-genius
2525
| cup | --ignore <match> | 清理运行时生成的文件 |
2626
| ihooks | -- | 使用且有修改 git-simple-hooks 后需要重新初始化 |
2727

28-
## 编程方式
28+
## API
2929

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()
3340

3441
```typescript
3542
// ./index.ts
@@ -41,11 +48,7 @@ gitCommit(gitCommitTypes, gitCommitScopes, { enableEmoji: true });
4148
npx esno index.ts
4249
```
4350

44-
2. `gitCommitVerify: () => Promise<void>`
45-
46-
| API | 参数 | 返回 |
47-
| ------------------- | ---- | --------------- |
48-
| `gitCommitVerify()` | `--` | `Promise<void>` |
51+
gitCommitVerify()
4952

5053
```typescript
5154
// ./index.ts
@@ -57,9 +60,7 @@ gitCommitVerify();
5760
npx esno index.ts
5861
```
5962

60-
| API | 参数 | 返回 |
61-
| ---------------- | ----------------- | --------------- |
62-
| `cleanUp(paths)` | `paths: string[]` | `Promise<void>` |
63+
cleanUp()
6364

6465
```typescript
6566
// ./index.ts
@@ -71,9 +72,7 @@ cleanUp(cleanUpDirs);
7172
npx esno index.ts
7273
```
7374

74-
| API | 参数 | 返回 |
75-
| ------------------------- | -------------- | --------------- |
76-
| `gitInitSimpleHooks(cwd)` | `cwd?: string` | `Promise<void>` |
75+
gitInitSimpleHooks()
7776

7877
```typescript
7978
// ./index.ts

0 commit comments

Comments
 (0)