volleyball-dev-frontend/node_modules/@headlessui/react/dist/hooks/use-quick-release.d.ts
Marc Wieland 33181acf83
Some checks are pending
Deploy Volleyball CMS / deploy (push) Waiting to run
Last
2025-06-02 18:56:22 +02:00

38 lines
955 B
TypeScript

declare enum ActionKind {
Ignore = 0,
Select = 1,
Close = 2
}
export declare const Action: {
/** Do nothing */
Ignore: {
readonly kind: ActionKind.Ignore;
};
/** Select the current item */
Select: (target: HTMLElement) => {
readonly kind: ActionKind.Select;
readonly target: HTMLElement;
};
/** Close the dropdown */
Close: {
readonly kind: ActionKind.Close;
};
};
type PointerEventWithTarget = Exclude<PointerEvent, 'target'> & {
target: HTMLElement;
};
export declare function useQuickRelease(enabled: boolean, { trigger, action, close, select, }: {
trigger: HTMLElement | null;
action: (e: PointerEventWithTarget) => {
kind: ActionKind.Ignore;
} | {
kind: ActionKind.Select;
target: HTMLElement;
} | {
kind: ActionKind.Close;
};
close: () => void;
select: (target: HTMLElement) => void;
}): void;
export {};