diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index dd08b55e7b..a27c26bf00 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -13,6 +13,16 @@ declare module 'xterm' { */ export type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; + /** + * A string representing the bell style. + */ + export type BellStyle = 'none' /*| 'visual'*/ | 'sound' /*| 'both'*/; + + /** + * A string representing the cursor style style. + */ + export type CursorStyle = 'block' | 'underline' | 'bar'; + /** * An object containing start up options for the terminal. */ @@ -31,7 +41,7 @@ declare module 'xterm' { /** * The type of the bell notification the terminal will use. */ - bellStyle?: 'none' /*| 'visual'*/ | 'sound' /*| 'both'*/; + bellStyle?: BellStyle; /** * The number of columns in the terminal. @@ -46,7 +56,7 @@ declare module 'xterm' { /** * The style of the cursor. */ - cursorStyle?: 'block' | 'underline' | 'bar'; + cursorStyle?: CursorStyle; /** * Whether input should be disabled. @@ -504,19 +514,19 @@ declare module 'xterm' { * @param key The option key. * @param value The option value. */ - setOption(key: 'fontWeight' | 'fontWeightBold', value: null | 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'): void; + setOption(key: 'fontWeight' | 'fontWeightBold', value: null | FontWeight): void; /** * Sets an option on the terminal. * @param key The option key. * @param value The option value. */ - setOption(key: 'bellStyle', value: null | 'none' | 'visual' | 'sound' | 'both'): void; + setOption(key: 'bellStyle', value: null | BellStyle): void; /** * Sets an option on the terminal. * @param key The option key. * @param value The option value. */ - setOption(key: 'cursorStyle', value: null | 'block' | 'underline' | 'bar'): void; + setOption(key: 'cursorStyle', value: null | CursorStyle): void; /** * Sets an option on the terminal. * @param key The option key. @@ -548,12 +558,10 @@ declare module 'xterm' { */ setOption(key: 'theme', value: ITheme): void; /** - * Sets an option on the terminal. + * Retrieves an option's value from the terminal. * @param key The option key. - * @param value The option value. */ - setOption(key: string, value: any): void; - + setOption(key: 'cols' | 'rows', value: number): void; /** * Tells the renderer to refresh terminal content between two rows * (inclusive) at the next opportunity.