import { XCoordConfig } from "./getCoord"; import { FixedPositionOptions, HorizontalPosition } from "./types"; /** * @private */ interface XPosition { left: number; right?: number; width?: number; minWidth?: number; actualX: HorizontalPosition; } /** * @private */ export interface FixConfig extends XCoordConfig { vwMargin: number; screenRight: number; disableSwapping: boolean; } /** * @private */ interface Options extends Required> { x: HorizontalPosition; vw: number; elWidth: number; initialX?: number; containerRect: DOMRect | ClientRect; } /** * Attempts to position the fixed element so that it will appear to the left of * the container element but also within the viewport boundaries. When swapping * is enabled, it will attempt to swap to the right position if it can't fit * within the viewport to the left. If it can't fit in the viewport even after * being swapped to the right or swapping is disabled, it will be positioned to * the viewport left boundary. * * @private */ export declare function createAnchoredLeft(config: FixConfig): XPosition; /** * Attempts to position the fixed element so that it will appear to the * inner-left of the container element but also within the viewport boundaries. * When swapping is enabled, it will attempt to swap to the right position if it * can't fit within the viewport to the left. If it can't fit in the viewport * even after being swapped to the right or swapping is disabled, it will be * positioned to the viewport left boundary. * * @private */ export declare function createAnchoredInnerLeft(config: FixConfig): XPosition; /** * Attempts to position the fixed element so that it will appear at the center * of the container element but also within the viewport boundaries. If the * centered element can't fit within the viewport, it will use the vwMargin * value if it overflowed to the left, it'll position to the screen right * boundary. * * @private */ export declare function createAnchoredCenter(config: FixConfig): XPosition; /** * Attempts to position the fixed element so that it will appear to the * inner-right of the container element but also within the viewport boundaries. * When swapping is enabled, it will attempt to swap to the inner-left position * if it can't fit within the viewport to the right. If it can't fit in the * viewport even after being swapped to the left or swapping is disabled, it * will be positioned to the viewport right boundary. * * @private */ export declare function createAnchoredInnerRight(config: FixConfig): XPosition; /** * Attempts to position the fixed element so that it will appear to the right of * the container element but also within the viewport boundaries. When swapping * is enabled, it will attempt to swap to the left position if it can't fit * within the viewport to the right. If it can't fit in the viewport even after * being swapped to the left or swapping is disabled, it will be positioned to * the viewport right boundary. * * @private */ export declare function createAnchoredRight(config: FixConfig): XPosition; interface EqualWidthOptions extends Pick { isMinWidth: boolean; } /** * @private */ export declare function createEqualWidth({ x, vw, elWidth, xMargin, vwMargin, initialX, containerRect, isMinWidth, }: EqualWidthOptions): XPosition; /** * Creates the horizontal position for a fixed element with the provided * options. * @private */ export default function createHorizontalPosition({ x, vw, vwMargin, xMargin, width, elWidth, initialX, containerRect, disableSwapping, }: Options): XPosition; export {};