UNPKG

1.21 kBTypeScriptView Raw
1import type { PositioningStrategy, Offsets, Modifier, Rect } from "../types";
2import { BasePlacement, Variation } from "../enums";
3export declare type RoundOffsets = (offsets: Partial<{
4 x: number;
5 y: number;
6 centerOffset: number;
7}>) => Offsets;
8export declare type Options = {
9 gpuAcceleration: boolean;
10 adaptive: boolean;
11 roundOffsets?: boolean | RoundOffsets;
12};
13export declare function mapToStyles({ popper, popperRect, placement, variation, offsets, position, gpuAcceleration, adaptive, roundOffsets, isFixed }: {
14 popper: HTMLElement;
15 popperRect: Rect;
16 placement: BasePlacement;
17 variation: Variation | null | undefined;
18 offsets: Partial<{
19 x: number;
20 y: number;
21 centerOffset: number;
22 }>;
23 position: PositioningStrategy;
24 gpuAcceleration: boolean;
25 adaptive: boolean;
26 roundOffsets: boolean | RoundOffsets;
27 isFixed: boolean;
28}): {
29 transform: string;
30 top: string;
31 right: string;
32 bottom: string;
33 left: string;
34 position: PositioningStrategy;
35};
36export declare type ComputeStylesModifier = Modifier<"computeStyles", Options>;
37declare const _default: ComputeStylesModifier;
38export default _default;