Skip to content

Commit

Permalink
Add Missing types + Remove setOption(key: string, value: any):
Browse files Browse the repository at this point in the history
  • Loading branch information
bmf-ribeiro committed Feb 26, 2018
1 parent c801734 commit 02a86a8
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions typings/xterm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
Expand All @@ -46,7 +56,7 @@ declare module 'xterm' {
/**
* The style of the cursor.
*/
cursorStyle?: 'block' | 'underline' | 'bar';
cursorStyle?: CursorStyle;

/**
* Whether input should be disabled.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 02a86a8

Please sign in to comment.