Vendored
+80
@@ -347,6 +347,13 @@ declare module 'xterm' {
|
||||
*/
|
||||
readonly cols: number;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) The terminal's current buffer, note that this might be
|
||||
* either the normal buffer or the alt buffer depending on what's running in
|
||||
* the terminal.
|
||||
*/
|
||||
readonly buffer: IBuffer;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
|
||||
* buffer is active this will always return [].
|
||||
@@ -772,4 +779,77 @@ declare module 'xterm' {
|
||||
*/
|
||||
static applyAddon(addon: any): void;
|
||||
}
|
||||
|
||||
interface IBuffer {
|
||||
/**
|
||||
* The y position of the cursor. This ranges between `0` (when the
|
||||
* cursor is at baseY) and `Terminal.rows - 1` (when the cursor is on the
|
||||
* last row).
|
||||
*/
|
||||
readonly cursorY: number;
|
||||
|
||||
/**
|
||||
* The x position of the cursor. This ranges between `0` (left side) and
|
||||
* `Terminal.cols - 1` (right side).
|
||||
*/
|
||||
readonly cursorX: number;
|
||||
|
||||
/**
|
||||
* The line within the buffer where the top of the viewport is.
|
||||
*/
|
||||
readonly viewportY: number;
|
||||
|
||||
/**
|
||||
* The line within the buffer where the top of the bottom page is (when
|
||||
* fully scrolled down);
|
||||
*/
|
||||
readonly baseY: number;
|
||||
|
||||
/**
|
||||
* The amount of lines in the buffer.
|
||||
*/
|
||||
readonly length: number;
|
||||
|
||||
/**
|
||||
* Gets a line from the buffer.
|
||||
*
|
||||
* @param y The line index to get.
|
||||
*/
|
||||
getLine(y: number): IBufferLine;
|
||||
}
|
||||
|
||||
interface IBufferLine {
|
||||
/**
|
||||
* Whether the line is wrapped from the previous line.
|
||||
*/
|
||||
readonly isWrapped: boolean;
|
||||
|
||||
/**
|
||||
* Gets a cell from the line.
|
||||
*
|
||||
* @param x The character index to get.
|
||||
*/
|
||||
getCell(x: number): IBufferCell;
|
||||
|
||||
/**
|
||||
* Gets the line
|
||||
*/
|
||||
translateToString(trimRight: boolean, startColumn: number, endColumn: number): string;
|
||||
}
|
||||
|
||||
interface IBufferCell {
|
||||
/**
|
||||
* The character within the cell.
|
||||
*/
|
||||
readonly char: string;
|
||||
|
||||
/**
|
||||
* The width of the character. Some examples:
|
||||
*
|
||||
* - This is `1` for most cells.
|
||||
* - This is `2` for wide character like CJK glyphs.
|
||||
* - This is `0` for cells immediately following cells with a width of `2`.
|
||||
*/
|
||||
readonly width: number;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user