import * as Popper from "@popperjs/core"; import { Accessor } from "solid-js"; import { DeepReadonly } from "solid-js/store"; export type Modifier = Popper.Modifier; export type Options = Popper.Options; export type Instance = Popper.Instance; export type Placement = Popper.Placement; export type VirtualElement = Popper.VirtualElement; export type State = Popper.State; export type OffsetValue = [number | null | undefined, number | null | undefined]; export type OffsetFunction = (details: { popper: Popper.Rect; reference: Popper.Rect; placement: Placement; }) => OffsetValue; export type Offset = OffsetFunction | OffsetValue; export type ModifierMap = Record>>; export type Modifiers = Popper.Options["modifiers"] | Record>>; export type UsePopperOptions = Omit & { enabled?: boolean; placement?: Options["placement"]; strategy?: Options["strategy"]; modifiers?: Options["modifiers"]; }; export interface UsePopperState { placement: Placement; update: () => void; forceUpdate: () => void; attributes: Record>; styles: Record>; state?: State; } /** * Position an element relative some reference element using Popper.js * * @param referenceElement * @param popperElement * @param {object} options * @param {object=} options.modifiers Popper.js modifiers * @param {boolean=} options.enabled toggle the popper functionality on/off * @param {string=} options.placement The popper element placement relative to the reference element * @param {string=} options.strategy the positioning strategy * @param {function=} options.onCreate called when the popper is created * @param {function=} options.onUpdate called when the popper is updated * * @returns {UsePopperState} The popper state accessor */ export declare function usePopper(referenceElement: () => VirtualElement | null | undefined, popperElement: () => HTMLElement | null | undefined, options: DeepReadonly): Accessor; export default usePopper;