@@ -20,7 +20,7 @@ import { ProgressAddon } from '@xterm/addon-progress';
2020const terminal = new Terminal ();
2121const progressAddon = new ProgressAddon ();
2222terminal .loadAddon (progressAddon );
23- progressAddon .register (( state : number , value : number ) => {
23+ progressAddon .onChange ({ state , value }: IProgress ) => {
2424 // state: 0-4 integer (see below for meaning)
2525 // value: 0-100 integer (percent value)
2626
@@ -69,11 +69,10 @@ The addon resolves most of those semantic nuances and will provide these ready-t
6969### API
7070
7171The addon exposes the following API endpoints:
72- - ` public register(handler: ProgressHandler): IDisposable; ` \
73- Registers your actual progress handler, where you gonna do the visual progress visualisation.
74- The handler will get called upon valid progress sequences with 2 arguments as ` (state, value) => {} ` .
75- Returns a disposable to unregister the handler later on by calling its ` dispose() ` method.
76- - ` public progress: IProgress; `
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 `
7776 A getter/setter for the current progress information. Can be used to read the last seen progress information.
7877 This can also be used to clean up stuck progress indicators by setting the value back to initial, e.g.:
7978 ``` typescript
0 commit comments