import { vec } from "mafs"; import type { RefObject } from "react"; /** * Code in this file is derived from * https://github.com/stevenpetryk/mafs/blob/4520319379a2cc2df8148d8baaef1f85db117103/src/interaction/useMovable.tsx#L20-L83 * and copied here under the terms of the MIT license. * * Copyright 2021 Steven Petryk * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. */ export type Params = { gestureTarget: RefObject; onMove: (point: vec.Vector2) => unknown; onDragEnd?: () => unknown; point: vec.Vector2; constrainKeyboardMovement: KeyboardMovementConstraint; }; export type KeyboardMovementConstraint = ((point: vec.Vector2) => vec.Vector2) | { left: vec.Vector2; right: vec.Vector2; up: vec.Vector2; down: vec.Vector2; }; type DragState = { dragging: boolean; }; export declare function useDraggable(args: Params): DragState; export {};