+5
-5
@@ -14,7 +14,7 @@ import { Disposable } from 'common/Lifecycle';
|
|||||||
import { concat } from 'common/TypedArrayUtils';
|
import { concat } from 'common/TypedArrayUtils';
|
||||||
import { StringToUtf32, stringFromCodePoint, utf32ToString, Utf8ToUtf32 } from 'common/input/TextDecoder';
|
import { StringToUtf32, stringFromCodePoint, utf32ToString, Utf8ToUtf32 } from 'common/input/TextDecoder';
|
||||||
import { CellData, Attributes, FgFlags, BgFlags, AttributeData, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
import { CellData, Attributes, FgFlags, BgFlags, AttributeData, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { IParsingState, IDcsHandler, IEscapeSequenceParser } from 'common/parser/Types';
|
import { IParsingState, IDcsHandler, IEscapeSequenceParser } from 'common/parser/Types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,13 +108,13 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|||||||
private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32();
|
private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32();
|
||||||
private _workCell: CellData = new CellData();
|
private _workCell: CellData = new CellData();
|
||||||
|
|
||||||
private _onCursorMove = new EventEmitter2<void>();
|
private _onCursorMove = new EventEmitter<void>();
|
||||||
public get onCursorMove(): IEvent<void> { return this._onCursorMove.event; }
|
public get onCursorMove(): IEvent<void> { return this._onCursorMove.event; }
|
||||||
private _onData = new EventEmitter2<string>();
|
private _onData = new EventEmitter<string>();
|
||||||
public get onData(): IEvent<string> { return this._onData.event; }
|
public get onData(): IEvent<string> { return this._onData.event; }
|
||||||
private _onLineFeed = new EventEmitter2<void>();
|
private _onLineFeed = new EventEmitter<void>();
|
||||||
public get onLineFeed(): IEvent<void> { return this._onLineFeed.event; }
|
public get onLineFeed(): IEvent<void> { return this._onLineFeed.event; }
|
||||||
private _onScroll = new EventEmitter2<number>();
|
private _onScroll = new EventEmitter<number>();
|
||||||
public get onScroll(): IEvent<number> { return this._onScroll.event; }
|
public get onScroll(): IEvent<number> { return this._onScroll.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
+4
-4
@@ -7,7 +7,7 @@ import { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions,
|
|||||||
import { IBufferStringIteratorResult } from 'common/buffer/Types';
|
import { IBufferStringIteratorResult } from 'common/buffer/Types';
|
||||||
import { MouseZone } from './MouseZoneManager';
|
import { MouseZone } from './MouseZoneManager';
|
||||||
import { getStringCellWidth } from 'common/CharWidth';
|
import { getStringCellWidth } from 'common/CharWidth';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Linkifier applies links to rows shortly after they have been refreshed.
|
* The Linkifier applies links to rows shortly after they have been refreshed.
|
||||||
@@ -34,11 +34,11 @@ export class Linkifier implements ILinkifier {
|
|||||||
private _nextLinkMatcherId = 0;
|
private _nextLinkMatcherId = 0;
|
||||||
private _rowsToLinkify: { start: number, end: number };
|
private _rowsToLinkify: { start: number, end: number };
|
||||||
|
|
||||||
private _onLinkHover = new EventEmitter2<ILinkifierEvent>();
|
private _onLinkHover = new EventEmitter<ILinkifierEvent>();
|
||||||
public get onLinkHover(): IEvent<ILinkifierEvent> { return this._onLinkHover.event; }
|
public get onLinkHover(): IEvent<ILinkifierEvent> { return this._onLinkHover.event; }
|
||||||
private _onLinkLeave = new EventEmitter2<ILinkifierEvent>();
|
private _onLinkLeave = new EventEmitter<ILinkifierEvent>();
|
||||||
public get onLinkLeave(): IEvent<ILinkifierEvent> { return this._onLinkLeave.event; }
|
public get onLinkLeave(): IEvent<ILinkifierEvent> { return this._onLinkLeave.event; }
|
||||||
private _onLinkTooltip = new EventEmitter2<ILinkifierEvent>();
|
private _onLinkTooltip = new EventEmitter<ILinkifierEvent>();
|
||||||
public get onLinkTooltip(): IEvent<ILinkifierEvent> { return this._onLinkTooltip.event; }
|
public get onLinkTooltip(): IEvent<ILinkifierEvent> { return this._onLinkTooltip.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { SelectionModel } from './SelectionModel';
|
|||||||
import { AltClickHandler } from './handlers/AltClickHandler';
|
import { AltClickHandler } from './handlers/AltClickHandler';
|
||||||
import { CellData } from 'common/buffer/BufferLine';
|
import { CellData } from 'common/buffer/BufferLine';
|
||||||
import { IDisposable } from 'xterm';
|
import { IDisposable } from 'xterm';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { ICharSizeService } from 'browser/services/Services';
|
import { ICharSizeService } from 'browser/services/Services';
|
||||||
import { IBufferService } from 'common/services/Services';
|
import { IBufferService } from 'common/services/Services';
|
||||||
|
|
||||||
@@ -110,11 +110,11 @@ export class SelectionManager implements ISelectionManager {
|
|||||||
|
|
||||||
private _mouseDownTimeStamp: number;
|
private _mouseDownTimeStamp: number;
|
||||||
|
|
||||||
private _onLinuxMouseSelection = new EventEmitter2<string>();
|
private _onLinuxMouseSelection = new EventEmitter<string>();
|
||||||
public get onLinuxMouseSelection(): IEvent<string> { return this._onLinuxMouseSelection.event; }
|
public get onLinuxMouseSelection(): IEvent<string> { return this._onLinuxMouseSelection.event; }
|
||||||
private _onRedrawRequest = new EventEmitter2<ISelectionRedrawRequestEvent>();
|
private _onRedrawRequest = new EventEmitter<ISelectionRedrawRequestEvent>();
|
||||||
public get onRedrawRequest(): IEvent<ISelectionRedrawRequestEvent> { return this._onRedrawRequest.event; }
|
public get onRedrawRequest(): IEvent<ISelectionRedrawRequestEvent> { return this._onRedrawRequest.event; }
|
||||||
private _onSelectionChange = new EventEmitter2<void>();
|
private _onSelectionChange = new EventEmitter<void>();
|
||||||
public get onSelectionChange(): IEvent<void> { return this._onSelectionChange.event; }
|
public get onSelectionChange(): IEvent<void> { return this._onSelectionChange.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
+14
-14
@@ -45,7 +45,7 @@ import { removeTerminalFromCache } from './renderer/atlas/CharAtlasCache';
|
|||||||
import { DomRenderer } from './renderer/dom/DomRenderer';
|
import { DomRenderer } from './renderer/dom/DomRenderer';
|
||||||
import { IKeyboardEvent, KeyboardResultType, ICharset, IBufferLine, IAttributeData } from 'common/Types';
|
import { IKeyboardEvent, KeyboardResultType, ICharset, IBufferLine, IAttributeData } from 'common/Types';
|
||||||
import { evaluateKeyboardEvent } from 'common/input/Keyboard';
|
import { evaluateKeyboardEvent } from 'common/input/Keyboard';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { Attributes, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
import { Attributes, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
||||||
import { applyWindowsMode } from './WindowsMode';
|
import { applyWindowsMode } from './WindowsMode';
|
||||||
import { ColorManager } from 'browser/ColorManager';
|
import { ColorManager } from 'browser/ColorManager';
|
||||||
@@ -190,32 +190,32 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
public get cols(): number { return this._bufferService.cols; }
|
public get cols(): number { return this._bufferService.cols; }
|
||||||
public get rows(): number { return this._bufferService.rows; }
|
public get rows(): number { return this._bufferService.rows; }
|
||||||
|
|
||||||
private _onCursorMove = new EventEmitter2<void>();
|
private _onCursorMove = new EventEmitter<void>();
|
||||||
public get onCursorMove(): IEvent<void> { return this._onCursorMove.event; }
|
public get onCursorMove(): IEvent<void> { return this._onCursorMove.event; }
|
||||||
private _onData = new EventEmitter2<string>();
|
private _onData = new EventEmitter<string>();
|
||||||
public get onData(): IEvent<string> { return this._onData.event; }
|
public get onData(): IEvent<string> { return this._onData.event; }
|
||||||
private _onKey = new EventEmitter2<{ key: string, domEvent: KeyboardEvent }>();
|
private _onKey = new EventEmitter<{ key: string, domEvent: KeyboardEvent }>();
|
||||||
public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._onKey.event; }
|
public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._onKey.event; }
|
||||||
private _onLineFeed = new EventEmitter2<void>();
|
private _onLineFeed = new EventEmitter<void>();
|
||||||
public get onLineFeed(): IEvent<void> { return this._onLineFeed.event; }
|
public get onLineFeed(): IEvent<void> { return this._onLineFeed.event; }
|
||||||
private _onRender = new EventEmitter2<{ start: number, end: number }>();
|
private _onRender = new EventEmitter<{ start: number, end: number }>();
|
||||||
public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }
|
public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }
|
||||||
private _onResize = new EventEmitter2<{ cols: number, rows: number }>();
|
private _onResize = new EventEmitter<{ cols: number, rows: number }>();
|
||||||
public get onResize(): IEvent<{ cols: number, rows: number }> { return this._onResize.event; }
|
public get onResize(): IEvent<{ cols: number, rows: number }> { return this._onResize.event; }
|
||||||
private _onScroll = new EventEmitter2<number>();
|
private _onScroll = new EventEmitter<number>();
|
||||||
public get onScroll(): IEvent<number> { return this._onScroll.event; }
|
public get onScroll(): IEvent<number> { return this._onScroll.event; }
|
||||||
private _onSelectionChange = new EventEmitter2<void>();
|
private _onSelectionChange = new EventEmitter<void>();
|
||||||
public get onSelectionChange(): IEvent<void> { return this._onSelectionChange.event; }
|
public get onSelectionChange(): IEvent<void> { return this._onSelectionChange.event; }
|
||||||
private _onTitleChange = new EventEmitter2<string>();
|
private _onTitleChange = new EventEmitter<string>();
|
||||||
public get onTitleChange(): IEvent<string> { return this._onTitleChange.event; }
|
public get onTitleChange(): IEvent<string> { return this._onTitleChange.event; }
|
||||||
|
|
||||||
private _onFocus = new EventEmitter2<void>();
|
private _onFocus = new EventEmitter<void>();
|
||||||
public get onFocus(): IEvent<void> { return this._onFocus.event; }
|
public get onFocus(): IEvent<void> { return this._onFocus.event; }
|
||||||
private _onBlur = new EventEmitter2<void>();
|
private _onBlur = new EventEmitter<void>();
|
||||||
public get onBlur(): IEvent<void> { return this._onBlur.event; }
|
public get onBlur(): IEvent<void> { return this._onBlur.event; }
|
||||||
public onA11yCharEmitter = new EventEmitter2<string>();
|
public onA11yCharEmitter = new EventEmitter<string>();
|
||||||
public get onA11yChar(): IEvent<string> { return this.onA11yCharEmitter.event; }
|
public get onA11yChar(): IEvent<string> { return this.onA11yCharEmitter.event; }
|
||||||
public onA11yTabEmitter = new EventEmitter2<number>();
|
public onA11yTabEmitter = new EventEmitter<number>();
|
||||||
public get onA11yTab(): IEvent<number> { return this.onA11yTabEmitter.event; }
|
public get onA11yTab(): IEvent<number> { return this.onA11yTabEmitter.event; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { Terminal } from './Terminal';
|
|||||||
import { AttributeData } from 'common/buffer/BufferLine';
|
import { AttributeData } from 'common/buffer/BufferLine';
|
||||||
import { IColorManager, IColorSet, IMouseHelper } from 'browser/Types';
|
import { IColorManager, IColorSet, IMouseHelper } from 'browser/Types';
|
||||||
import { IOptionsService } from 'common/services/Services';
|
import { IOptionsService } from 'common/services/Services';
|
||||||
import { EventEmitter2 } from 'common/EventEmitter2';
|
import { EventEmitter } from 'common/EventEmitter';
|
||||||
|
|
||||||
export class TestTerminal extends Terminal {
|
export class TestTerminal extends Terminal {
|
||||||
writeSync(data: string): void {
|
writeSync(data: string): void {
|
||||||
@@ -186,8 +186,8 @@ export class MockTerminal implements ITerminal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class MockInputHandlingTerminal implements IInputHandlingTerminal {
|
export class MockInputHandlingTerminal implements IInputHandlingTerminal {
|
||||||
onA11yCharEmitter: EventEmitter2<string>;
|
onA11yCharEmitter: EventEmitter<string>;
|
||||||
onA11yTabEmitter: EventEmitter2<number>;
|
onA11yTabEmitter: EventEmitter<number>;
|
||||||
element: HTMLElement;
|
element: HTMLElement;
|
||||||
options: ITerminalOptions = {};
|
options: ITerminalOptions = {};
|
||||||
cols: number;
|
cols: number;
|
||||||
|
|||||||
+3
-3
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import { ITerminalOptions as IPublicTerminalOptions, IDisposable, IMarker, ISelectionPosition } from 'xterm';
|
import { ITerminalOptions as IPublicTerminalOptions, IDisposable, IMarker, ISelectionPosition } from 'xterm';
|
||||||
import { ICharset, IAttributeData, CharData } from 'common/Types';
|
import { ICharset, IAttributeData, CharData } from 'common/Types';
|
||||||
import { IEvent, EventEmitter2 } from 'common/EventEmitter2';
|
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||||
import { IColorSet, IMouseHelper } from 'browser/Types';
|
import { IColorSet, IMouseHelper } from 'browser/Types';
|
||||||
import { IOptionsService } from 'common/services/Services';
|
import { IOptionsService } from 'common/services/Services';
|
||||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||||
@@ -54,8 +54,8 @@ export interface IInputHandlingTerminal {
|
|||||||
viewport: IViewport;
|
viewport: IViewport;
|
||||||
selectionManager: ISelectionManager;
|
selectionManager: ISelectionManager;
|
||||||
|
|
||||||
onA11yCharEmitter: EventEmitter2<string>;
|
onA11yCharEmitter: EventEmitter<string>;
|
||||||
onA11yTabEmitter: EventEmitter2<number>;
|
onA11yTabEmitter: EventEmitter<number>;
|
||||||
|
|
||||||
bell(): void;
|
bell(): void;
|
||||||
focus(): void;
|
focus(): void;
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IEvent, EventEmitter2 } from 'common/EventEmitter2';
|
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||||
import { ICharSizeService } from 'browser/services/Services';
|
import { ICharSizeService } from 'browser/services/Services';
|
||||||
|
|
||||||
export class MockCharSizeService implements ICharSizeService {
|
export class MockCharSizeService implements ICharSizeService {
|
||||||
get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
|
get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
|
||||||
onCharSizeChange: IEvent<void> = new EventEmitter2<void>().event;
|
onCharSizeChange: IEvent<void> = new EventEmitter<void>().event;
|
||||||
constructor(public width: number, public height: number) {}
|
constructor(public width: number, public height: number) {}
|
||||||
measure(): void {}
|
measure(): void {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { IOptionsService } from 'common/services/Services';
|
import { IOptionsService } from 'common/services/Services';
|
||||||
import { IEvent, EventEmitter2 } from 'common/EventEmitter2';
|
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||||
import { ICharSizeService } from 'browser/services/Services';
|
import { ICharSizeService } from 'browser/services/Services';
|
||||||
|
|
||||||
export class CharSizeService implements ICharSizeService {
|
export class CharSizeService implements ICharSizeService {
|
||||||
@@ -14,7 +14,7 @@ export class CharSizeService implements ICharSizeService {
|
|||||||
|
|
||||||
public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
|
public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
|
||||||
|
|
||||||
private _onCharSizeChange = new EventEmitter2<void>();
|
private _onCharSizeChange = new EventEmitter<void>();
|
||||||
public get onCharSizeChange(): IEvent<void> { return this._onCharSizeChange.event; }
|
public get onCharSizeChange(): IEvent<void> { return this._onCharSizeChange.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import { IRenderer, IRenderDimensions, CharacterJoinerHandler } from 'browser/renderer/Types';
|
import { IRenderer, IRenderDimensions, CharacterJoinerHandler } from 'browser/renderer/Types';
|
||||||
import { RenderDebouncer } from 'browser/RenderDebouncer';
|
import { RenderDebouncer } from 'browser/RenderDebouncer';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { Disposable } from 'common/Lifecycle';
|
import { Disposable } from 'common/Lifecycle';
|
||||||
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
|
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
|
||||||
import { addDisposableDomListener } from 'browser/Lifecycle';
|
import { addDisposableDomListener } from 'browser/Lifecycle';
|
||||||
@@ -22,11 +22,11 @@ export class RenderService extends Disposable implements IRenderService {
|
|||||||
private _canvasWidth: number = 0;
|
private _canvasWidth: number = 0;
|
||||||
private _canvasHeight: number = 0;
|
private _canvasHeight: number = 0;
|
||||||
|
|
||||||
private _onDimensionsChange = new EventEmitter2<IRenderDimensions>();
|
private _onDimensionsChange = new EventEmitter<IRenderDimensions>();
|
||||||
public get onDimensionsChange(): IEvent<IRenderDimensions> { return this._onDimensionsChange.event; }
|
public get onDimensionsChange(): IEvent<IRenderDimensions> { return this._onDimensionsChange.event; }
|
||||||
private _onRender = new EventEmitter2<{ start: number, end: number }>();
|
private _onRender = new EventEmitter<{ start: number, end: number }>();
|
||||||
public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }
|
public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }
|
||||||
private _onRefreshRequest = new EventEmitter2<{ start: number, end: number }>();
|
private _onRefreshRequest = new EventEmitter<{ start: number, end: number }>();
|
||||||
public get onRefreshRequest(): IEvent<{ start: number, end: number }> { return this._onRefreshRequest.event; }
|
public get onRefreshRequest(): IEvent<{ start: number, end: number }> { return this._onRefreshRequest.event; }
|
||||||
|
|
||||||
public get dimensions(): IRenderDimensions { return this._renderer.dimensions; }
|
public get dimensions(): IRenderDimensions { return this._renderer.dimensions; }
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IEvent } from 'common/EventEmitter2';
|
import { IEvent } from 'common/EventEmitter';
|
||||||
import { IRenderDimensions, IRenderer, CharacterJoinerHandler } from 'browser/renderer/Types';
|
import { IRenderDimensions, IRenderer, CharacterJoinerHandler } from 'browser/renderer/Types';
|
||||||
import { IColorSet } from 'browser/Types';
|
import { IColorSet } from 'browser/Types';
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ICircularList } from 'common/Types';
|
import { ICircularList } from 'common/Types';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
export interface IInsertEvent {
|
export interface IInsertEvent {
|
||||||
index: number;
|
index: number;
|
||||||
@@ -25,11 +25,11 @@ export class CircularList<T> implements ICircularList<T> {
|
|||||||
private _startIndex: number;
|
private _startIndex: number;
|
||||||
private _length: number;
|
private _length: number;
|
||||||
|
|
||||||
public onDeleteEmitter = new EventEmitter2<IDeleteEvent>();
|
public onDeleteEmitter = new EventEmitter<IDeleteEvent>();
|
||||||
public get onDelete(): IEvent<IDeleteEvent> { return this.onDeleteEmitter.event; }
|
public get onDelete(): IEvent<IDeleteEvent> { return this.onDeleteEmitter.event; }
|
||||||
public onInsertEmitter = new EventEmitter2<IInsertEvent>();
|
public onInsertEmitter = new EventEmitter<IInsertEvent>();
|
||||||
public get onInsert(): IEvent<IInsertEvent> { return this.onInsertEmitter.event; }
|
public get onInsert(): IEvent<IInsertEvent> { return this.onInsertEmitter.event; }
|
||||||
public onTrimEmitter = new EventEmitter2<number>();
|
public onTrimEmitter = new EventEmitter<number>();
|
||||||
public get onTrim(): IEvent<number> { return this.onTrimEmitter.event; }
|
public get onTrim(): IEvent<number> { return this.onTrimEmitter.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai';
|
||||||
import { EventEmitter2 } from 'common/EventEmitter2';
|
import { EventEmitter } from 'common/EventEmitter';
|
||||||
|
|
||||||
describe('EventEmitter2', () => {
|
describe('EventEmitter', () => {
|
||||||
it('should fire listeners multiple times', () => {
|
it('should fire listeners multiple times', () => {
|
||||||
const order: string[] = [];
|
const order: string[] = [];
|
||||||
const emitter = new EventEmitter2<number>();
|
const emitter = new EventEmitter<number>();
|
||||||
emitter.event(data => order.push(data + 'a'));
|
emitter.event(data => order.push(data + 'a'));
|
||||||
emitter.event(data => order.push(data + 'b'));
|
emitter.event(data => order.push(data + 'b'));
|
||||||
emitter.fire(1);
|
emitter.fire(1);
|
||||||
@@ -19,7 +19,7 @@ describe('EventEmitter2', () => {
|
|||||||
|
|
||||||
it('should not fire listeners once disposed', () => {
|
it('should not fire listeners once disposed', () => {
|
||||||
const order: string[] = [];
|
const order: string[] = [];
|
||||||
const emitter = new EventEmitter2<number>();
|
const emitter = new EventEmitter<number>();
|
||||||
emitter.event(data => order.push(data + 'a'));
|
emitter.event(data => order.push(data + 'a'));
|
||||||
const disposeB = emitter.event(data => order.push(data + 'b'));
|
const disposeB = emitter.event(data => order.push(data + 'b'));
|
||||||
emitter.event(data => order.push(data + 'c'));
|
emitter.event(data => order.push(data + 'c'));
|
||||||
@@ -13,7 +13,7 @@ export interface IEvent<T> {
|
|||||||
(listener: (e: T) => any): IDisposable;
|
(listener: (e: T) => any): IDisposable;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EventEmitter2<T> {
|
export class EventEmitter<T> {
|
||||||
private _listeners: IListener<T>[] = [];
|
private _listeners: IListener<T>[] = [];
|
||||||
private _event?: IEvent<T>;
|
private _event?: IEvent<T>;
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { IBufferService, IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'common/services/Services';
|
import { IBufferService, IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'common/services/Services';
|
||||||
import { IEvent, EventEmitter2 } from 'common/EventEmitter2';
|
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||||
import { clone } from 'common/Clone';
|
import { clone } from 'common/Clone';
|
||||||
import { DEFAULT_OPTIONS } from 'common/services/OptionsService';
|
import { DEFAULT_OPTIONS } from 'common/services/OptionsService';
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ export class MockBufferService implements IBufferService {
|
|||||||
|
|
||||||
export class MockOptionsService implements IOptionsService {
|
export class MockOptionsService implements IOptionsService {
|
||||||
options: ITerminalOptions = clone(DEFAULT_OPTIONS);
|
options: ITerminalOptions = clone(DEFAULT_OPTIONS);
|
||||||
onOptionChange: IEvent<string> = new EventEmitter2<string>().event;
|
onOptionChange: IEvent<string> = new EventEmitter<string>().event;
|
||||||
constructor(testOptions: IPartialTerminalOptions) {
|
constructor(testOptions: IPartialTerminalOptions) {
|
||||||
Object.keys(testOptions).forEach(key => this.options[key] = (<any>testOptions)[key]);
|
Object.keys(testOptions).forEach(key => this.options[key] = (<any>testOptions)[key]);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -3,7 +3,7 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IEvent, EventEmitter2 } from 'common/EventEmitter2';
|
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||||
import { IDeleteEvent, IInsertEvent } from 'common/CircularList';
|
import { IDeleteEvent, IInsertEvent } from 'common/CircularList';
|
||||||
|
|
||||||
export const DEFAULT_COLOR = 256;
|
export const DEFAULT_COLOR = 256;
|
||||||
@@ -40,11 +40,11 @@ export interface ICircularList<T> {
|
|||||||
maxLength: number;
|
maxLength: number;
|
||||||
isFull: boolean;
|
isFull: boolean;
|
||||||
|
|
||||||
onDeleteEmitter: EventEmitter2<IDeleteEvent>;
|
onDeleteEmitter: EventEmitter<IDeleteEvent>;
|
||||||
onDelete: IEvent<IDeleteEvent>;
|
onDelete: IEvent<IDeleteEvent>;
|
||||||
onInsertEmitter: EventEmitter2<IInsertEvent>;
|
onInsertEmitter: EventEmitter<IInsertEvent>;
|
||||||
onInsert: IEvent<IInsertEvent>;
|
onInsert: IEvent<IInsertEvent>;
|
||||||
onTrimEmitter: EventEmitter2<number>;
|
onTrimEmitter: EventEmitter<number>;
|
||||||
onTrim: IEvent<number>;
|
onTrim: IEvent<number>;
|
||||||
|
|
||||||
get(index: number): T | undefined;
|
get(index: number): T | undefined;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||||
import { IAttributeData } from 'common/Types';
|
import { IAttributeData } from 'common/Types';
|
||||||
import { Buffer } from 'common/buffer/Buffer';
|
import { Buffer } from 'common/buffer/Buffer';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { IOptionsService, IBufferService } from 'common/services/Services';
|
import { IOptionsService, IBufferService } from 'common/services/Services';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,7 +19,7 @@ export class BufferSet implements IBufferSet {
|
|||||||
private _activeBuffer: Buffer;
|
private _activeBuffer: Buffer;
|
||||||
|
|
||||||
|
|
||||||
private _onBufferActivate = new EventEmitter2<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>();
|
private _onBufferActivate = new EventEmitter<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>();
|
||||||
public get onBufferActivate(): IEvent<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}> { return this._onBufferActivate.event; }
|
public get onBufferActivate(): IEvent<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}> { return this._onBufferActivate.event; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { Disposable } from 'common/Lifecycle';
|
import { Disposable } from 'common/Lifecycle';
|
||||||
import { IMarker } from 'common/Types';
|
import { IMarker } from 'common/Types';
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ export class Marker extends Disposable implements IMarker {
|
|||||||
|
|
||||||
public get id(): number { return this._id; }
|
public get id(): number { return this._id; }
|
||||||
|
|
||||||
private _onDispose = new EventEmitter2<void>();
|
private _onDispose = new EventEmitter<void>();
|
||||||
public get onDispose(): IEvent<void> { return this._onDispose.event; }
|
public get onDispose(): IEvent<void> { return this._onDispose.event; }
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { IAttributeData, ICircularList, IBufferLine, ICellData } from 'common/Types';
|
import { IAttributeData, ICircularList, IBufferLine, ICellData } from 'common/Types';
|
||||||
import { IEvent } from 'common/EventEmitter2';
|
import { IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
// BufferIndex denotes a position in the buffer: [rowIndex, colIndex]
|
// BufferIndex denotes a position in the buffer: [rowIndex, colIndex]
|
||||||
export type BufferIndex = [number, number];
|
export type BufferIndex = [number, number];
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'common/services/Services';
|
import { IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'common/services/Services';
|
||||||
import { EventEmitter2, IEvent } from 'common/EventEmitter2';
|
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||||
import { isMac } from 'common/Platform';
|
import { isMac } from 'common/Platform';
|
||||||
import { clone } from 'common/Clone';
|
import { clone } from 'common/Clone';
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ const CONSTRUCTOR_ONLY_OPTIONS = ['cols', 'rows'];
|
|||||||
export class OptionsService implements IOptionsService {
|
export class OptionsService implements IOptionsService {
|
||||||
public options: ITerminalOptions;
|
public options: ITerminalOptions;
|
||||||
|
|
||||||
private _onOptionChange = new EventEmitter2<string>();
|
private _onOptionChange = new EventEmitter<string>();
|
||||||
public get onOptionChange(): IEvent<string> { return this._onOptionChange.event; }
|
public get onOptionChange(): IEvent<string> { return this._onOptionChange.event; }
|
||||||
|
|
||||||
constructor(options: IPartialTerminalOptions) {
|
constructor(options: IPartialTerminalOptions) {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IEvent } from 'common/EventEmitter2';
|
import { IEvent } from 'common/EventEmitter';
|
||||||
|
|
||||||
export interface IBufferService {
|
export interface IBufferService {
|
||||||
readonly cols: number;
|
readonly cols: number;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { IBufferLine } from 'common/Types';
|
|||||||
import { IBuffer } from 'common/buffer/Types';
|
import { IBuffer } from 'common/buffer/Types';
|
||||||
import { Terminal as TerminalCore } from '../Terminal';
|
import { Terminal as TerminalCore } from '../Terminal';
|
||||||
import * as Strings from '../Strings';
|
import * as Strings from '../Strings';
|
||||||
import { IEvent } from 'common/EventEmitter2';
|
import { IEvent } from 'common/EventEmitter';
|
||||||
import { AddonManager } from './AddonManager';
|
import { AddonManager } from './AddonManager';
|
||||||
|
|
||||||
export class Terminal implements ITerminalApi {
|
export class Terminal implements ITerminalApi {
|
||||||
|
|||||||
Reference in New Issue
Block a user