import { ControllerBase, type ControllerHost } from './Abstracts/ControllerBase'; /** * Represents the `IHideOnScrollControllerConfig` interface. * * @public */ export interface IHideOnScrollControllerConfig { /** * Indicates if the host element should hide on scroll. * * If false, the host element will visible anyways and will show a shadow when scrolled. */ hideOnScroll: boolean; /** * The target element for scroll events. * * This is important when the the target is not the window or the document witch been scrolled. */ scrollTargetFn?: (() => Element | null) | null; /** * The threshold for scrolling down. * * After this threshold, the host element will be hidden when scrolling down. */ scrollDownThreshold?: number; /** * The threshold for scrolling up. * * After this threshold, the host element will be shown when scrolling up. */ scrollUpThreshold?: number; /** * The scroll behavior of the host element. * * - `auto`: The host element will hide and show based on the scroll direction. * - `follow`: The host element will follow what the user is doing. */ behavior?: 'auto' | 'follow'; } /** * The `HideOnScrollController` class is a reactive controller that handles scroll-related functionality. * This controller sets the following attributes on the host element: * - `data-shadow`: Indicates if the host element has a shadow. * - `data-visible`: Indicates if the host element is visible. * - `data-fixed`: Indicates if the host element is fixed. * - `data-animated`: Indicates if the host element is animated. * * @remarks * Keep in mind that this controller only sets the attributes and not the styles. * If you want to style the host element based on these attributes, you need to do it manually. * * @public */ export declare class HideOnScrollController extends ControllerBase { private static readonly SHADOW_ATTR; private static readonly VISIBLE_ATTR; private static readonly FIXED_ATTR; private static readonly ANIMATED_ATTR; private _hideOnScroll; private _scrollTargetFn; private _scrollUpThreshold; private _scrollDownThreshold; private _behavior; private _scrollElement; private _scrollEventsController; private _scrollFunction; private _lastScroll; private _headerOnTop; /** * Constructs a new instance of the `HideOnScrollController` class. * * @public */ constructor(host: ControllerHost, config: IHideOnScrollControllerConfig); /** * Gets or sets the `hideOnScroll` property. * * @public */ get hideOnScroll(): boolean; set hideOnScroll(value: boolean); /** * Gets or sets the `scrollTargetFn` property. * * @public */ get scrollTargetFn(): (() => Element | null) | null; set scrollTargetFn(value: (() => Element | null) | null); /** * Gets or sets the `scrollUpThreshold` property. * * @public */ get scrollUpThreshold(): number; set scrollUpThreshold(value: number); /** * Gets or sets the `scrollDownThreshold` property. * * @public */ get scrollDownThreshold(): number; set scrollDownThreshold(value: number); /** * Gets or sets the `behavior` property. * * @public */ get behavior(): 'auto' | 'follow'; set behavior(value: 'auto' | 'follow'); /** * @public * @override */ hostFirstUpdated(): void; /** * @public * @override */ hostDisconnected(): void; /** * Restores the header to its original state. * * @public */ restore(): void; /** * Starts observing the scroll events. * * @public */ observe(): void; /** * Stops observing the scroll events. * * @public */ unobserve(): void; /** * Sets the scroll listener on the target element. * * @private * @param scrollOrigin - The target element for scroll events. */ private setScrollListener; /** * Returns the appropriate scroll function based on the hideOnScroll property. * * @private */ private getScrollFunction; /** * Handles the scroll events when hideOnScroll is true. * * @private */ private handleScrollWithHide; /** * Handles the scroll events when hideOnScroll is false. * * @private */ private handleScrollWithShadow; /** * Returns the requested scroll property of the scroll context. * * @private * @param property - The scroll property to retrieve. */ private getCurrentScrollProperty; /** * Checks if the scroll view is bouncing past the edge of content. * * @private * @param currentScroll - The current scroll position. */ private isBouncingAtEdge; /** * Checks if the user is scrolling down. * * @private * @param currentScroll - The current scroll position. */ private isScrollingDown; /** * Checks if the user is scrolling up past the threshold. * * @private * @param currentScroll - The current scroll position. */ private isScrollingUp; /** * Hides the header when scrolling down. * * @private */ private hideHeader; /** * Shows the header when scrolling up past the threshold. * * @private */ private showHeader; } //# sourceMappingURL=HideOnScrollController.d.ts.map