| 1 |
/** |
| 2 |
* Copyright (c) 2017 The xterm.js authors. All rights reserved. |
| 3 |
* @license MIT |
| 4 |
*/ |
| 5 |
|
| 6 |
import { Terminal, ITerminalAddon, IEvent } from '@xterm/xterm'; |
| 7 |
|
| 8 |
declare module '@xterm/addon-webgl' { |
| 9 |
/** |
| 10 |
* An xterm.js addon that provides hardware-accelerated rendering functionality via WebGL. |
| 11 |
*/ |
| 12 |
export class WebglAddon implements ITerminalAddon { |
| 13 |
public textureAtlas?: HTMLCanvasElement; |
| 14 |
|
| 15 |
/** |
| 16 |
* An event that is fired when the renderer loses its canvas context. |
| 17 |
*/ |
| 18 |
public readonly onContextLoss: IEvent<void>; |
| 19 |
|
| 20 |
/** |
| 21 |
* An event that is fired when the texture atlas of the renderer changes. |
| 22 |
*/ |
| 23 |
public readonly onChangeTextureAtlas: IEvent<HTMLCanvasElement>; |
| 24 |
|
| 25 |
/** |
| 26 |
* An event that is fired when the a new page is added to the texture atlas. |
| 27 |
*/ |
| 28 |
public readonly onAddTextureAtlasCanvas: IEvent<HTMLCanvasElement>; |
| 29 |
|
| 30 |
/** |
| 31 |
* An event that is fired when the a page is removed from the texture atlas. |
| 32 |
*/ |
| 33 |
public readonly onRemoveTextureAtlasCanvas: IEvent<HTMLCanvasElement>; |
| 34 |
|
| 35 |
constructor(preserveDrawingBuffer?: boolean); |
| 36 |
|
| 37 |
/** |
| 38 |
* Activates the addon. |
| 39 |
* @param terminal The terminal the addon is being loaded in. |
| 40 |
*/ |
| 41 |
public activate(terminal: Terminal): void; |
| 42 |
|
| 43 |
/** |
| 44 |
* Disposes the addon. |
| 45 |
*/ |
| 46 |
public dispose(): void; |
| 47 |
|
| 48 |
/** |
| 49 |
* Clears the terminal's texture atlas and triggers a redraw. |
| 50 |
*/ |
| 51 |
public clearTextureAtlas(): void; |
| 52 |
} |
| 53 |
} |