common/public use ICoreTerminal instead of concrete

This commit is contained in:
Daniel Imms
2021-07-22 14:42:11 -07:00
parent a5c6252ff5
commit 41e4de35e9
7 changed files with 37 additions and 7 deletions
+7 -1
View File
@@ -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));