123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- import { AlignedPlacement } from '@floating-ui/utils';
- import { Alignment } from '@floating-ui/utils';
- import { Axis } from '@floating-ui/utils';
- import { ClientRectObject } from '@floating-ui/utils';
- import { Coords } from '@floating-ui/utils';
- import { Dimensions } from '@floating-ui/utils';
- import { ElementRects } from '@floating-ui/utils';
- import { Length } from '@floating-ui/utils';
- import { Padding } from '@floating-ui/utils';
- import { Placement } from '@floating-ui/utils';
- import { Rect } from '@floating-ui/utils';
- import { rectToClientRect } from '@floating-ui/utils';
- import { Side } from '@floating-ui/utils';
- import { SideObject } from '@floating-ui/utils';
- import { Strategy } from '@floating-ui/utils';
- import { VirtualElement } from '@floating-ui/utils';
- export { AlignedPlacement }
- export { Alignment }
- export declare const arrow: (options: ArrowOptions | Derivable<ArrowOptions>) => Middleware;
- export declare interface ArrowOptions {
-
- element: any;
-
- padding?: Padding;
- }
- export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable<AutoPlacementOptions>) => Middleware;
- export declare interface AutoPlacementOptions extends DetectOverflowOptions {
-
- crossAxis?: boolean;
-
- alignment?: Alignment | null;
-
- autoAlignment?: boolean;
-
- allowedPlacements?: Array<Placement>;
- }
- export { Axis }
- export declare type Boundary = any;
- export { ClientRectObject }
- export declare type ComputePosition = (reference: unknown, floating: unknown, config: ComputePositionConfig) => Promise<ComputePositionReturn>;
- export declare const computePosition: ComputePosition;
- export declare interface ComputePositionConfig {
-
- platform: Platform;
-
- placement?: Placement;
-
- strategy?: Strategy;
-
- middleware?: Array<Middleware | null | undefined | false>;
- }
- export declare interface ComputePositionReturn extends Coords {
-
- placement: Placement;
-
- strategy: Strategy;
-
- middlewareData: MiddlewareData;
- }
- export { Coords }
- export declare type Derivable<T> = (state: MiddlewareState) => T;
- export declare function detectOverflow(state: MiddlewareState, options?: DetectOverflowOptions | Derivable<DetectOverflowOptions>): Promise<SideObject>;
- export declare interface DetectOverflowOptions {
-
- boundary?: Boundary;
-
- rootBoundary?: RootBoundary;
-
- elementContext?: ElementContext;
-
- altBoundary?: boolean;
-
- padding?: Padding;
- }
- export { Dimensions }
- export declare type ElementContext = 'reference' | 'floating';
- export { ElementRects }
- export declare interface Elements {
- reference: ReferenceElement;
- floating: FloatingElement;
- }
- export declare const flip: (options?: FlipOptions | Derivable<FlipOptions>) => Middleware;
- export declare interface FlipOptions extends DetectOverflowOptions {
-
- mainAxis?: boolean;
-
- crossAxis?: boolean;
-
- fallbackPlacements?: Array<Placement>;
-
- fallbackStrategy?: 'bestFit' | 'initialPlacement';
-
- fallbackAxisSideDirection?: 'none' | 'start' | 'end';
-
- flipAlignment?: boolean;
- }
- export declare type FloatingElement = any;
- export declare const hide: (options?: HideOptions | Derivable<HideOptions>) => Middleware;
- export declare interface HideOptions extends DetectOverflowOptions {
-
- strategy?: 'referenceHidden' | 'escaped';
- }
- export declare const inline: (options?: InlineOptions | Derivable<InlineOptions>) => Middleware;
- export declare interface InlineOptions {
-
- x?: number;
-
- y?: number;
-
- padding?: Padding;
- }
- export { Length }
- export declare const limitShift: (options?: LimitShiftOptions | Derivable<LimitShiftOptions>) => {
- options: any;
- fn: (state: MiddlewareState) => Coords;
- };
- declare type LimitShiftOffset = number | {
-
- mainAxis?: number;
-
- crossAxis?: number;
- };
- export declare interface LimitShiftOptions {
-
- offset?: LimitShiftOffset | Derivable<LimitShiftOffset>;
-
- mainAxis?: boolean;
-
- crossAxis?: boolean;
- }
- export declare type Middleware = {
- name: string;
- options?: any;
- fn: (state: MiddlewareState) => Promisable<MiddlewareReturn>;
- };
- export declare type MiddlewareArguments = MiddlewareState;
- export declare interface MiddlewareData {
- [key: string]: any;
- arrow?: Partial<Coords> & {
- centerOffset: number;
- alignmentOffset?: number;
- };
- autoPlacement?: {
- index?: number;
- overflows: Array<{
- placement: Placement;
- overflows: Array<number>;
- }>;
- };
- flip?: {
- index?: number;
- overflows: Array<{
- placement: Placement;
- overflows: Array<number>;
- }>;
- };
- hide?: {
- referenceHidden?: boolean;
- escaped?: boolean;
- referenceHiddenOffsets?: SideObject;
- escapedOffsets?: SideObject;
- };
- offset?: Coords & {
- placement: Placement;
- };
- shift?: Coords & {
- enabled: {
- [key in Axis]: boolean;
- };
- };
- }
- export declare interface MiddlewareReturn extends Partial<Coords> {
- data?: {
- [key: string]: any;
- };
- reset?: boolean | {
- placement?: Placement;
- rects?: boolean | ElementRects;
- };
- }
- export declare interface MiddlewareState extends Coords {
- initialPlacement: Placement;
- placement: Placement;
- strategy: Strategy;
- middlewareData: MiddlewareData;
- elements: Elements;
- rects: ElementRects;
- platform: Platform;
- }
- export declare const offset: (options?: OffsetOptions) => Middleware;
- export declare type OffsetOptions = OffsetValue | Derivable<OffsetValue>;
- declare type OffsetValue = number | {
-
- mainAxis?: number;
-
- crossAxis?: number;
-
- alignmentAxis?: number | null;
- };
- export { Padding }
- export { Placement }
- export declare interface Platform {
- getElementRects: (args: {
- reference: ReferenceElement;
- floating: FloatingElement;
- strategy: Strategy;
- }) => Promisable<ElementRects>;
- getClippingRect: (args: {
- element: any;
- boundary: Boundary;
- rootBoundary: RootBoundary;
- strategy: Strategy;
- }) => Promisable<Rect>;
- getDimensions: (element: any) => Promisable<Dimensions>;
- convertOffsetParentRelativeRectToViewportRelativeRect?: (args: {
- elements?: Elements;
- rect: Rect;
- offsetParent: any;
- strategy: Strategy;
- }) => Promisable<Rect>;
- getOffsetParent?: (element: any) => Promisable<any>;
- isElement?: (value: any) => Promisable<boolean>;
- getDocumentElement?: (element: any) => Promisable<any>;
- getClientRects?: (element: any) => Promisable<Array<ClientRectObject>>;
- isRTL?: (element: any) => Promisable<boolean>;
- getScale?: (element: any) => Promisable<{
- x: number;
- y: number;
- }>;
- }
- declare type Promisable<T> = T | Promise<T>;
- export { Rect }
- export { rectToClientRect }
- export declare type ReferenceElement = any;
- export declare type RootBoundary = 'viewport' | 'document' | Rect;
- export declare const shift: (options?: ShiftOptions | Derivable<ShiftOptions>) => Middleware;
- export declare interface ShiftOptions extends DetectOverflowOptions {
-
- mainAxis?: boolean;
-
- crossAxis?: boolean;
-
- limiter?: {
- fn: (state: MiddlewareState) => Coords;
- options?: any;
- };
- }
- export { Side }
- export { SideObject }
- export declare const size: (options?: SizeOptions | Derivable<SizeOptions>) => Middleware;
- export declare interface SizeOptions extends DetectOverflowOptions {
-
- apply?(args: MiddlewareState & {
- availableWidth: number;
- availableHeight: number;
- }): void | Promise<void>;
- }
- export { Strategy }
- export { VirtualElement }
- export { }
|