import type { SizeType } from "../../types"; import type { Dimension } from "../../types/alignment"; import type { Component } from "../../types/component"; import type { StackProps } from "../../types/components/stack"; import type { CSS } from "../../utils/base-utils"; import { type ConditionContext } from "../../utils/style-utils"; export type ScrollAxis = "x" | "y"; /** * The axis a stack scrolls along, like the native SDKs: horizontal stacks * scroll sideways, vertical ones down. The root is already the paywall's * vertical scroller, and z-layers never scroll. */ export declare function stackScrollAxis(dimension: Dimension["type"], rootStack: boolean): ScrollAxis | null; /** * How the paywall's root stack scrolls, the one place that decides it. Like * the SDKs it scrolls down unless its overflow is "default", and a horizontal * root set to scroll also scrolls sideways. */ export declare function rootScrollStyle(overflow: StackProps["overflow"], axis: ScrollAxis | null): CSS; /** * Like the SDKs, a Fit stack that scrolls takes the space its parent leaves * it, up to its content, then scrolls. Along the parent's axis it shrinks * first, so a parent that grows with its content never caps it. Across a row * with a set height it stops at the row's height and keeps the row's * alignment. A Fit row's height comes from its other children, where a * percentage max-height doesn't resolve, so it stretches to the row instead. * With no parent stack (a Fit root) it stops at its container. Inside a parent * that scrolls the same way it keeps its full size. */ export declare function fitScrollSizing(axis: ScrollAxis | null, size: SizeType, parentDimension: Dimension["type"] | undefined, parentScrollAxis: ScrollAxis | null | undefined, parentHasSetHeight?: boolean): CSS; /** * The axis a Fit stack gives way along because a Fit stack inside it scrolls * there. In the SDKs the scroll view makes its Fit parents take the space * they're offered, so they size like a scroller, without scrolling. */ export declare function fitScrollerParentAxis(size: SizeType, components: Component[], context: ConditionContext): ScrollAxis | null; /** * What stops a sheet's contents stack that scrolls: a Fit stack stops at the * screen's height, as the paywall's root does, and a stack with a set or Fill * height at that height. A Fit sheet gives Fill contents no height to fill, so * the sheet takes the screen's height for them. Either way the stack scrolls * itself. */ export declare function sheetScrollBound(contents: Pick, sheetHeight: SizeType["height"]["type"]): "screen" | "full-screen" | "stack" | null; /** * Whether a stack's height is set (Fill, Fixed or the paywall's root) rather * than coming from its children, so a child's percentage height resolves. */ export declare function stackHasSetHeight(size: SizeType, rootStack: boolean): boolean; type GetHasSetHeight = () => boolean; /** Publishes whether this stack's height is set and returns the parent's. */ export declare function setStackSetHeightContext(context: GetHasSetHeight): GetHasSetHeight | undefined; type GetScrollAxis = () => ScrollAxis | null; /** * Publishes the axis this stack scrolls along and returns the parent's, so a * child knows when it sits inside a scroller. */ export declare function setStackScrollContext(context: GetScrollAxis): GetScrollAxis | undefined; export {};