import React from 'react'; import { FloatingContext, ReferenceType, Padding } from '@floating-ui/react-dom-interactions'; export declare const isEnabled: (value: null | undefined | false | { enabled?: boolean; }, defaultValue: boolean) => boolean; export declare type Placement = 'top' | 'bottom' | 'right' | 'left' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end'; export declare type Alignment = 'start' | 'end'; /** * Changes the placement of the floating element to the opposite one by default in order to keep it in view. Default: Enabled * * fallbackPlacements - This describes the array of placements to try if the preferred placement doesn't fully fit on the axes in which overflow is checked. Default: [oppositePlacement] */ interface FlipConfig { enabled: boolean; fallbackPlacements?: Placement[]; padding?: Padding; } declare const DefaultOffsetConfig: { enabled: boolean; offset: [number, number]; }; /** * Offset configuration: Default: enabled * * offset - [mainAxis, crossAxis]: Default: [6, 0] * * mainAxis - Represents the distance (gutter or margin) between the floating element and the reference element. * * crossAxis - Represents the skidding between the floating element and the reference element. * * Examples: * [6, 0] (Placement: right) - Position offset by 6 pixels to right from the position * [-6, 0] (Placement: right) - Position offset by 6 pixels to left from the position * [0, 6] (Placement: right) - Position offset by 5 pixels to bottom from the position */ declare type OffsetConfig = Partial; /** * Chooses the placement that has the most space available automatically. Default: disabled * * alignment - By specifying an alignment, it will choose those aligned placements. */ declare type AutoConfig = { enabled?: boolean; alignment?: Alignment | null; }; export declare type Options = { placement: Placement; auto: AutoConfig | null | false; flip: FlipConfig | null | false; offset: OffsetConfig | null | false; shift: Pick | null | false; }; export declare type AutoPosition = { _context: FloatingContext; _open: boolean; triggerRef: React.RefCallback; floatRef: React.RefCallback; styles: React.CSSProperties; }; /** * Calculate position of "floating" elements like tooltips, popovers, dropdowns, menus, and more. * @param config Options to modify the behavior */ export declare const useAutoPosition: (config?: Partial) => AutoPosition; export default useAutoPosition;