-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathcustomScroll.d.ts
More file actions
81 lines (81 loc) · 3.05 KB
/
Copy pathcustomScroll.d.ts
File metadata and controls
81 lines (81 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { Component, CSSProperties, UIEvent, MouseEvent, PropsWithChildren } from "react";
import { simpleDebounce } from "./utils.ts";
interface CustomScrollProps extends PropsWithChildren {
allowOuterScroll?: boolean;
heightRelativeToParent?: string;
onScroll?: (event: UIEvent) => void;
addScrolledClass?: boolean;
freezePosition?: boolean;
handleClass?: string;
minScrollHandleHeight?: number;
flex?: string;
rtl?: boolean;
scrollTo?: number;
keepAtBottom?: boolean;
alwaysVisible?: boolean;
className?: string;
}
interface CustomScrollState {
scrollPos: number;
onDrag: boolean;
visible: boolean;
}
export declare class CustomScroll extends Component<CustomScrollProps, CustomScrollState> {
scrollbarYWidth: number;
hideScrollThumb: ReturnType<typeof simpleDebounce>;
contentHeight: number;
visibleHeight: number;
scrollHandleHeight: number;
scrollRatio: number;
hasScroll: boolean;
startDragHandlePos: number;
startDragMousePos: number;
constructor(props: CustomScrollProps);
componentDidMount(): void;
componentDidUpdate(prevProps: CustomScrollProps, prevState: CustomScrollState): void;
componentWillUnmount(): void;
customScrollRef: import("react").RefObject<HTMLDivElement | null>;
innerContainerRef: import("react").RefObject<HTMLDivElement | null>;
customScrollbarRef: import("react").RefObject<HTMLDivElement | null>;
scrollHandleRef: import("react").RefObject<HTMLDivElement | null>;
contentWrapperRef: import("react").RefObject<HTMLDivElement | null>;
adjustFreezePosition: (prevProps: CustomScrollProps) => void;
toggleScrollIfNeeded: () => void;
updateScrollPosition: (scrollValue: number) => void;
onClick: (event: MouseEvent) => void;
isMouseEventOnCustomScrollbar: (event: MouseEvent) => boolean;
isMouseEventOnScrollHandle: (event: MouseEvent) => boolean;
calculateNewScrollHandleTop: (clickEvent: MouseEvent) => number;
getScrollValueFromHandlePosition: (handlePosition: number) => number;
getScrollHandleStyle: () => {
height: number;
top: number;
};
adjustCustomScrollPosToContentPos: (scrollPosition: number) => void;
onScroll: (event: UIEvent) => void;
getScrolledElement: () => HTMLElement;
onMouseDown: (event: MouseEvent) => void;
onTouchStart: () => void;
onHandleDrag: (event: MouseEvent<HTMLElement>) => void;
onHandleDragEnd: (e: MouseEvent<HTMLElement>) => void;
getInnerContainerClasses: () => "rcs-inner-container rcs-content-scrolled" | "rcs-inner-container";
getScrollStyles: () => {
innerContainer: CSSProperties;
contentWrapper: CSSProperties;
};
getOuterContainerStyle: () => {
height: string;
};
getRootStyles: () => CSSProperties;
enforceMinHandleHeight: (calculatedStyle: {
height: number;
top: number;
}) => {
height: number;
top: number;
};
onMouseEnter: () => void;
onMouseLeave: () => void;
render(): import("react/jsx-runtime").JSX.Element;
}
export {};