Skip to content

Commit 2af170d

Browse files
authored
Merge pull request #5317 from tabarra/docs/registerMarker-tip
docs: added usage tip for registerMarker()
2 parents 21387ec + 78fbae3 commit 2af170d

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

typings/xterm-headless.d.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -833,21 +833,31 @@ declare module '@xterm/headless' {
833833

834834
/**
835835
* Write data to the terminal.
836+
*
837+
* Note that the change will not be reflected in the {@link buffer}
838+
* immediately as the data is processed asynchronously. Provide a
839+
* {@link callback} to know when the data was processed.
836840
* @param data The data to write to the terminal. This can either be raw
837841
* bytes given as Uint8Array from the pty or a string. Raw bytes will always
838842
* be treated as UTF-8 encoded, string data as UTF-16.
839843
* @param callback Optional callback that fires when the data was processed
840-
* by the parser.
844+
* by the parser. This callback must be provided and awaited in order for
845+
* {@link buffer} to reflect the change in the write.
841846
*/
842847
write(data: string | Uint8Array, callback?: () => void): void;
843848

844849
/**
845850
* Writes data to the terminal, followed by a break line character (\n).
851+
*
852+
* Note that the change will not be reflected in the {@link buffer}
853+
* immediately as the data is processed asynchronously. Provide a
854+
* {@link callback} to know when the data was processed.
846855
* @param data The data to write to the terminal. This can either be raw
847856
* bytes given as Uint8Array from the pty or a string. Raw bytes will always
848857
* be treated as UTF-8 encoded, string data as UTF-16.
849858
* @param callback Optional callback that fires when the data was processed
850-
* by the parser.
859+
* by the parser. This callback must be provided and awaited in order for
860+
* {@link buffer} to reflect the change in the write.
851861
*/
852862
writeln(data: string | Uint8Array, callback?: () => void): void;
853863

typings/xterm.d.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -1265,21 +1265,31 @@ declare module '@xterm/xterm' {
12651265

12661266
/**
12671267
* Write data to the terminal.
1268+
*
1269+
* Note that the change will not be reflected in the {@link buffer}
1270+
* immediately as the data is processed asynchronously. Provide a
1271+
* {@link callback} to know when the data was processed.
12681272
* @param data The data to write to the terminal. This can either be raw
12691273
* bytes given as Uint8Array from the pty or a string. Raw bytes will always
12701274
* be treated as UTF-8 encoded, string data as UTF-16.
12711275
* @param callback Optional callback that fires when the data was processed
1272-
* by the parser.
1276+
* by the parser. This callback must be provided and awaited in order for
1277+
* {@link buffer} to reflect the change in the write.
12731278
*/
12741279
write(data: string | Uint8Array, callback?: () => void): void;
12751280

12761281
/**
12771282
* Writes data to the terminal, followed by a break line character (\n).
1283+
*
1284+
* Note that the change will not be reflected in the {@link buffer}
1285+
* immediately as the data is processed asynchronously. Provide a
1286+
* {@link callback} to know when the data was processed.
12781287
* @param data The data to write to the terminal. This can either be raw
12791288
* bytes given as Uint8Array from the pty or a string. Raw bytes will always
12801289
* be treated as UTF-8 encoded, string data as UTF-16.
12811290
* @param callback Optional callback that fires when the data was processed
1282-
* by the parser.
1291+
* by the parser. This callback must be provided and awaited in order for
1292+
* {@link buffer} to reflect the change in the write.
12831293
*/
12841294
writeln(data: string | Uint8Array, callback?: () => void): void;
12851295

0 commit comments

Comments
 (0)