Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
/// <reference types="react" />
|
|
import { Transform } from '@dnd-kit/utilities';
|
|
import { Data } from '../store';
|
|
import type { UniqueIdentifier } from '../types';
|
|
import { SyntheticListenerMap } from './utilities';
|
|
export interface UseDraggableArguments {
|
|
id: UniqueIdentifier;
|
|
data?: Data;
|
|
disabled?: boolean;
|
|
attributes?: {
|
|
role?: string;
|
|
roleDescription?: string;
|
|
tabIndex?: number;
|
|
};
|
|
}
|
|
export interface DraggableAttributes {
|
|
role: string;
|
|
tabIndex: number;
|
|
'aria-disabled': boolean;
|
|
'aria-pressed': boolean | undefined;
|
|
'aria-roledescription': string;
|
|
'aria-describedby': string;
|
|
}
|
|
export declare type DraggableSyntheticListeners = SyntheticListenerMap | undefined;
|
|
export declare function useDraggable({ id, data, disabled, attributes, }: UseDraggableArguments): {
|
|
active: import("../store").Active | null;
|
|
activatorEvent: Event | null;
|
|
activeNodeRect: import("../types").ClientRect | null;
|
|
attributes: DraggableAttributes;
|
|
isDragging: boolean;
|
|
listeners: SyntheticListenerMap | undefined;
|
|
node: import("react").MutableRefObject<HTMLElement | null>;
|
|
over: import("../store").Over | null;
|
|
setNodeRef: (element: HTMLElement | null) => void;
|
|
setActivatorNodeRef: (element: HTMLElement | null) => void;
|
|
transform: Transform | null;
|
|
};
|