@@ -833,21 +833,31 @@ declare module '@xterm/headless' {
833
833
834
834
/**
835
835
* 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.
836
840
* @param data The data to write to the terminal. This can either be raw
837
841
* bytes given as Uint8Array from the pty or a string. Raw bytes will always
838
842
* be treated as UTF-8 encoded, string data as UTF-16.
839
843
* @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.
841
846
*/
842
847
write ( data : string | Uint8Array , callback ?: ( ) => void ) : void ;
843
848
844
849
/**
845
850
* 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.
846
855
* @param data The data to write to the terminal. This can either be raw
847
856
* bytes given as Uint8Array from the pty or a string. Raw bytes will always
848
857
* be treated as UTF-8 encoded, string data as UTF-16.
849
858
* @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.
851
861
*/
852
862
writeln ( data : string | Uint8Array , callback ?: ( ) => void ) : void ;
853
863
0 commit comments