Skip to content

Commit 96a3be3

Browse files
committed
polish docs
1 parent 75e5cc1 commit 96a3be3

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

addons/addon-progress/README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ progressAddon.onChange({state, value}: IProgress) => {
2424
// state: 0-4 integer (see below for meaning)
2525
// value: 0-100 integer (percent value)
2626

27-
// do your visualisation based on state/progress here
27+
// do your visualisation based on state/value here
2828
...
2929
});
3030
```
@@ -65,16 +65,3 @@ The addon resolves most of those semantic nuances and will provide these ready-t
6565
- For the indeterminate state (3) a value notion will be ignored.
6666
It still emits the value as `{state: 3, value: lastValue}`. Keep in mind not use that value while
6767
that state is active, as a task might have entered that state without a proper reset at the beginning.
68-
69-
### API
70-
71-
The addon exposes the following API endpoints:
72-
- `public readonly onChange: IEvent<IProgress>` \
73-
Event to register your actual progress handler, where you gonna do the progress visualisation.
74-
The handler will get called upon valid progress sequences with a progress argument as `({state, value}) => {}`.
75-
- `public progress: IProgress`
76-
A getter/setter for the current progress information. Can be used to read the last seen progress information.
77-
This can also be used to clean up stuck progress indicators by setting the value back to initial, e.g.:
78-
```typescript
79-
progressAddon.progress = {state: 0, value: 0};
80-
```

addons/addon-progress/typings/addon-progress.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ declare module '@xterm/addon-progress' {
3737

3838
/**
3939
* Gets or sets the current progress tracked by the addon.
40+
* This can also be used to reset a stuck progress indicator
41+
* back to initial with `{state: 0, value: 0}`
42+
* or to restore an indicator.
4043
*/
4144
public progress: IProgress;
4245
}

0 commit comments

Comments
 (0)