You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

2 months ago
  1. import type { PositioningStrategy, Offsets, Modifier, Rect } from "../types";
  2. import { BasePlacement, Variation } from "../enums";
  3. export declare type RoundOffsets = (offsets: Partial<{
  4. x: number;
  5. y: number;
  6. centerOffset: number;
  7. }>) => Offsets;
  8. export declare type Options = {
  9. gpuAcceleration: boolean;
  10. adaptive: boolean;
  11. roundOffsets?: boolean | RoundOffsets;
  12. };
  13. export 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. };
  36. export declare type ComputeStylesModifier = Modifier<"computeStyles", Options>;
  37. declare const _default: ComputeStylesModifier;
  38. export default _default;