-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathindex.d.ts
107 lines (94 loc) · 3.01 KB
/
index.d.ts
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import { Component, CSSProperties, SFC } from "react";
export interface ScrollbarRendererProps {
className?: string | string[];
style?: CSSProperties;
}
export interface ScrollValues {
scrollTop: number;
scrollLeft: number;
scrollHeight: number;
scrollWidth: number;
clientHeight: number;
clientWidth: number;
}
export interface ScrollbarProps {
minimalThumbsSize?: number;
fallbackScrollbarWidth?: number;
rtl?: boolean;
momentum?: boolean;
defaultStyles?: boolean;
permanentScrollbars?: boolean;
permanentScrollbarX?: boolean;
permanentScrollbarY?: boolean;
noScroll?: boolean;
noScrollX?: boolean;
noScrollY?: boolean;
tagName?: string;
className?: string | string[];
wrapperClassName?: string | string[];
contentClassName?: string | string[];
trackVerticalClassName?: string | string[];
trackHorizontalClassName?: string | string[];
thumbVerticalClassName?: string | string[];
thumbHorizontalClassName?: string | string[];
style?: CSSProperties;
wrapperStyle?: CSSProperties;
contentStyle?: CSSProperties;
trackVerticalStyle?: CSSProperties;
trackHorizontalStyle?: CSSProperties;
thumbVerticalStyle?: CSSProperties;
thumbHorizontalStyle?: CSSProperties;
onScroll?(current: ScrollValues, instance: Scrollbar): void;
onScrollStart?(instance: Scrollbar): void;
onScrollStop?(instance: Scrollbar): void;
scrollDetectionThreshold?: number;
renderWrapper?: SFC<ScrollbarRendererProps>;
renderContent?: SFC<ScrollbarRendererProps>;
renderTrackVertical?: SFC<ScrollbarRendererProps>;
renderTrackHorizontal?: SFC<ScrollbarRendererProps>;
renderThumbVertical?: SFC<ScrollbarRendererProps>;
renderThumbHorizontal?: SFC<ScrollbarRendererProps>;
}
declare class Scrollbar extends Component<ScrollbarProps> {
public scrollTop: number;
public scrollLeft: number;
public readonly scrollHeight: number;
public readonly scrollWidth: number;
public readonly clientHeight: number;
public readonly clientWidth: number;
/**
* Scroll to the top border.
*
* @returns The scrollbar instance
*/
public scrollToTop(): Scrollbar;
/**
* Scroll to the bottom border.
*
* @returns The scrollbar instance
*/
public scrollToBottom(): Scrollbar;
/**
* Scroll to the left border.
*
* @returns The scrollbar instance
*/
public scrollToLeft(): Scrollbar;
/**
* Scroll to the right border.
*
* @returns The scrollbar instance
*/
public scrollToRight(): Scrollbar;
/**
* Updates the scrollbars. By default, this does nothing if content and
* wrapper sizes are unchanged.
*
* @param forced Whether to update the scrollbars even if nothing changed.
* @param rtlAutodetect Whether to check CSS direction value.
*
* @returns The scrollbar instance.
*/
public update(forced?: boolean, rtlAutodetect?: boolean): Scrollbar;
}
export default Scrollbar;