diff --git a/src/Terminal.ts b/src/Terminal.ts index 24808099fc..32f9ea2311 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -37,7 +37,7 @@ import * as Browser from './utils/Browser'; import * as Mouse from './utils/Mouse'; import { CHARSETS } from './Charsets'; import { getRawByteCoords } from './utils/Mouse'; -import { CustomKeyEventHandler, Charset, LinkMatcherHandler, LinkMatcherValidationCallback, CharData, LineData, Option, StringOption, BooleanOption, StringArrayOption, NumberOption, GeometryOption, HandlerOption } from './Types'; +import { CustomKeyEventHandler, Charset, LinkMatcherHandler, LinkMatcherValidationCallback, CharData, LineData } from './Types'; import { ITerminal, IBrowser, ITerminalOptions, IInputHandlingTerminal, ILinkMatcherOptions, IViewport, ICompositionHelper } from './Interfaces'; // Declare for RequireJS in loadAddon @@ -412,13 +412,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT * Retrieves an option's value from the terminal. * @param {string} key The option key. */ - public getOption(key: StringOption): string; - public getOption(key: BooleanOption): boolean; - public getOption(key: StringArrayOption): string[]; - public getOption(key: NumberOption): number; - public getOption(key: GeometryOption): [number, number]; - public getOption(key: HandlerOption): (data: string) => void; - public getOption(key: Option): any { + public getOption(key: string): any { if (!(key in DEFAULT_OPTIONS)) { throw new Error('No option with key "' + key + '"'); } @@ -435,13 +429,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT * @param {string} key The option key. * @param {any} value The option value. */ - public setOption(key: StringOption, value: string): void; - public setOption(key: BooleanOption, value: boolean): void; - public setOption(key: StringArrayOption, value: number[]): void; - public setOption(key: NumberOption, value: number): void; - public setOption(key: GeometryOption, value: [number, number]): void; - public setOption(key: HandlerOption, value: (data: string) => void): void; - public setOption(key: Option, value: any): void { + public setOption(key: string, value: any): void { if (!(key in DEFAULT_OPTIONS)) { throw new Error('No option with key "' + key + '"'); } diff --git a/src/Types.ts b/src/Types.ts index 0de78d5261..0753d80e19 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -18,26 +18,3 @@ export type Charset = {[key: string]: string}; export type CharData = [number, string, number]; export type LineData = CharData[]; - -export type Option = BooleanOption | StringOption | StringArrayOption | NumberOption | GeometryOption | HandlerOption; -export type BooleanOption = - 'cancelEvents' | - 'convertEol' | - 'cursorBlink' | - 'debug' | - 'disableStdin' | - 'popOnBell' | - 'screenKeys' | - 'useFlowControl' | - 'visualBell'; -export type StringOption = - 'cursorStyle' | - 'termName'; -export type StringArrayOption = 'colors'; -export type NumberOption = - 'cols' | - 'rows' | - 'tabStopWidth' | - 'scrollback'; -export type GeometryOption = 'geometry'; -export type HandlerOption = 'handler';