]> git.proxmox.com Git - mirror_xterm.js.git/blob - src/Interfaces.ts
Add more CSI codes
[mirror_xterm.js.git] / src / Interfaces.ts
1 /**
2 * @license MIT
3 */
4
5 export interface IBrowser {
6 isNode: boolean;
7 userAgent: string;
8 platform: string;
9 isFirefox: boolean;
10 isMSIE: boolean;
11 isMac: boolean;
12 isIpad: boolean;
13 isIphone: boolean;
14 isMSWindows: boolean;
15 }
16
17 export interface ITerminal {
18 element: HTMLElement;
19 rowContainer: HTMLElement;
20 textarea: HTMLTextAreaElement;
21 ydisp: number;
22 lines: string[];
23 rows: number;
24 browser: IBrowser;
25
26 /**
27 * Emit the 'data' event and populate the given data.
28 * @param data The data to populate in the event.
29 */
30 handler(data: string);
31 on(event: string, callback: () => void);
32 scrollDisp(disp: number, suppressScrollEvent: boolean);
33 cancel(ev: Event, force?: boolean);
34 }
35
36 /**
37 * Handles actions generated by the parser.
38 */
39 export interface IInputHandler {
40 /** C0 BEL */ bell(): void;
41 /** C0 LF */ lineFeed(): void;
42 /** C0 CR */ carriageReturn(): void;
43 /** C0 BS */ backspace(): void;
44 /** C0 HT */ tab(): void;
45 /** C0 SO */ shiftOut(): void;
46 /** C0 SI */ shiftIn(): void;
47 /** CSI @ */ insertChars(params);
48 /** CSI A */ cursorUp(params: number[]): void;
49 /** CSI B */ cursorDown(params: number[]): void;
50 /** CSI C */ cursorForward(params: number[]): void;
51 /** CSI D */ cursorBackward(params: number[]): void;
52 /** CSI E */ cursorNextLine(params: number[]): void;
53 /** CSI F */ cursorPrecedingLine(params: number[]): void;
54 /** CSI G */ cursorCharAbsolute(params: number[]): void;
55 /** CSI H */ cursorPosition(params: number[]): void;
56 /** CSI J */ eraseInDisplay(params: number[]): void;
57 /** CSI K */ eraseInLine(params: number[]): void;
58 /** CSI L */ insertLines(params: number[]): void;
59 /** CSI M */ deleteLines(params: number[]): void;
60 /** CSI P */ deleteChars(params: number[]): void;
61 /** CSI X */ eraseChars(params: number[]): void;
62 /** CSI ` */ charPosAbsolute(params: number[]): void;
63 /** CSI a */ HPositionRelative(params: number[]): void;
64 /** CSI c */ sendDeviceAttributes(params: number[]): void;
65 /** CSI d */ linePosAbsolute(params: number[]): void;
66 /** CSI e */ VPositionRelative(params: number[]): void;
67 /** CSI f */ HVPosition(params: number[]): void;
68 /** CSI h */ setMode(params: number[]): void;
69 /** CSI m */ charAttributes(params: number[]): void;
70 /** CSI n */ deviceStatus(params: number[]): void;
71 }