import * as CSS from 'csstype'; import { Collisions } from './collision'; import { Side, Align, Point, Size } from './geometry'; declare type GetPlacementDataOptions = { /** The rect of the target we are placing around */ targetRect?: ClientRect; /** The size of the popper to place */ popperSize?: Size; /** An optional arrow size */ arrowSize?: Size; /** An optional arrow offset (along the side, default: 20) */ arrowOffset?: number; /** The desired side */ side: Side; /** An optional side offset (distance from the side, default: 0) */ sideOffset?: number; /** The desired alignment */ align: Align; /** An optional alignment offset (distance along the side, default: 0) */ alignOffset?: number; /** An option to turn on/off the collision handling (default: true) */ shouldAvoidCollisions?: boolean; /** The tolerance used for collisions, ie. if we want them to trigger a bit earlier (default: 0) */ collisionTolerance?: number; }; declare type PlacementData = { popperStyles: CSS.Properties; arrowStyles: CSS.Properties; transformOriginStyles: CSS.Properties; adjustedSide: Side; adjustedAlign: Align; }; /** * Given all the information necessary to compute it, * this function calculates all the necessary placement data. * * It will return: * * - the styles to apply to the popper * - the styles to apply to the arrow * - some styles that could be useful to set the transform origin in the right place * - the adjusted side (because it might have changed because of collisions) * - the adjusted align (because it might have changed because of collisions) */ export declare function getPlacementData({ targetRect, popperSize, arrowSize, arrowOffset, side, sideOffset, align, alignOffset, shouldAvoidCollisions, collisionTolerance, }: GetPlacementDataOptions): PlacementData; /** * Gets an adjusted side based on collision information */ export declare function getSideAccountingForCollisions( /** The side we want to ideally position to */ side: Side, /** The collisions for this given side */ collisions: Collisions, /** The collisions for the opposite side (if we were to swap side) */ oppositeSideCollisions: Collisions): Side; /** * Gets an adjusted alignment based on collision information */ export declare function getAlignAccountingForCollisions( /** The size of the popper to place */ popperSize: Size, /** The size of the target we are placing around */ targetSize: Size, /** The final side */ side: Side, /** The desired align */ align: Align, /** The collisions */ collisions: Collisions): Align; export declare function getPlacementStylesForPoint(point: Point): CSS.Properties; export {};