Polish API
This commit is contained in:
Vendored
+47
-45
@@ -387,10 +387,10 @@ declare module 'xterm' {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable various window manipulation and report features (CSI Ps ; Ps ; Ps t).
|
* Enable various window manipulation and report features (CSI Ps ; Ps ; Ps t).
|
||||||
*
|
*
|
||||||
* Most settings have no default implementation, as they heavily rely on
|
* Most settings have no default implementation, as they heavily rely on
|
||||||
* the embedding environment.
|
* the embedding environment.
|
||||||
*
|
*
|
||||||
* To implement a feature, create a custom CSI hook like this:
|
* To implement a feature, create a custom CSI hook like this:
|
||||||
* ```ts
|
* ```ts
|
||||||
* term.parser.addCsiHandler({final: 't'}, params => {
|
* term.parser.addCsiHandler({final: 't'}, params => {
|
||||||
@@ -403,8 +403,8 @@ declare module 'xterm' {
|
|||||||
* return false; // any Ps that was not handled
|
* return false; // any Ps that was not handled
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Note on security:
|
* Note on security:
|
||||||
* Most features are meant to deal with some information of the host machine
|
* Most features are meant to deal with some information of the host machine
|
||||||
* where the terminal runs on. This is seen as a security risk possibly leaking
|
* where the terminal runs on. This is seen as a security risk possibly leaking
|
||||||
* sensitive data of the host to the program in the terminal. Therefore all options
|
* sensitive data of the host to the program in the terminal. Therefore all options
|
||||||
@@ -413,18 +413,18 @@ declare module 'xterm' {
|
|||||||
*/
|
*/
|
||||||
export interface IWindowOptions {
|
export interface IWindowOptions {
|
||||||
/**
|
/**
|
||||||
* Ps=1 De-iconify window.
|
* Ps=1 De-iconify window.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
restoreWin?: boolean;
|
restoreWin?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=2 Iconify window.
|
* Ps=2 Iconify window.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
minimizeWin?: boolean;
|
minimizeWin?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=3 ; x ; y
|
* Ps=3 ; x ; y
|
||||||
* Move window to [x, y].
|
* Move window to [x, y].
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
setWinPosition?: boolean;
|
setWinPosition?: boolean;
|
||||||
@@ -432,17 +432,17 @@ declare module 'xterm' {
|
|||||||
* Ps = 4 ; height ; width
|
* Ps = 4 ; height ; width
|
||||||
* Resize the window to given `height` and `width` in pixels.
|
* Resize the window to given `height` and `width` in pixels.
|
||||||
* Omitted parameters should reuse the current height or width.
|
* Omitted parameters should reuse the current height or width.
|
||||||
* Zero parameters should use the display's height or width.
|
* Zero parameters should use the display's height or width.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
setWinSizePixels?: boolean;
|
setWinSizePixels?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=5 Raise the window to the front of the stacking order.
|
* Ps=5 Raise the window to the front of the stacking order.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
raiseWin?: boolean;
|
raiseWin?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=6 Lower the xterm window to the bottom of the stacking order.
|
* Ps=6 Lower the xterm window to the bottom of the stacking order.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
lowerWin?: boolean;
|
lowerWin?: boolean;
|
||||||
@@ -452,7 +452,7 @@ declare module 'xterm' {
|
|||||||
* Ps = 8 ; height ; width
|
* Ps = 8 ; height ; width
|
||||||
* Resize the text area to given height and width in characters.
|
* Resize the text area to given height and width in characters.
|
||||||
* Omitted parameters should reuse the current height or width.
|
* Omitted parameters should reuse the current height or width.
|
||||||
* Zero parameters use the display's height or width.
|
* Zero parameters use the display's height or width.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
setWinSizeChars?: boolean;
|
setWinSizeChars?: boolean;
|
||||||
@@ -460,81 +460,81 @@ declare module 'xterm' {
|
|||||||
* Ps=9 ; 0 Restore maximized window.
|
* Ps=9 ; 0 Restore maximized window.
|
||||||
* Ps=9 ; 1 Maximize window (i.e., resize to screen size).
|
* Ps=9 ; 1 Maximize window (i.e., resize to screen size).
|
||||||
* Ps=9 ; 2 Maximize window vertically.
|
* Ps=9 ; 2 Maximize window vertically.
|
||||||
* Ps=9 ; 3 Maximize window horizontally.
|
* Ps=9 ; 3 Maximize window horizontally.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
maximizeWin?: boolean;
|
maximizeWin?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=10 ; 0 Undo full-screen mode.
|
* Ps=10 ; 0 Undo full-screen mode.
|
||||||
* Ps=10 ; 1 Change to full-screen.
|
* Ps=10 ; 1 Change to full-screen.
|
||||||
* Ps=10 ; 2 Toggle full-screen.
|
* Ps=10 ; 2 Toggle full-screen.
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
fullscreenWin?: boolean;
|
fullscreenWin?: boolean;
|
||||||
/** Ps=11 Report xterm window state.
|
/** Ps=11 Report xterm window state.
|
||||||
* If the xterm window is non-iconified, it returns "CSI 1 t".
|
* If the xterm window is non-iconified, it returns "CSI 1 t".
|
||||||
* If the xterm window is iconified, it returns "CSI 2 t".
|
* If the xterm window is iconified, it returns "CSI 2 t".
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
getWinState?: boolean;
|
getWinState?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=13 Report xterm window position. Result is "CSI 3 ; x ; y t".
|
* Ps=13 Report xterm window position. Result is "CSI 3 ; x ; y t".
|
||||||
* Ps=13 ; 2 Report xterm text-area position. Result is "CSI 3 ; x ; y t".
|
* Ps=13 ; 2 Report xterm text-area position. Result is "CSI 3 ; x ; y t".
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
getWinPosition?: boolean;
|
getWinPosition?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=14 Report xterm text area size in pixels. Result is "CSI 4 ; height ; width t".
|
* Ps=14 Report xterm text area size in pixels. Result is "CSI 4 ; height ; width t".
|
||||||
* Ps=14 ; 2 Report xterm window size in pixels. Result is "CSI 4 ; height ; width t".
|
* Ps=14 ; 2 Report xterm window size in pixels. Result is "CSI 4 ; height ; width t".
|
||||||
* Has a default implementation.
|
* Has a default implementation.
|
||||||
*/
|
*/
|
||||||
getWinSizePixels?: boolean;
|
getWinSizePixels?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=15 Report size of the screen in pixels. Result is "CSI 5 ; height ; width t".
|
* Ps=15 Report size of the screen in pixels. Result is "CSI 5 ; height ; width t".
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
getScreenSizePixels?: boolean;
|
getScreenSizePixels?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=16 Report xterm character cell size in pixels. Result is "CSI 6 ; height ; width t".
|
* Ps=16 Report xterm character cell size in pixels. Result is "CSI 6 ; height ; width t".
|
||||||
* Has a default implementation.
|
* Has a default implementation.
|
||||||
*/
|
*/
|
||||||
getCellSizePixels?: boolean;
|
getCellSizePixels?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=18 Report the size of the text area in characters. Result is "CSI 8 ; height ; width t".
|
* Ps=18 Report the size of the text area in characters. Result is "CSI 8 ; height ; width t".
|
||||||
* Has a default implementation.
|
* Has a default implementation.
|
||||||
*/
|
*/
|
||||||
getWinSizeChars?: boolean;
|
getWinSizeChars?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=19 Report the size of the screen in characters. Result is "CSI 9 ; height ; width t".
|
* Ps=19 Report the size of the screen in characters. Result is "CSI 9 ; height ; width t".
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
getScreenSizeChars?: boolean;
|
getScreenSizeChars?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=20 Report xterm window's icon label. Result is "OSC L label ST".
|
* Ps=20 Report xterm window's icon label. Result is "OSC L label ST".
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
getIconTitle?: boolean;
|
getIconTitle?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=21 Report xterm window's title. Result is "OSC l label ST".
|
* Ps=21 Report xterm window's title. Result is "OSC l label ST".
|
||||||
* No default implementation.
|
* No default implementation.
|
||||||
*/
|
*/
|
||||||
getWinTitle?: boolean;
|
getWinTitle?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=22 ; 0 Save xterm icon and window title on stack.
|
* Ps=22 ; 0 Save xterm icon and window title on stack.
|
||||||
* Ps=22 ; 1 Save xterm icon title on stack.
|
* Ps=22 ; 1 Save xterm icon title on stack.
|
||||||
* Ps=22 ; 2 Save xterm window title on stack.
|
* Ps=22 ; 2 Save xterm window title on stack.
|
||||||
* All variants have a default implementation.
|
* All variants have a default implementation.
|
||||||
*/
|
*/
|
||||||
pushTitle?: boolean;
|
pushTitle?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps=23 ; 0 Restore xterm icon and window title from stack.
|
* Ps=23 ; 0 Restore xterm icon and window title from stack.
|
||||||
* Ps=23 ; 1 Restore xterm icon title from stack.
|
* Ps=23 ; 1 Restore xterm icon title from stack.
|
||||||
* Ps=23 ; 2 Restore xterm window title from stack.
|
* Ps=23 ; 2 Restore xterm window title from stack.
|
||||||
* All variants have a default implementation.
|
* All variants have a default implementation.
|
||||||
*/
|
*/
|
||||||
popTitle?: boolean;
|
popTitle?: boolean;
|
||||||
/**
|
/**
|
||||||
* Ps>=24 Resize to Ps lines (DECSLPP).
|
* Ps>=24 Resize to Ps lines (DECSLPP).
|
||||||
* DECSLPP is not implemented. This settings is also used to
|
* DECSLPP is not implemented. This settings is also used to
|
||||||
* enable / disable DECCOLM (earlier variant of DECSLPP).
|
* enable / disable DECCOLM (earlier variant of DECSLPP).
|
||||||
*/
|
*/
|
||||||
@@ -739,8 +739,9 @@ declare module 'xterm' {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* (EXPERIMENTAL) Registers a link provider, allowing a custom parser to
|
* (EXPERIMENTAL) Registers a link provider, allowing a custom parser to
|
||||||
* be used to match and handle links.
|
* be used to match and handle links. Multiple link providers can be used,
|
||||||
* @param linkProvider
|
* they will be asked in the order in which they are registered.
|
||||||
|
* @param linkProvider The link provider to use to detect links.
|
||||||
*/
|
*/
|
||||||
registerLinkProvider(linkProvider: ILinkProvider): IDisposable;
|
registerLinkProvider(linkProvider: ILinkProvider): IDisposable;
|
||||||
|
|
||||||
@@ -1081,79 +1082,80 @@ declare module 'xterm' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A custom link provider
|
* A custom link provider.
|
||||||
*/
|
*/
|
||||||
interface ILinkProvider {
|
interface ILinkProvider {
|
||||||
/**
|
/**
|
||||||
* Provides a link a buffer position
|
* Provides a link a buffer position
|
||||||
* @param position
|
* @param position The position of the buffer that is currently active.
|
||||||
* @param callback
|
* @param callback The callback to be fired with the resulting link or
|
||||||
|
* `undefined` when ready.
|
||||||
*/
|
*/
|
||||||
provideLink(position: IBufferCellPosition, callback: (link: ILink | undefined) => void): void;
|
provideLink(position: IBufferCellPosition, callback: (link: ILink | undefined) => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A link
|
* A link within the terminal.
|
||||||
*/
|
*/
|
||||||
interface ILink {
|
interface ILink {
|
||||||
/**
|
/**
|
||||||
* The buffer range of the link
|
* The buffer range of the link.
|
||||||
*/
|
*/
|
||||||
range: IBufferRange;
|
range: IBufferRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The url of the link
|
* The url of the link.
|
||||||
*/
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The show tooltip callback
|
* Called when the link's tooltip is ready to show.
|
||||||
* @param event
|
* @param event The mouse event triggering the callback.
|
||||||
* @param link
|
* @param link
|
||||||
*/
|
*/
|
||||||
showTooltip?(event: MouseEvent, link: string): void;
|
showTooltip?(event: MouseEvent, link: string): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The hide tooltip callback
|
* Called when the link's tooltip is ready to hide.
|
||||||
* @param event
|
* @param event The mouse event triggering the callback.
|
||||||
* @param link
|
* @param link
|
||||||
*/
|
*/
|
||||||
hideTooltip?(event: MouseEvent, link: string): void;
|
hideTooltip?(event: MouseEvent, link: string): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles when the link is opened
|
* Calls when the link is activated.
|
||||||
* @param event
|
* @param event The mouse event triggering the callback.
|
||||||
* @param link
|
* @param link
|
||||||
*/
|
*/
|
||||||
handle(event: MouseEvent, link: string): void;
|
handle(event: MouseEvent, link: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A range in the buffer
|
* A range within a buffer.
|
||||||
*/
|
*/
|
||||||
interface IBufferRange {
|
interface IBufferRange {
|
||||||
/**
|
/**
|
||||||
* The start position of the range
|
* The start position of the range.
|
||||||
*/
|
*/
|
||||||
start: IBufferCellPosition;
|
start: IBufferCellPosition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The end position of the range
|
* The end position of the range.
|
||||||
*/
|
*/
|
||||||
end: IBufferCellPosition;
|
end: IBufferCellPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A position in the buffer
|
* A position within a buffer.
|
||||||
*/
|
*/
|
||||||
interface IBufferCellPosition {
|
interface IBufferCellPosition {
|
||||||
/**
|
/**
|
||||||
* The x of the buffer position
|
* The x position within the buffer.
|
||||||
*/
|
*/
|
||||||
x: number;
|
x: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The y of the buffer position
|
* The y position within the buffer.
|
||||||
*/
|
*/
|
||||||
y: number;
|
y: number;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user