Expose strings through the API

This commit is contained in:
Daniel Imms
2018-01-28 13:10:11 -08:00
parent ec156f62e1
commit a0f390ef54
3 changed files with 18 additions and 2 deletions
+5 -1
View File
@@ -47,7 +47,7 @@ import { DEFAULT_ANSI_COLORS } from './renderer/ColorManager';
import { MouseZoneManager } from './input/MouseZoneManager';
import { AccessibilityManager } from './AccessibilityManager';
import { ScreenDprMonitor } from './utils/ScreenDprMonitor';
import { ITheme } from 'xterm';
import { ITheme, ILocalizableStrings } from 'xterm';
// Let it work inside Node.js for automated testing purposes.
const document = (typeof window !== 'undefined') ? window.document : null;
@@ -313,6 +313,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
return this.buffers.active;
}
public static get strings(): ILocalizableStrings {
return Strings;
}
/**
* back_color_erase feature for xterm.
*/
+1
View File
@@ -10,6 +10,7 @@ import * as Browser from '../shared/utils/Browser';
import { ITheme, IDisposable } from 'xterm';
export class MockTerminal implements ITerminal {
static string: any;
getOption(key: any): any {
throw new Error('Method not implemented.');
}
+12 -1
View File
@@ -207,12 +207,18 @@ declare module 'xterm' {
}
/**
* An object that can be disposed via a dipose function.
* An object that can be disposed via a dispose function.
*/
export interface IDisposable {
dispose(): void;
}
export interface ILocalizableStrings {
blankLine: string;
promptLabel: string;
tooMuchOutput: string;
}
/**
* The class that represents an xterm.js terminal.
*/
@@ -237,6 +243,11 @@ declare module 'xterm' {
*/
cols: number;
/**
* Natural language strings that can be localized.
*/
static strings: ILocalizableStrings;
/**
* Creates a new `Terminal` object.
*