Merge pull request #1072 from Tyriar/1071_typing_pollution

Move interfaces in types inside module
This commit is contained in:
Daniel Imms
2017-10-23 13:36:05 -07:00
committed by GitHub
+164 -164
View File
@@ -7,171 +7,171 @@
* to be stable and consumed by external programs.
*/
/**
* An object containing start up options for the terminal.
*/
interface ITerminalOptions {
/**
* A data uri of the sound to use for the bell (needs bellStyle = 'sound').
*/
bellSound?: string;
/**
* The type of the bell notification the terminal will use.
*/
bellStyle?: 'none' | 'visual' | 'sound' | 'both';
/**
* The number of columns in the terminal.
*/
cols?: number;
/**
* Whether the cursor blinks.
*/
cursorBlink?: boolean;
/**
* The style of the cursor.
*/
cursorStyle?: 'block' | 'underline' | 'bar';
/**
* Whether input should be disabled.
*/
disableStdin?: boolean;
/**
* Whether to enable the rendering of bold text.
*/
enableBold?: boolean;
/**
* The font size used to render text.
*/
fontSize?: number;
/**
* The font family used to render text.
*/
fontFamily?: string;
/**
* The spacing in whole pixels between characters..
*/
letterSpacing?: number;
/**
* The line height used to render text.
*/
lineHeight?: number;
/**
* The number of rows in the terminal.
*/
rows?: number;
/**
* The amount of scrollback in the terminal. Scrollback is the amount of rows
* that are retained when lines are scrolled beyond the initial viewport.
*/
scrollback?: number;
/**
* The size of tab stops in the terminal.
*/
tabStopWidth?: number;
/**
* The color theme of the terminal.
*/
theme?: ITheme;
}
/**
* Contains colors to theme the terminal with.
*/
interface ITheme {
/** The default foreground color */
foreground?: string,
/** The default background color */
background?: string,
/** The cursor color */
cursor?: string,
/** The accent color of the cursor (used as the foreground color for a block cursor) */
cursorAccent?: string,
/** The selection color (can be transparent) */
selection?: string,
/** ANSI black (eg. `\x1b[30m`) */
black?: string,
/** ANSI red (eg. `\x1b[31m`) */
red?: string,
/** ANSI green (eg. `\x1b[32m`) */
green?: string,
/** ANSI yellow (eg. `\x1b[33m`) */
yellow?: string,
/** ANSI blue (eg. `\x1b[34m`) */
blue?: string,
/** ANSI magenta (eg. `\x1b[35m`) */
magenta?: string,
/** ANSI cyan (eg. `\x1b[36m`) */
cyan?: string,
/** ANSI white (eg. `\x1b[37m`) */
white?: string,
/** ANSI bright black (eg. `\x1b[1;30m`) */
brightBlack?: string,
/** ANSI bright red (eg. `\x1b[1;31m`) */
brightRed?: string,
/** ANSI bright green (eg. `\x1b[1;32m`) */
brightGreen?: string,
/** ANSI bright yellow (eg. `\x1b[1;33m`) */
brightYellow?: string,
/** ANSI bright blue (eg. `\x1b[1;34m`) */
brightBlue?: string,
/** ANSI bright magenta (eg. `\x1b[1;35m`) */
brightMagenta?: string,
/** ANSI bright cyan (eg. `\x1b[1;36m`) */
brightCyan?: string,
/** ANSI bright white (eg. `\x1b[1;37m`) */
brightWhite?: string
}
/**
* An object containing options for a link matcher.
*/
interface ILinkMatcherOptions {
/**
* The index of the link from the regex.match(text) call. This defaults to 0
* (for regular expressions without capture groups).
*/
matchIndex?: number;
/**
* A callback that validates an individual link, returning true if valid and
* false if invalid.
*/
validationCallback?: (uri: string, callback: (isValid: boolean) => void) => void;
/**
* A callback that fires when the mouse hovers over a link for a moment.
*/
tooltipCallback?: (event: MouseEvent, uri: string) => boolean | void;
/**
* A callback that fires when the mouse leaves a link. Note that this can
* happen even when tooltipCallback hasn't fired for the link yet.
*/
leaveCallback?: (event: MouseEvent, uri: string) => boolean | void;
/**
* The priority of the link matcher, this defines the order in which the link
* matcher is evaluated relative to others, from highest to lowest. The
* default value is 0.
*/
priority?: number;
}
declare module 'xterm' {
/**
* An object containing start up options for the terminal.
*/
interface ITerminalOptions {
/**
* A data uri of the sound to use for the bell (needs bellStyle = 'sound').
*/
bellSound?: string;
/**
* The type of the bell notification the terminal will use.
*/
bellStyle?: 'none' | 'visual' | 'sound' | 'both';
/**
* The number of columns in the terminal.
*/
cols?: number;
/**
* Whether the cursor blinks.
*/
cursorBlink?: boolean;
/**
* The style of the cursor.
*/
cursorStyle?: 'block' | 'underline' | 'bar';
/**
* Whether input should be disabled.
*/
disableStdin?: boolean;
/**
* Whether to enable the rendering of bold text.
*/
enableBold?: boolean;
/**
* The font size used to render text.
*/
fontSize?: number;
/**
* The font family used to render text.
*/
fontFamily?: string;
/**
* The spacing in whole pixels between characters..
*/
letterSpacing?: number;
/**
* The line height used to render text.
*/
lineHeight?: number;
/**
* The number of rows in the terminal.
*/
rows?: number;
/**
* The amount of scrollback in the terminal. Scrollback is the amount of rows
* that are retained when lines are scrolled beyond the initial viewport.
*/
scrollback?: number;
/**
* The size of tab stops in the terminal.
*/
tabStopWidth?: number;
/**
* The color theme of the terminal.
*/
theme?: ITheme;
}
/**
* Contains colors to theme the terminal with.
*/
interface ITheme {
/** The default foreground color */
foreground?: string,
/** The default background color */
background?: string,
/** The cursor color */
cursor?: string,
/** The accent color of the cursor (used as the foreground color for a block cursor) */
cursorAccent?: string,
/** The selection color (can be transparent) */
selection?: string,
/** ANSI black (eg. `\x1b[30m`) */
black?: string,
/** ANSI red (eg. `\x1b[31m`) */
red?: string,
/** ANSI green (eg. `\x1b[32m`) */
green?: string,
/** ANSI yellow (eg. `\x1b[33m`) */
yellow?: string,
/** ANSI blue (eg. `\x1b[34m`) */
blue?: string,
/** ANSI magenta (eg. `\x1b[35m`) */
magenta?: string,
/** ANSI cyan (eg. `\x1b[36m`) */
cyan?: string,
/** ANSI white (eg. `\x1b[37m`) */
white?: string,
/** ANSI bright black (eg. `\x1b[1;30m`) */
brightBlack?: string,
/** ANSI bright red (eg. `\x1b[1;31m`) */
brightRed?: string,
/** ANSI bright green (eg. `\x1b[1;32m`) */
brightGreen?: string,
/** ANSI bright yellow (eg. `\x1b[1;33m`) */
brightYellow?: string,
/** ANSI bright blue (eg. `\x1b[1;34m`) */
brightBlue?: string,
/** ANSI bright magenta (eg. `\x1b[1;35m`) */
brightMagenta?: string,
/** ANSI bright cyan (eg. `\x1b[1;36m`) */
brightCyan?: string,
/** ANSI bright white (eg. `\x1b[1;37m`) */
brightWhite?: string
}
/**
* An object containing options for a link matcher.
*/
interface ILinkMatcherOptions {
/**
* The index of the link from the regex.match(text) call. This defaults to 0
* (for regular expressions without capture groups).
*/
matchIndex?: number;
/**
* A callback that validates an individual link, returning true if valid and
* false if invalid.
*/
validationCallback?: (uri: string, callback: (isValid: boolean) => void) => void;
/**
* A callback that fires when the mouse hovers over a link for a moment.
*/
tooltipCallback?: (event: MouseEvent, uri: string) => boolean | void;
/**
* A callback that fires when the mouse leaves a link. Note that this can
* happen even when tooltipCallback hasn't fired for the link yet.
*/
leaveCallback?: (event: MouseEvent, uri: string) => boolean | void;
/**
* The priority of the link matcher, this defines the order in which the link
* matcher is evaluated relative to others, from highest to lowest. The
* default value is 0.
*/
priority?: number;
}
/**
* The class that represents an xterm.js terminal.
*/