mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
common/public use ICoreTerminal instead of concrete
This commit is contained in:
Vendored
-2
@@ -14,8 +14,6 @@ export interface ITerminal extends IPublicTerminal, ICoreTerminal {
|
||||
element: HTMLElement | undefined;
|
||||
screenElement: HTMLElement | undefined;
|
||||
browser: IBrowser;
|
||||
buffer: IBuffer;
|
||||
buffers: IBufferSet;
|
||||
viewport: IViewport | undefined;
|
||||
// TODO: We should remove options once components adopt optionsService
|
||||
options: ITerminalOptions;
|
||||
|
||||
Vendored
+6
@@ -8,10 +8,16 @@ import { IEvent, IEventEmitter } from 'common/EventEmitter';
|
||||
import { IDeleteEvent, IInsertEvent } from 'common/CircularList';
|
||||
import { IParams } from 'common/parser/Types';
|
||||
import { IOptionsService, IUnicodeService } from 'common/services/Services';
|
||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||
|
||||
export interface ICoreTerminal {
|
||||
optionsService: IOptionsService;
|
||||
unicodeService: IUnicodeService;
|
||||
buffers: IBufferSet;
|
||||
registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): IDisposable;
|
||||
registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): IDisposable;
|
||||
registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise<boolean>): IDisposable;
|
||||
registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
|
||||
}
|
||||
|
||||
export interface IDisposable {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* 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';
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* 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';
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
/**
|
||||
* 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 { CoreTerminal } from 'common/CoreTerminal';
|
||||
import { ICoreTerminal } from 'common/Types';
|
||||
|
||||
export class BufferNamespaceApi implements IBufferNamespaceApi {
|
||||
private _normal: BufferApiView;
|
||||
@@ -9,7 +15,7 @@ export class BufferNamespaceApi implements IBufferNamespaceApi {
|
||||
private _onBufferChange = new EventEmitter<IBufferApi>();
|
||||
public get onBufferChange(): IEvent<IBufferApi> { return this._onBufferChange.event; }
|
||||
|
||||
constructor(private _core: CoreTerminal) {
|
||||
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));
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
/**
|
||||
* Copyright (c) 2021 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IParams } from 'common/parser/Types';
|
||||
import { CoreTerminal } from 'common/CoreTerminal';
|
||||
import { IDisposable, IFunctionIdentifier, IParser } from 'xterm';
|
||||
import { ICoreTerminal } from 'common/Types';
|
||||
|
||||
export class ParserApi implements IParser {
|
||||
constructor(private _core: CoreTerminal) { }
|
||||
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()));
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { CoreTerminal } from 'common/CoreTerminal';
|
||||
/**
|
||||
* 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: CoreTerminal) { }
|
||||
constructor(private _core: ICoreTerminal) { }
|
||||
|
||||
public register(provider: IUnicodeVersionProvider): void {
|
||||
this._core.unicodeService.register(provider);
|
||||
|
||||
Reference in New Issue
Block a user