-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
keindev
committed
Nov 26, 2021
1 parent
2ed0d90
commit e0692a3
Showing
4 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Task | ||
|
||
Entity for managing a task - includes all child objects (informational messages, errors, progress bars, and tasks) | ||
|
||
## Constructor | ||
|
||
```typescript | ||
new Task(text?: string, options?: ITaskOptions) | ||
``` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :------------------ | :-------- | :-------------------------------------------------------- | | ||
| `text` | _string_ | Task text message | | ||
| `options.autoClear` | _boolean_ | Removes all subtasks and progress bars after complete | | ||
| `options.status` | _enum_ | New subtask status `(Completed, Failed, Pending,Skipped`) | | ||
|
||
## Methods | ||
|
||
### add | ||
|
||
Create new subtask | ||
|
||
### bar | ||
|
||
Adds a new progress bar. Returns a progress bar object | ||
|
||
### clear | ||
|
||
Removes all subtasks and progress bars | ||
|
||
### complete | ||
|
||
Complete task | ||
|
||
### error | ||
|
||
Add new task error | ||
|
||
### fail | ||
|
||
Fail task | ||
|
||
### log | ||
|
||
Add log message | ||
|
||
### render | ||
|
||
Render task output | ||
|
||
### skip | ||
|
||
Skip task | ||
|
||
### update | ||
|
||
Update task text | ||
|
||
### warn | ||
|
||
Add task warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# TaskTree | ||
|
||
Singleton to manage the task tree | ||
|
||
## Methods | ||
|
||
### add | ||
|
||
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 | ||
|
||
### exit | ||
|
||
Force the process to exit (see process.exit). Do nothing in "silent mode" | ||
|
||
### fail | ||
|
||
Fail active task or adds a new subtask and call fail on it | ||
|
||
### render | ||
|
||
Render a task tree into a `string[]`. Returns strings with tasks hierarchy | ||
|
||
### start | ||
|
||
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 | ||
|
||
### stop | ||
|
||
Stop output a task tree in a terminal | ||
|
||
### add | ||
|
||
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 | ||
|
||
### fail | ||
|
||
Fail active task or adds a new subtask and call fail on it | ||
|
||
### tree | ||
|
||
Method to get the object to control the tree (with [Theme](Theme.md)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters