Expose getSelectionPosition and select APIs instead
This commit is contained in:
Vendored
+38
-8
@@ -670,25 +670,30 @@ declare module 'xterm' {
|
||||
*/
|
||||
hasSelection(): boolean;
|
||||
|
||||
/**
|
||||
* Selects text within the terminal.
|
||||
* @param column The column the selection starts at..
|
||||
* @param row The row the selection starts at.
|
||||
* @param length The length of the selection.
|
||||
*/
|
||||
setSelection(column: number, row: number, length: number): void;
|
||||
|
||||
/**
|
||||
* Gets the terminal's current selection, this is useful for implementing
|
||||
* copy behavior outside of xterm.js.
|
||||
*/
|
||||
getSelection(): string;
|
||||
|
||||
/**
|
||||
* Gets the selection position or undefined if there is no selection.
|
||||
*/
|
||||
getSelectionPosition(): ISelectionPosition | undefined;
|
||||
|
||||
/**
|
||||
* Clears the current terminal selection.
|
||||
*/
|
||||
clearSelection(): void;
|
||||
|
||||
/**
|
||||
* Selects text within the terminal.
|
||||
* @param column The column the selection starts at..
|
||||
* @param row The row the selection starts at.
|
||||
* @param length The length of the selection.
|
||||
*/
|
||||
select(column: number, row: number, length: number): void;
|
||||
|
||||
/**
|
||||
* Selects all text within the terminal.
|
||||
*/
|
||||
@@ -872,6 +877,31 @@ declare module 'xterm' {
|
||||
static applyAddon(addon: any): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object representing a selecrtion within the terminal.
|
||||
*/
|
||||
interface ISelectionPosition {
|
||||
/**
|
||||
* The start column of the selection.
|
||||
*/
|
||||
startColumn: number;
|
||||
|
||||
/**
|
||||
* The start row of the selection.
|
||||
*/
|
||||
startRow: number;
|
||||
|
||||
/**
|
||||
* The end column of the selection.
|
||||
*/
|
||||
endColumn: number;
|
||||
|
||||
/**
|
||||
* The end row of the selection.
|
||||
*/
|
||||
endRow: number;
|
||||
}
|
||||
|
||||
interface IBuffer {
|
||||
/**
|
||||
* The y position of the cursor. This ranges between `0` (when the
|
||||
|
||||
Reference in New Issue
Block a user