import type { MutableRefObject } from "react"; export type CanvasContextRef = MutableRefObject; export type EmitterListener = (...args: any[]) => unknown; export type Emitter = Record; export type EmitterRef = MutableRefObject; export interface Point { x: number; y: number; } export declare enum HistoryItemType { Edit = 0, Source = 1 } export interface HistoryItemEdit { type: HistoryItemType.Edit; data: E; source: HistoryItemSource; } export interface HistoryItemSource { name: string; type: HistoryItemType.Source; data: S; isSelected?: boolean; editHistory: HistoryItemEdit[]; draw: (ctx: CanvasRenderingContext2D, action: HistoryItemSource) => void; isHit?: (ctx: CanvasRenderingContext2D, action: HistoryItemSource, point: Point) => boolean; } export type HistoryItem = HistoryItemEdit | HistoryItemSource; export interface History { index: number; stack: HistoryItem[]; } export interface Bounds { x: number; y: number; width: number; height: number; } export type Position = Point;