From 37a1220ee724f2fb1f892b12af22db4b64f14dac Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 21 Dec 2017 13:59:27 -0800 Subject: [PATCH 1/3] Add applyAddon typings Part of #1018 See #1130 --- typings/xterm.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 97e4a4a3..77371f04 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -504,6 +504,6 @@ declare module 'xterm' { * available to all newly created Terminals. * @param addon The addon to load. */ - static loadAddon(addon: 'attach' | 'fit' | 'fullscreen' | 'search' | 'terminado' | 'winptyCompat'): void; + static applyAddon(addon: any): void; } } From 55f885809e23586e3dd09f2b637825d845c3e680 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 21 Dec 2017 15:18:03 -0800 Subject: [PATCH 2/3] Improve doc --- typings/xterm.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 77371f04..83199e08 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -500,9 +500,9 @@ declare module 'xterm' { reset(): void /** - * Loads an addon, attaching it to the Terminal prototype and making it - * available to all newly created Terminals. - * @param addon The addon to load. + * Applies an addon to the Terminal prototype, making it available to all + * newly created Terminals. + * @param addon The addon to apply. */ static applyAddon(addon: any): void; } From 5dc38008f364d662dd489078d84097da428f2f6a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 26 Dec 2017 02:43:28 -0800 Subject: [PATCH 3/3] Fix test --- fixtures/typings-test/typings-test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fixtures/typings-test/typings-test.ts b/fixtures/typings-test/typings-test.ts index cfad7b26..5a5f6c50 100644 --- a/fixtures/typings-test/typings-test.ts +++ b/fixtures/typings-test/typings-test.ts @@ -36,12 +36,12 @@ namespace properties { namespace static_methods { { - Terminal.loadAddon('attach'); - Terminal.loadAddon('fit'); - Terminal.loadAddon('fullscreen'); - Terminal.loadAddon('search'); - Terminal.loadAddon('terminado'); - Terminal.loadAddon('winptyCompat'); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); } }