diff --git a/src/browser/Types.d.ts b/src/browser/Types.d.ts index b2ff29d7..fcae7e47 100644 --- a/src/browser/Types.d.ts +++ b/src/browser/Types.d.ts @@ -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; diff --git a/src/common/Types.d.ts b/src/common/Types.d.ts index 51f7e172..950e5e57 100644 --- a/src/common/Types.d.ts +++ b/src/common/Types.d.ts @@ -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): IDisposable; + registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise): IDisposable; + registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise): IDisposable; + registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable; } export interface IDisposable { diff --git a/src/common/public/BufferApiView.ts b/src/common/public/BufferApiView.ts index f6f12744..56ed0155 100644 --- a/src/common/public/BufferApiView.ts +++ b/src/common/public/BufferApiView.ts @@ -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'; diff --git a/src/common/public/BufferLineApiView.ts b/src/common/public/BufferLineApiView.ts index 2482adb7..60375015 100644 --- a/src/common/public/BufferLineApiView.ts +++ b/src/common/public/BufferLineApiView.ts @@ -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'; diff --git a/src/common/public/BufferNamespaceApi.ts b/src/common/public/BufferNamespaceApi.ts index 7c0f2287..c7bee600 100644 --- a/src/common/public/BufferNamespaceApi.ts +++ b/src/common/public/BufferNamespaceApi.ts @@ -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(); public get onBufferChange(): IEvent { 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)); diff --git a/src/common/public/ParserApi.ts b/src/common/public/ParserApi.ts index ffc5a0fd..67df4be5 100644 --- a/src/common/public/ParserApi.ts +++ b/src/common/public/ParserApi.ts @@ -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): IDisposable { return this._core.registerCsiHandler(id, (params: IParams) => callback(params.toArray())); diff --git a/src/common/public/UnicodeApi.ts b/src/common/public/UnicodeApi.ts index 141863dc..8a669a05 100644 --- a/src/common/public/UnicodeApi.ts +++ b/src/common/public/UnicodeApi.ts @@ -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);