Fix most errors in Terminal.ts

This commit is contained in:
Daniel Imms
2017-08-05 01:58:42 -07:00
parent db5b908d62
commit 2104dccec5
7 changed files with 2157 additions and 2138 deletions
+4 -2
View File
@@ -2,17 +2,19 @@
* @license MIT
*/
import { Charset } from './Types';
/**
* The character sets supported by the terminal. These enable several languages
* to be represented within the terminal with only 8-bit encoding. See ISO 2022
* for a discussion on character sets. Only VT100 character sets are supported.
*/
export const CHARSETS: {[key: string]: {[key: string]: string}} = {};
export const CHARSETS: { [key: string]: Charset } = {};
/**
* The default character set, US.
*/
export const DEFAULT_CHARSET = CHARSETS['B'];
export const DEFAULT_CHARSET: Charset = CHARSETS['B'];
/**
* DEC Special Character and Line Drawing Set.
+4
View File
@@ -68,4 +68,8 @@ export class EventEmitter implements IEventEmitter {
public listeners(type): ListenerType[] {
return this._events[type] || [];
}
protected destroy(): void {
this._events = {};
}
}
+1 -1
View File
@@ -92,8 +92,8 @@ export interface ILinkifier {
export interface ICircularList<T> extends IEventEmitter {
length: number;
maxLength: number;
forEach: (callbackfn: (value: T, index: number) => void) => void;
forEach(callbackfn: (value: T, index: number, array: T[]) => void): void;
get(index: number): T;
set(index: number, value: T): void;
push(value: T): void;
+2138 -2134
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -12,3 +12,8 @@ export type LinkMatcher = {
};
export type LinkMatcherHandler = (event: MouseEvent, uri: string) => boolean | void;
export type LinkMatcherValidationCallback = (uri: string, element: HTMLElement, callback: (isValid: boolean) => void) => void;
// TODO: Make this type more specific
export type TerminalOptions = {[key: string]: any};
export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
export type Charset = {[key: string]: string};
+2 -1
View File
@@ -5,8 +5,9 @@
* @license MIT
*/
import { EventEmitter } from '../EventEmitter';
import { ICircularList } from '../Interfaces';
export class CircularList<T> extends EventEmitter {
export class CircularList<T> extends EventEmitter implements ICircularList<T> {
private _array: T[];
private _startIndex: number;
private _length: number;
+3
View File
@@ -0,0 +1,3 @@
import { Terminal } from './Terminal';
module.exports = Terminal;