import type { PointerState } from '@/types'; /** * Abstract base class for all tools */ export abstract class BaseTool { protected isActive = false; protected isDrawing = false; constructor(public name: string) {} /** * Called when tool is activated */ onActivate(): void { this.isActive = true; } /** * Called when tool is deactivated */ onDeactivate(): void { this.isActive = false; this.isDrawing = false; } /** * Called on pointer down */ abstract onPointerDown( pointer: PointerState, ctx: CanvasRenderingContext2D, settings: any ): void; /** * Called on pointer move */ abstract onPointerMove( pointer: PointerState, ctx: CanvasRenderingContext2D, settings: any ): void; /** * Called on pointer up */ abstract onPointerUp( pointer: PointerState, ctx: CanvasRenderingContext2D, settings: any ): void; /** * Get cursor style for this tool */ getCursor(settings: any): string { return 'crosshair'; } }