Merge remote-tracking branch 'ups/master' into pr/1148

This commit is contained in:
Daniel Imms
2018-01-28 13:39:07 -08:00
45 changed files with 563 additions and 619 deletions
+10 -18
View File
@@ -198,10 +198,16 @@ declare module 'xterm' {
priority?: number;
}
export interface IEventEmitter {
on(type: string, listener: (...args: any[]) => void): void;
off(type: string, listener: (...args: any[]) => void): void;
emit(type: string, data?: any): void;
}
/**
* The class that represents an xterm.js terminal.
*/
export class Terminal {
export class Terminal implements IEventEmitter {
/**
* The element containing the terminal.
*/
@@ -250,7 +256,7 @@ declare module 'xterm' {
* @param type The type of the event.
* @param listener The listener.
*/
on(type: 'data', listener: (data?: string) => void): void;
on(type: 'data', listener: (...args: any[]) => void): void;
/**
* Registers an event listener.
* @param type The type of the event.
@@ -301,6 +307,8 @@ declare module 'xterm' {
*/
off(type: 'blur' | 'focus' | 'linefeed' | 'selection' | 'data' | 'key' | 'keypress' | 'keydown' | 'refresh' | 'resize' | 'scroll' | 'title' | string, listener: (...args: any[]) => void): void;
emit(type: string, data?: any): void;
/**
* Resizes the terminal.
* @param x The number of columns to resize to.
@@ -372,22 +380,6 @@ declare module 'xterm' {
*/
selectAll(): void;
// /**
// * Find the next instance of the term, then scroll to and select it. If it
// * doesn't exist, do nothing.
// * @param term Tne search term.
// * @return Whether a result was found.
// */
// findNext(term: string): boolean;
// /**
// * Find the previous instance of the term, then scroll to and select it. If it
// * doesn't exist, do nothing.
// * @param term Tne search term.
// * @return Whether a result was found.
// */
// findPrevious(term: string): boolean;
/**
* Destroys the terminal and detaches it from the DOM.
*/