Move SelectionModel to browser, fix strict

This commit is contained in:
Daniel Imms
2019-06-15 23:28:51 -07:00
parent 9980457eef
commit 6e90b7371b
5 changed files with 36 additions and 36 deletions
+11 -5
View File
@@ -8,14 +8,18 @@ import { IEvent, EventEmitter } from 'common/EventEmitter';
import { clone } from 'common/Clone';
import { DEFAULT_OPTIONS } from 'common/services/OptionsService';
import { IBufferSet, IBuffer } from 'common/buffer/Types';
import { BufferSet } from 'common/buffer/BufferSet';
export class MockBufferService implements IBufferService {
public buffer: IBuffer = {} as any;
public get buffer(): IBuffer { return this.buffers.active; }
public buffers: IBufferSet = {} as any;
constructor(
public cols: number,
public rows: number
) {}
public rows: number,
optionsService: IOptionsService = new MockOptionsService()
) {
this.buffers = new BufferSet(optionsService, this);
}
resize(cols: number, rows: number): void {
this.cols = cols;
this.rows = rows;
@@ -26,8 +30,10 @@ export class MockBufferService implements IBufferService {
export class MockOptionsService implements IOptionsService {
options: ITerminalOptions = clone(DEFAULT_OPTIONS);
onOptionChange: IEvent<string> = new EventEmitter<string>().event;
constructor(testOptions: IPartialTerminalOptions) {
Object.keys(testOptions).forEach(key => this.options[key] = (<any>testOptions)[key]);
constructor(testOptions?: IPartialTerminalOptions) {
if (testOptions) {
Object.keys(testOptions).forEach(key => this.options[key] = (<any>testOptions)[key]);
}
}
setOption<T>(key: string, value: T): void {
throw new Error('Method not implemented.');