import type { Interactable } from '@interactjs/core/Interactable'; import type { EventPhase } from '@interactjs/core/InteractEvent'; import type Interaction from '@interactjs/core/Interaction'; import type { EdgeOptions, FullRect, Point, Rect } from '@interactjs/core/types'; export interface Modifier { options: Defaults; methods: { start?: (arg: ModifierArg) => void; set?: (arg: ModifierArg) => Result; beforeEnd?: (arg: ModifierArg) => Point | void; stop?: (arg: ModifierArg) => void; }; name?: Name; enable: () => Modifier; disable: () => Modifier; } export type ModifierState = { options: Defaults; methods?: Modifier['methods']; index?: number; name?: Name; } & StateProps; export interface ModifierArg { interaction: Interaction; interactable: Interactable; phase: EventPhase; rect: FullRect; edges: EdgeOptions; state: State; element: Element; pageCoords: Point; prevCoords: Point; prevRect?: FullRect; coords: Point; startOffset: Rect; preEnd?: boolean; } export interface ModifierModule { defaults?: Defaults; start?(arg: ModifierArg): void; set?(arg: ModifierArg): Result; beforeEnd?(arg: ModifierArg): Point | void; stop?(arg: ModifierArg): void; } export interface ModifierFunction { (_options?: Partial): Modifier; _defaults: Defaults; _methods: ModifierModule; }