1 | import * as Popper from '@popperjs/core';
|
2 | export declare type Modifier<Name, Options> = Popper.Modifier<Name, Options>;
|
3 | export declare type Options = Popper.Options;
|
4 | export declare type Instance = Popper.Instance;
|
5 | export declare type Placement = Popper.Placement;
|
6 | export declare type VirtualElement = Popper.VirtualElement;
|
7 | export declare type State = Popper.State;
|
8 | export declare type ModifierMap = Record<string, Partial<Modifier<any, any>>>;
|
9 | export declare type Modifiers = Popper.Options['modifiers'] | Record<string, Partial<Modifier<any, any>>>;
|
10 | export declare function toModifierMap(modifiers: Modifiers | undefined): Record<string, Partial<Popper.Modifier<any, any>>>;
|
11 | export declare function toModifierArray(map?: Modifiers | undefined): Partial<Popper.Modifier<any, any>>[];
|
12 | export declare type UsePopperOptions = Omit<Options, 'modifiers' | 'placement' | 'strategy'> & {
|
13 | placement?: Options['placement'];
|
14 | strategy?: Options['strategy'];
|
15 | modifiers?: Modifiers;
|
16 | eventsEnabled?: boolean;
|
17 | enabled?: boolean;
|
18 | };
|
19 | export interface UsePopperState {
|
20 | placement: Placement;
|
21 | outOfBoundaries: boolean;
|
22 | scheduleUpdate: () => void;
|
23 | styles: Partial<CSSStyleDeclaration>;
|
24 | arrowStyles: Partial<CSSStyleDeclaration>;
|
25 | state?: State;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | declare function usePopper(referenceElement: VirtualElement | null | undefined, popperElement: HTMLElement | null | undefined, { enabled, placement, strategy, eventsEnabled, modifiers: userModifiers, ...popperOptions }?: UsePopperOptions): UsePopperState;
|
44 | export default usePopper;
|