import * as i0 from '@angular/core';
import { OnDestroy, AfterViewInit, EventEmitter } from '@angular/core';
/** @internal */
declare enum ScrollContainerAxis {
x = "x",
y = "y"
}
/**
* Dimensions of the scroll container, scroll offset and content.
*/
interface ScrollContainerDimensions {
/**
* Height of the scroll container
*/
offsetHeight: number;
/**
* Width of the scroll container
*/
offsetWidth: number;
/**
* Vertical scroll offset
*/
scrollTop: number;
/**
* Horizontal scroll offset
*/
scrollLeft: number;
/**
* Full height of the content
*/
scrollHeight: number;
/**
* Full width of the content
*/
scrollWidth: number;
}
/**
* Applies styling for the browser's default scrollbars. Does not affect
* scrolling behaviour.
*
* ### Import
*
* ```typescript
* import { ScrollContainerModule } from '@talenra/ngx-base/scroll-container';
* ```
*
* ../../#/content-control/scroll-container
*/
declare class ScrollContainerComponent implements OnDestroy, AfterViewInit {
private options;
private SimpleBar;
/**
* **Experimental:** Set whether the scrollbar is placed on top of the scrolling content.
*
* @experimental
*/
set useOverlay(value: boolean);
/**
* **Experimental:** Get whether the scrollbar is placed on top of the scrolling content.
*
* @experimental
*/
get useOverlay(): boolean;
private _useOverlay;
/**
* Reference to the scroll element. This is the HTML element with the relevant `scrollTop` and `scrollLeft`
* properties. It is available after the content is initialized. Use this reference to implement custom scroll
* behavior.
*
* ```typescript
* import { ScrollContainerComponent } from '@talenra/ngx-base/scroll-container';
*
* // ...
*
* @ViewChild(ScrollContainerComponent)
* private scrollContainer!: ScrollContainerComponent;
*
* ngAfterViewInit(): void {
* // The element is available once the view is initialized
* const elm: HTMLElement = this.scrollContainer.scrollElement;
* // Read relevant properties
* console.log(elm.scrollWidth, elm.clientWidth, elm.scrollLeft, elm.scrollHeight, elm.clientHeight, elm.scrollTop);
* }
* ```
*/
scrollElement: HTMLElement;
/**
* Determines whether the scrollbar has offset (is shorter than the content).
*/
set useOffset(value: boolean);
/**
* Get whether the scrollbar has offset (is shorter than the content).
*/
get useOffset(): boolean;
private _useOffset;
/**
* Determines how sensitive `updatedScrollYOffset` is triggered. Lower values will trigger earlier. E.g. a value of
* `10` will trigger `updatedScrollYOffset` if the scroll-container has a scroll-offset of `10px` or more.
*/
scrollYThreshold: number;
/**
* Triggered whenever the scroll-container's `scrollTop` property exceedes or undercuts `scrollYThreshold` value.
* Use this hook if you need to know whether the scroll-container has scroll-offset. Use `scrollYThreshold` to
* adjust the sensitivity.
*/
updatedScrollYOffset: EventEmitter;
/**
* Returns dimensions of the scroll container.
*/
get dimensions(): ScrollContainerDimensions;
/**
* Sets the vertical scroll offset.
*/
set scrollTop(offset: number);
/**
* Sets the horizontal scroll offset.
*/
set scrollLeft(offset: number);
/** @internal */
showTrack: {
x: boolean;
y: boolean;
};
private hasScrollYOffset;
private hideTrackItvl;
private trackTimeout;
private lastScrollOffset;
private readonly elementRef;
private readonly changeDetector;
private readonly destroyRef;
/** @internal */
ngAfterViewInit(): void;
/**
* Some edge cases (e.g. changing the layout programmatically) might require recalculating the scroll logic. For
* regular content updated, this is not necessary.
*
* This is used library internally but not officially exposed in the public API. This might change once we have a
* solid use case for it.
*
* @internal
*/
recalculate(): void;
private onScroll;
private hideTrack;
/** @internal */
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
static ngAcceptInputType_useOverlay: unknown;
static ngAcceptInputType_useOffset: unknown;
static ngAcceptInputType_scrollYThreshold: unknown;
}
export { ScrollContainerAxis, ScrollContainerComponent };
export type { ScrollContainerDimensions };