Skip to content

Commit e0692a3

Browse files
author
keindev
committed
docs(api): restore docs
1 parent 2ed0d90 commit e0692a3

File tree

4 files changed

+111
-5
lines changed

4 files changed

+111
-5
lines changed

docs/api/ProgressBar.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ Increases current progress on step value
6363

6464
#### Parameters
6565

66-
| Name | Type | Description |
67-
| :-------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
68-
| `step?` | _number_ | Value by which the current progress will increase |
69-
| `tokens?` | [_IProgressBarToken_](../interfaces/progressbar.iprogressbartoken.md) | Add custom tokens by adding a `{'name': value}` object parameter to your method |
66+
| Name | Type | Description |
67+
| :-------- | :------------------ | :-------------------------------------------------------------------------------------- |
68+
| `step?` | _number_ | Value by which the current progress will increase |
69+
| `tokens?` | _IProgressBarToken_ | Add custom tokens by adding a `{[key: string]: string}` object parameter to your method |
7070

7171
#### Example
7272

7373
```javascript
7474
const bar = new Progress(':bar template with custom :token');
7575

76-
bar.tick(10, { token: 100 });
76+
bar.tick(10, { token: `100` });
7777
```

docs/api/Task.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Task
2+
3+
Entity for managing a task - includes all child objects (informational messages, errors, progress bars, and tasks)
4+
5+
## Constructor
6+
7+
```typescript
8+
new Task(text?: string, options?: ITaskOptions)
9+
```
10+
11+
#### Parameters
12+
13+
| Name | Type | Description |
14+
| :------------------ | :-------- | :-------------------------------------------------------- |
15+
| `text` | _string_ | Task text message |
16+
| `options.autoClear` | _boolean_ | Removes all subtasks and progress bars after complete |
17+
| `options.status` | _enum_ | New subtask status `(Completed, Failed, Pending,Skipped`) |
18+
19+
## Methods
20+
21+
### add
22+
23+
Create new subtask
24+
25+
### bar
26+
27+
Adds a new progress bar. Returns a progress bar object
28+
29+
### clear
30+
31+
Removes all subtasks and progress bars
32+
33+
### complete
34+
35+
Complete task
36+
37+
### error
38+
39+
Add new task error
40+
41+
### fail
42+
43+
Fail task
44+
45+
### log
46+
47+
Add log message
48+
49+
### render
50+
51+
Render task output
52+
53+
### skip
54+
55+
Skip task
56+
57+
### update
58+
59+
Update task text
60+
61+
### warn
62+
63+
Add task warning

docs/api/TaskTree.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# TaskTree
2+
3+
Singleton to manage the task tree
4+
5+
## Methods
6+
7+
### add
8+
9+
Adds a new task to the task tree. If there are active tasks, add a new one as a subtask - to the last subtask of the first active task
10+
11+
### exit
12+
13+
Force the process to exit (see process.exit). Do nothing in "silent mode"
14+
15+
### fail
16+
17+
Fail active task or adds a new subtask and call fail on it
18+
19+
### render
20+
21+
Render a task tree into a `string[]`. Returns strings with tasks hierarchy
22+
23+
### start
24+
25+
Starts output a task tree in a terminal at a defined interval. In “silent mode” - the task tree only collects tasks and is not output it in a terminal
26+
27+
### stop
28+
29+
Stop output a task tree in a terminal
30+
31+
### add
32+
33+
Adds a new task to the task tree. If there are active tasks, add a new one as a subtask - to the last subtask of the first active task
34+
35+
### fail
36+
37+
Fail active task or adds a new subtask and call fail on it
38+
39+
### tree
40+
41+
Method to get the object to control the tree (with [Theme](Theme.md))

docs/api/Theme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ All theme options is object with several fields:
3333
| list || `#4285f4` - symbol || list symbol |
3434
| dim || `#838584` - symbol, bar | `-` | dim color |
3535

36+
> If you use a gradient fill for the progress bar - the color will change from `active` to `success`
37+
3638
```javascript
3739
const theme = {
3840
default: '#ffffff',

0 commit comments

Comments
 (0)