Mouse.d.ts 901 B

123456789101112131415161718192021222324252627282930313233
  1. import { RenderingContext2D } from './types';
  2. import BoundingBox from './BoundingBox';
  3. import Screen from './Screen';
  4. import { Element } from './Document';
  5. interface IEventTarget {
  6. onClick?(): void;
  7. onMouseMove?(): void;
  8. }
  9. export interface IEvent {
  10. type: string;
  11. x: number;
  12. y: number;
  13. run(eventTarget: IEventTarget): void;
  14. }
  15. export default class Mouse {
  16. private readonly screen;
  17. private working;
  18. private events;
  19. private eventElements;
  20. constructor(screen: Screen);
  21. isWorking(): boolean;
  22. start(): void;
  23. stop(): void;
  24. hasEvents(): boolean;
  25. runEvents(): void;
  26. checkPath(element: Element, ctx: RenderingContext2D): void;
  27. checkBoundingBox(element: Element, boundingBox: BoundingBox): void;
  28. private mapXY;
  29. private onClick;
  30. private onMouseMove;
  31. }
  32. export {};
  33. //# sourceMappingURL=Mouse.d.ts.map