Adopt DI in browser services

This commit is contained in:
Daniel Imms
2019-07-13 22:26:13 -07:00
parent 5cc8ad802c
commit 88c88f1141
8 changed files with 55 additions and 23 deletions
+2
View File
@@ -7,6 +7,7 @@ import { IEvent, EventEmitter } from 'common/EventEmitter';
import { ICharSizeService, IMouseService } from 'browser/services/Services';
export class MockCharSizeService implements ICharSizeService {
_serviceBrand: any;
get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
onCharSizeChange: IEvent<void> = new EventEmitter<void>().event;
constructor(public width: number, public height: number) {}
@@ -14,6 +15,7 @@ export class MockCharSizeService implements ICharSizeService {
}
export class MockMouseService implements IMouseService {
_serviceBrand: any;
public getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined {
throw new Error('Not implemented');
}