aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/xterm/src/common/public
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/xterm/src/common/public')
-rw-r--r--node_modules/xterm/src/common/public/AddonManager.ts56
-rw-r--r--node_modules/xterm/src/common/public/BufferApiView.ts35
-rw-r--r--node_modules/xterm/src/common/public/BufferLineApiView.ts29
-rw-r--r--node_modules/xterm/src/common/public/BufferNamespaceApi.ts33
-rw-r--r--node_modules/xterm/src/common/public/ParserApi.ts37
-rw-r--r--node_modules/xterm/src/common/public/UnicodeApi.ts27
6 files changed, 0 insertions, 217 deletions
diff --git a/node_modules/xterm/src/common/public/AddonManager.ts b/node_modules/xterm/src/common/public/AddonManager.ts
deleted file mode 100644
index 06c7812..0000000
--- a/node_modules/xterm/src/common/public/AddonManager.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) 2019 The xterm.js authors. All rights reserved.
- * @license MIT
- */
-
-import { ITerminalAddon, IDisposable, Terminal } from 'xterm';
-
-export interface ILoadedAddon {
- instance: ITerminalAddon;
- dispose: () => void;
- isDisposed: boolean;
-}
-
-export class AddonManager implements IDisposable {
- protected _addons: ILoadedAddon[] = [];
-
- constructor() {
- }
-
- public dispose(): void {
- for (let i = this._addons.length - 1; i >= 0; i--) {
- this._addons[i].instance.dispose();
- }
- }
-
- public loadAddon(terminal: Terminal, instance: ITerminalAddon): void {
- const loadedAddon: ILoadedAddon = {
- instance,
- dispose: instance.dispose,
- isDisposed: false
- };
- this._addons.push(loadedAddon);
- instance.dispose = () => this._wrappedAddonDispose(loadedAddon);
- instance.activate(terminal as any);
- }
-
- private _wrappedAddonDispose(loadedAddon: ILoadedAddon): void {
- if (loadedAddon.isDisposed) {
- // Do nothing if already disposed
- return;
- }
- let index = -1;
- for (let i = 0; i < this._addons.length; i++) {
- if (this._addons[i] === loadedAddon) {
- index = i;
- break;
- }
- }
- if (index === -1) {
- throw new Error('Could not dispose an addon that has not been loaded');
- }
- loadedAddon.isDisposed = true;
- loadedAddon.dispose.apply(loadedAddon.instance);
- this._addons.splice(index, 1);
- }
-}
diff --git a/node_modules/xterm/src/common/public/BufferApiView.ts b/node_modules/xterm/src/common/public/BufferApiView.ts
deleted file mode 100644
index ca9ef2d..0000000
--- a/node_modules/xterm/src/common/public/BufferApiView.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright (c) 2021 The xterm.js authors. All rights reserved.
- * @license MIT
- */
-
-import { IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm';
-import { IBuffer } from 'common/buffer/Types';
-import { BufferLineApiView } from 'common/public/BufferLineApiView';
-import { CellData } from 'common/buffer/CellData';
-
-export class BufferApiView implements IBufferApi {
- constructor(
- private _buffer: IBuffer,
- public readonly type: 'normal' | 'alternate'
- ) { }
-
- public init(buffer: IBuffer): BufferApiView {
- this._buffer = buffer;
- return this;
- }
-
- public get cursorY(): number { return this._buffer.y; }
- public get cursorX(): number { return this._buffer.x; }
- public get viewportY(): number { return this._buffer.ydisp; }
- public get baseY(): number { return this._buffer.ybase; }
- public get length(): number { return this._buffer.lines.length; }
- public getLine(y: number): IBufferLineApi | undefined {
- const line = this._buffer.lines.get(y);
- if (!line) {
- return undefined;
- }
- return new BufferLineApiView(line);
- }
- public getNullCell(): IBufferCellApi { return new CellData(); }
-}
diff --git a/node_modules/xterm/src/common/public/BufferLineApiView.ts b/node_modules/xterm/src/common/public/BufferLineApiView.ts
deleted file mode 100644
index 6037501..0000000
--- a/node_modules/xterm/src/common/public/BufferLineApiView.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) 2021 The xterm.js authors. All rights reserved.
- * @license MIT
- */
-
-import { CellData } from 'common/buffer/CellData';
-import { IBufferLine, ICellData } from 'common/Types';
-import { IBufferCell as IBufferCellApi, IBufferLine as IBufferLineApi } from 'xterm';
-
-export class BufferLineApiView implements IBufferLineApi {
- constructor(private _line: IBufferLine) { }
-
- public get isWrapped(): boolean { return this._line.isWrapped; }
- public get length(): number { return this._line.length; }
- public getCell(x: number, cell?: IBufferCellApi): IBufferCellApi | undefined {
- if (x < 0 || x >= this._line.length) {
- return undefined;
- }
-
- if (cell) {
- this._line.loadCell(x, cell as ICellData);
- return cell;
- }
- return this._line.loadCell(x, new CellData());
- }
- public translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string {
- return this._line.translateToString(trimRight, startColumn, endColumn);
- }
-}
diff --git a/node_modules/xterm/src/common/public/BufferNamespaceApi.ts b/node_modules/xterm/src/common/public/BufferNamespaceApi.ts
deleted file mode 100644
index d86f6bf..0000000
--- a/node_modules/xterm/src/common/public/BufferNamespaceApi.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2021 The xterm.js authors. All rights reserved.
- * @license MIT
- */
-
-import { IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi } from 'xterm';
-import { BufferApiView } from 'common/public/BufferApiView';
-import { IEvent, EventEmitter } from 'common/EventEmitter';
-import { ICoreTerminal } from 'common/Types';
-
-export class BufferNamespaceApi implements IBufferNamespaceApi {
- private _normal: BufferApiView;
- private _alternate: BufferApiView;
- private _onBufferChange = new EventEmitter<IBufferApi>();
- public get onBufferChange(): IEvent<IBufferApi> { return this._onBufferChange.event; }
-
- constructor(private _core: ICoreTerminal) {
- this._normal = new BufferApiView(this._core.buffers.normal, 'normal');
- this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate');
- this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));
- }
- public get active(): IBufferApi {
- if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; }
- if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; }
- throw new Error('Active buffer is neither normal nor alternate');
- }
- public get normal(): IBufferApi {
- return this._normal.init(this._core.buffers.normal);
- }
- public get alternate(): IBufferApi {
- return this._alternate.init(this._core.buffers.alt);
- }
-}
diff --git a/node_modules/xterm/src/common/public/ParserApi.ts b/node_modules/xterm/src/common/public/ParserApi.ts
deleted file mode 100644
index 67df4be..0000000
--- a/node_modules/xterm/src/common/public/ParserApi.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright (c) 2021 The xterm.js authors. All rights reserved.
- * @license MIT
- */
-
-import { IParams } from 'common/parser/Types';
-import { IDisposable, IFunctionIdentifier, IParser } from 'xterm';
-import { ICoreTerminal } from 'common/Types';
-
-export class ParserApi implements IParser {
- constructor(private _core: ICoreTerminal) { }
-
- public registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {
- return this._core.registerCsiHandler(id, (params: IParams) => callback(params.toArray()));
- }
- public addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {
- return this.registerCsiHandler(id, callback);
- }
- public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {
- return this._core.registerDcsHandler(id, (data: string, params: IParams) => callback(data, params.toArray()));
- }
- public addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {
- return this.registerDcsHandler(id, callback);
- }
- public registerEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise<boolean>): IDisposable {
- return this._core.registerEscHandler(id, handler);
- }
- public addEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise<boolean>): IDisposable {
- return this.registerEscHandler(id, handler);
- }
- public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable {
- return this._core.registerOscHandler(ident, callback);
- }
- public addOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable {
- return this.registerOscHandler(ident, callback);
- }
-}
diff --git a/node_modules/xterm/src/common/public/UnicodeApi.ts b/node_modules/xterm/src/common/public/UnicodeApi.ts
deleted file mode 100644
index 8a669a0..0000000
--- a/node_modules/xterm/src/common/public/UnicodeApi.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (c) 2021 The xterm.js authors. All rights reserved.
- * @license MIT
- */
-
-import { ICoreTerminal } from 'common/Types';
-import { IUnicodeHandling, IUnicodeVersionProvider } from 'xterm';
-
-export class UnicodeApi implements IUnicodeHandling {
- constructor(private _core: ICoreTerminal) { }
-
- public register(provider: IUnicodeVersionProvider): void {
- this._core.unicodeService.register(provider);
- }
-
- public get versions(): string[] {
- return this._core.unicodeService.versions;
- }
-
- public get activeVersion(): string {
- return this._core.unicodeService.activeVersion;
- }
-
- public set activeVersion(version: string) {
- this._core.unicodeService.activeVersion = version;
- }
-}