@trellixio/roaster-coffee
Version:
Beans' product component library
39 lines • 1.82 kB
TypeScript
import * as React from 'react';
import { Placement } from '@floating-ui/react';
interface UseTooltip {
/** The placement of the tooltip relative to its target element. */
position: Placement;
/** Whether the tooltip is initially open or not. */
opened?: boolean;
/** The distance in pixels between the tooltip and its target element. */
offset: number;
/**
* A callback function that is called when the tooltip's open state changes.
* @param open - Whether the tooltip is now open or not.
*/
onOpenChange?: (open: boolean) => void;
/** The event types that trigger the tooltip to be opened. */
events: {
hover: boolean;
focus: boolean;
touch: boolean;
};
/** Additional dependencies to be passed to the `useMemo` hook that calculates the tooltip's position. */
positionDependencies: any[];
/** Whether the tooltip should be rendered inline with its target element, or appended to the body. */
inline: boolean;
}
export declare function useTooltip(settings: UseTooltip): {
x: number;
y: number;
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType> & React.MutableRefObject<import("@floating-ui/react").ReferenceType>;
floating: React.MutableRefObject<HTMLElement>;
setFloating: ((node: HTMLElement) => void) & ((node: HTMLElement) => void);
setReference: ((node: import("@floating-ui/react-dom").ReferenceType) => void) & ((node: import("@floating-ui/react").ReferenceType) => void);
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
opened: boolean;
placement: Placement;
};
export {};
//# sourceMappingURL=useTooltip.d.ts.map