import { Base } from '@studiometa/js-toolkit'; import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit'; import { Sentinel } from '../Sentinel/index.js'; export interface StickyProps extends BaseProps { $refs: { inner: HTMLElement; }; $options: { zIndex: number; hideWhenUp: boolean; hideWhenDown: boolean; }; $children: { Sentinel: Sentinel[]; }; } /** * Sticky class. * @link https://ui.studiometa.dev/components/Sticky/ */ export declare class Sticky extends Base { /** * Config. */ static config: BaseConfig; /** * Holder for all instances. */ static instances: Set; /** * Is the component sticky? */ isSticky: boolean; /** * Is the component visible? */ isVisible: boolean; /** * Set the Y value. */ set y(value: number); /** * Get instances as array. */ get instances(): Sticky[]; /** * Get the sentinel instance. */ get sentinel(): Sentinel; /** * Mounted hook. */ mounted(): void; /** * Resized hook. */ resized(): void; /** * Destroyed hook. */ destroyed(): void; /** * Scrolled hook. */ scrolled(props: any): void; /** * Listen to the sentinel's `intersected` event to set the `isSticky` value. * @param {IntersectionObserverEntry[]} entries * @returns {void} */ onSentinelIntersected({ args: [[entry]] }: { args: [IntersectionObserverEntry[]]; }): void; /** * Hide the sticky component when another one is sticky. */ hide(): void; /** * Show the sticky component when the other one is not sticky anymore. */ show(): void; /** * Set the sentinel height based on the previous instances. */ setSentinelSize(): void; /** * Set the component's position. * @param {number} [index] The instance index in all the pages' instances. * @returns {void} */ setPosition(index?: number): void; /** * Find the first parent which has a relative position. */ closestRelativeElement(element: HTMLElement): HTMLElement; }