import type { Interactable } from '@interactjs/core/Interactable'; import type { DoAnyPhaseArg } from '@interactjs/core/Interaction'; import type { Scope, Plugin } from '@interactjs/core/scope'; import type { ActionName, ActionProps } from '@interactjs/core/types'; declare module '@interactjs/core/scope' { interface SignalArgs { 'interactions:before-action-reflow': Omit; 'interactions:action-reflow': DoAnyPhaseArg; 'interactions:after-action-reflow': DoAnyPhaseArg; } } declare module '@interactjs/core/Interactable' { interface Interactable { /** * ```js * const interactable = interact(target) * const drag = { name: drag, axis: 'x' } * const resize = { name: resize, edges: { left: true, bottom: true } * * interactable.reflow(drag) * interactable.reflow(resize) * ``` * * Start an action sequence to re-apply modifiers, check drops, etc. * * @param { Object } action The action to begin * @param { string } action.name The name of the action * @returns { Promise } A promise that resolves to the `Interactable` when actions on all targets have ended */ reflow(action: ActionProps): ReturnType; } } declare module '@interactjs/core/Interaction' { interface Interaction { _reflowPromise: Promise; _reflowResolve: (...args: unknown[]) => void; } } declare module '@interactjs/core/InteractEvent' { interface PhaseMap { reflow?: true; } } declare function doReflow(interactable: Interactable, action: ActionProps, scope: Scope): Promise; declare const reflow: Plugin; export default reflow;