import { Rectangle, Scrollbar, Session, SomeRequired, WidgetModel } from '../index'; export type ScrollDirection = 'x' | 'y' | 'both'; export interface ScrollbarInstallOptions extends WidgetModel { /** * Default is both */ axis?: ScrollDirection; borderless?: boolean; mouseWheelNeedsShift?: boolean; nativeScrollbars?: boolean; hybridScrollbars?: boolean; /** * Controls the scroll shadow behavior: *
*/ uninstall($container: JQuery, session: Session): void; /** * Recalculates the scrollbar size and position. * @param $scrollable JQuery element that has .data('scrollbars'), when $scrollable is falsy the function returns immediately * @param immediate set to true to immediately update the scrollbar. If set to false, it will be queued in order to prevent unnecessary updates. */ update($scrollable: JQuery, immediate?: boolean): void; /** @internal */ _update(scrollbarArr: Scrollbar[]): void; /** * IOS has problems with nested scrollable containers. Sometimes the outer container goes completely white hiding the elements behind. * This happens with the following case: Main box is scrollable but there are no scrollbars because content is smaller than container. * In the main box there is a tab box with a scrollable table. This table has scrollbars. * If the width of the tab box is adjusted (which may happen if the tab item is selected and eventually prefSize called), the main box will go white. *
* This happens only if -webkit-overflow-scrolling is set to touch.
* To work around this bug the flag -webkit-overflow-scrolling will be removed if the scrollable component won't display any scrollbars
* @internal
*/
_handleIosPaintBug($scrollable: JQuery): void;
reset($scrollable: JQuery): void;
reveal($element: JQuery, options?: ScrollToOptions | ScrollToAlignment): void;
/**
* Scrolls the $scrollable to the given $element.
*
* @param $scrollable
* the scrollable object
* @param $element
* the element to scroll to
* @param opts
* Shorthand version: If a string is passed instead
* of an object, the value is automatically converted to the option {@link ScrollToOptions.align}.
*/
scrollTo($scrollable: JQuery, $element: JQuery, opts?: ScrollToOptions | ScrollToAlignment): void;
/** @internal */
_createDefaultScrollToOptions(options?: ScrollbarInstallOptions): ScrollToOptions;
/**
* Horizontally scrolls the $scrollable to the given $element.
*
* @param $scrollable
* the scrollable object
* @param $element
* the element to scroll to
*/
scrollHorizontalTo($scrollable: JQuery, $element: JQuery, options?: ScrollHorizontalToOptions): void;
/**
* @param $scrollable the scrollable object
* @param scrollTop the new scroll position
*/
scrollTop($scrollable: JQuery, scrollTop: number, options?: ScrollOptions): void;
/**
* @param $scrollable the scrollable object
* @param scrollLeft the new scroll position
*/
scrollLeft($scrollable: JQuery, scrollLeft: number, options?: ScrollOptions): void;
animateScrollTop($scrollable: JQuery, scrollTop: number): void;
animateScrollLeft($scrollable: JQuery, scrollLeft: number): void;
scrollbar($scrollable: JQuery, axis: "x" | "y"): Scrollbar;
scrollToBottom($scrollable: JQuery, options?: ScrollOptions): void;
/**
* Computes whether the given location is in the viewport of the given $scrollables.
*
* @param $scrollables one or more scrollables to check against
* @returns true if the location is visible in the current viewport of the $scrollables or if $scrollables is null.
*/
isLocationInView(location: {
x: number;
y: number;
}, $scrollables: JQuery): boolean;
/**
* Clips the given bounds and removes the parts that are not in the current viewport of the given $scrollables.
*
* @param $scrollables one or more scrollables to check against
* @returns the intersection between the bounds and the viewports of the $scrollables.
* If $scrollables is null or empty, the given bounds are returned without clipping.
*/
intersectViewport(bounds: Rectangle, $scrollables: JQuery): Rectangle;
/**
* Attaches the given handler to each scrollable parent, including $anchor if it is scrollable as well.
* Make sure you remove the handlers when not needed anymore using offScroll.
*/
onScroll($anchor: JQuery, handler: (event: JQuery.ScrollEvent) => void): void;
offScroll(handler: (event: JQuery.ScrollEvent) => void): void;
/**
* Sets the position to fixed and updates left and top position.
* This is necessary to prevent flickering in IE.
*/
fix($elem: JQuery): void;
/**
* Reverts the changes made by fix().
*/
unfix($elem: JQuery, timeoutId: number, immediate?: boolean): number;
/** @internal */
_unfix($elem: JQuery): void;
/**
* Stores the position of all scrollables that belong to an optional session.
* @param [session] when no session is given, scrollables from all sessions are stored
*/
storeScrollPositions($container: JQuery, session?: Session): void;
/**
* Restores the position of all scrollables that belong to an optional session.
* @param session when no session is given, scrollables from all sessions are restored
*/
restoreScrollPositions($container: JQuery, session?: Session): void;
setVisible($scrollable: JQuery, visible: boolean): void;
opacity($scrollable: JQuery, opacity: number): void;
/** @internal */
_getCompleteChildRowsHeightRecursive(children: ExpandableElement[], getChildren: (element: ExpandableElement) => ExpandableElement[], isExpanded: (element: ExpandableElement) => boolean, defaultChildHeight: number): number;
ensureExpansionVisible