1 | import * as Popper from '@popperjs/core';
|
2 | declare type OptionsWithUndefined<T extends Popper.Obj | undefined> = T extends Popper.Obj ? T : Popper.Obj;
|
3 | export declare type Modifier<Name, Options extends Popper.Obj | undefined> = Popper.Modifier<Name, OptionsWithUndefined<Options>>;
|
4 | export declare type Options = Popper.Options;
|
5 | export declare type Instance = Popper.Instance;
|
6 | export declare type Placement = Popper.Placement;
|
7 | export declare type VirtualElement = Popper.VirtualElement;
|
8 | export declare type State = Popper.State;
|
9 | export declare type OffsetValue = [
|
10 | number | null | undefined,
|
11 | number | null | undefined
|
12 | ];
|
13 | export declare type OffsetFunction = (details: {
|
14 | popper: Popper.Rect;
|
15 | reference: Popper.Rect;
|
16 | placement: Placement;
|
17 | }) => OffsetValue;
|
18 | export declare type Offset = OffsetFunction | OffsetValue;
|
19 | export declare type ModifierMap = Record<string, Partial<Modifier<any, any>>>;
|
20 | export declare type Modifiers = Popper.Options['modifiers'] | Record<string, Partial<Modifier<any, any>>>;
|
21 | export declare type UsePopperOptions = Omit<Options, 'modifiers' | 'placement' | 'strategy'> & {
|
22 | enabled?: boolean;
|
23 | placement?: Options['placement'];
|
24 | strategy?: Options['strategy'];
|
25 | modifiers?: Options['modifiers'];
|
26 | };
|
27 | export interface UsePopperState {
|
28 | placement: Placement;
|
29 | update: () => void;
|
30 | forceUpdate: () => void;
|
31 | attributes: Record<string, Record<string, any>>;
|
32 | styles: Record<string, Partial<CSSStyleDeclaration>>;
|
33 | state?: State;
|
34 | }
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | declare function usePopper(referenceElement: VirtualElement | null | undefined, popperElement: HTMLElement | null | undefined, { enabled, placement, strategy, modifiers, ...config }?: UsePopperOptions): UsePopperState;
|
52 | export default usePopper;
|