From 8327f3e6f85a71c3e0d6512dc853cde43b6fc1d6 Mon Sep 17 00:00:00 2001 From: Lucian Buzzo Date: Thu, 15 Jun 2017 16:02:31 +0100 Subject: [PATCH] - Add missing attributes `cols` and `rows` - Add missing secondary parameter `focus` to `.open` as per docs ( https://xtermjs.org/docs/api/terminal/#openparent-focus ) - Add optional addon method `.fit()` --- types/xterm/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/types/xterm/index.d.ts b/types/xterm/index.d.ts index 603e8335c1..37bc104747 100644 --- a/types/xterm/index.d.ts +++ b/types/xterm/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for xterm.js 2.0.1 // Project: https://github.com/sourcelair/xterm.js/ // Definitions by: Steven Silvester +// Lucian Buzzo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -8,6 +9,10 @@ */ interface Xterm { + cols: number; + + rows: number; + options: Xterm.IOptions; element: HTMLElement; @@ -30,7 +35,7 @@ interface Xterm { off(event: string, callback: (...args: any[]) => void): void; - open(parent: HTMLElement): void; + open(parent: HTMLElement, focus?: boolean): void; refresh(start: number, end: number, queue?: boolean): void; @@ -45,6 +50,8 @@ interface Xterm { write(text: string): void; writeln(text: string): void; + + fit?(): void; }