/** * Attaches a natural hide/show behavior to a sticky element placed at the bottom. * * This function creates a smooth, natural-feeling bottom element (like a footer) that: * - Hides when scrolling up by naturally scrolling with the content * - Shows when scrolling down by positioning itself just below the viewport to scroll into view naturally * - Becomes sticky at the bottom when fully visible during downward scroll * - Releases from sticky position when scrolling up to allow natural hiding * * Key characteristics of the bottom implementation: * - Uses 'bottom' property for sticky positioning (unlike top which uses 'top') * - When releasing from sticky on scroll up, calculates position relative to document end * - When moving below viewport on scroll down, positions element just below viewport * - Transitions to sticky using scroll step prediction to avoid visual gaps (predicted elementRect.bottom <= window.innerHeight) * - More complex positioning calculations due to bottom-anchored nature and document height considerations * * The script dispatches a `natural-sticky` event with the following states in `event.detail.state`: * - 'sticky': The element is stuck to the bottom of the viewport. * - 'home': The element is at its original position at the bottom of the document. * - 'relative': The element is scrolling with the page content. * * @param element - The HTML element to make naturally sticky * @param options - Configuration options * @param options.snapEagerness - How eagerly the element snaps into sticky position (default: 1) * - 0: Pure natural movement, occasional visual gaps * - 1: Balanced behavior (recommended) * - 2-3: Reduced gaps, element "snaps" more eagerly to position * - Higher: Strong snap effect, immediate attraction to edge * @param options.scrollThreshold - Minimum scroll speed (pixels/event) to trigger natural scroll-in effect (default: 0) * - 0: Always activate scroll-in effect (current behavior) * - 2: Low threshold for gentle filtering * - 10: Medium threshold for deliberate scrolling * - 25: High threshold for fast scrolling only * @param options.reserveSpace - Whether to reserve document flow space when sticky (default: true) * - true: Traditional sticky behavior (sticky/relative positioning) - reserves space in document flow * - false: Floating behavior (fixed/relative positioning) - no space reserved, element floats above content */ export declare function naturalStickyBottom(element: HTMLElement, options?: { snapEagerness?: number; scrollThreshold?: number; reserveSpace?: boolean; }): { destroy: () => void; }; export default naturalStickyBottom;