mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
8803721f3d
* Move to TypeScript from legacy JavaScript * Add support of xterm.js * Hterm is still available for backward compatibility
48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
export interface Terminal {
|
|
io: IO;
|
|
onTerminalReady: () => void;
|
|
|
|
getPrefs(): Prefs;
|
|
decorate(HTMLElement);
|
|
installKeyboard(): void;
|
|
uninstallKeyboard(): void;
|
|
setWindowTitle(title: string): void;
|
|
reset(): void;
|
|
softReset(): void;
|
|
}
|
|
|
|
export interface TerminalConstructor {
|
|
new (): Terminal;
|
|
(): Terminal;
|
|
}
|
|
|
|
|
|
export interface IO {
|
|
writeUTF8: ((data: string) => void);
|
|
writeUTF16: ((data: string) => void);
|
|
onVTKeystroke: ((data: string) => void) | null;
|
|
sendString: ((data: string) => void) | null;
|
|
onTerminalResize: ((columns: number, rows: number) => void) | null;
|
|
|
|
push(): IO;
|
|
writeUTF(data: string);
|
|
showOverlay(message: string, timeout: number | null);
|
|
}
|
|
|
|
export interface Prefs {
|
|
set(key: string, value: string): void;
|
|
}
|
|
|
|
export interface Storage {
|
|
}
|
|
|
|
export var Terminal: TerminalConstructor;
|
|
|
|
// @TODO: is there better way?
|
|
// exported variables are forced to be read-protected.
|
|
declare global {
|
|
var hterm: {
|
|
defaultStorage: Storage;
|
|
};
|
|
}
|