From db6695435d2034bcd869b31619d9d2bf6075c323 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 13 Oct 2017 13:38:28 -0700 Subject: [PATCH] Add letterSpacing typings and test --- fixtures/typings-test/typings-test.ts | 2 ++ typings/xterm.d.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fixtures/typings-test/typings-test.ts b/fixtures/typings-test/typings-test.ts index 928ca238..bc8f1bd6 100644 --- a/fixtures/typings-test/typings-test.ts +++ b/fixtures/typings-test/typings-test.ts @@ -140,6 +140,7 @@ namespace methods_core { const r18: (data: string) => void = t.getOption('handler'); const r19: string = t.getOption('bellSound'); const r20: string = t.getOption('bellStyle'); + const r22: number = t.getOption('letterSpacing'); } { const t: Terminal = new Terminal(); @@ -157,6 +158,7 @@ namespace methods_core { t.setOption('useFlowControl', true); t.setOption('visualBell', true); t.setOption('colors', ['a', 'b']); + t.setOption('letterSpacing', 1); t.setOption('cols', 1); t.setOption('rows', 1); t.setOption('tabStopWidth', 1); diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index de2a261b..36176f8b 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -51,6 +51,11 @@ interface ITerminalOptions { */ fontFamily?: string; + /** + * The spacing in whole pixels between characters.. + */ + letterSpacing?: number; + /** * The line height used to render text. */ @@ -407,7 +412,7 @@ declare module 'xterm' { * Retrieves an option's value from the terminal. * @param key The option key. */ - getOption(key: 'cols' | 'fontSize' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; + getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; /** * Retrieves an option's value from the terminal. * @param key The option key. @@ -459,7 +464,7 @@ declare module 'xterm' { * @param key The option key. * @param value The option value. */ - setOption(key: 'cols' | 'fontSize' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback', value: number): void; + setOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback', value: number): void; /** * Sets an option on the terminal. * @param key The option key.