Introduce mouse service

This commit is contained in:
Daniel Imms
2019-06-15 19:40:51 -07:00
parent 20809a042f
commit a4d18a3b23
15 changed files with 182 additions and 161 deletions
+11 -1
View File
@@ -4,7 +4,7 @@
*/
import { IEvent, EventEmitter } from 'common/EventEmitter';
import { ICharSizeService } from 'browser/services/Services';
import { ICharSizeService, IMouseService } from 'browser/services/Services';
export class MockCharSizeService implements ICharSizeService {
get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
@@ -12,3 +12,13 @@ export class MockCharSizeService implements ICharSizeService {
constructor(public width: number, public height: number) {}
measure(): void {}
}
export class MockMouseService implements IMouseService {
public getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined {
throw new Error('Not implemented');
}
public getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined {
throw new Error('Not implemented');
}
}