UNPKG

2.25 kBTypeScriptView Raw
1// Type definitions for react-custom-scrollbars 4.0
2// Project: https://github.com/malte-wessel/react-custom-scrollbars
3// Definitions by: kittimiyo <https://github.com/kittimiyo>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 2.8
6
7import * as React from "react";
8
9export as namespace ReactCustomScrollbars;
10
11export interface positionValues {
12 top: number;
13 left: number;
14 clientWidth: number;
15 clientHeight: number;
16 scrollWidth: number;
17 scrollHeight: number;
18 scrollLeft: number;
19 scrollTop: number;
20}
21
22export interface ScrollbarProps extends React.HTMLProps<Scrollbars> {
23 onScroll?: React.UIEventHandler<any> | undefined;
24 onScrollFrame?: ((values: positionValues) => void) | undefined;
25 onScrollStart?: (() => void) | undefined;
26 onScrollStop?: (() => void) | undefined;
27 onUpdate?: ((values: positionValues) => void) | undefined;
28
29 renderView?: React.FunctionComponent<any> | undefined;
30 renderTrackHorizontal?: React.FunctionComponent<any> | undefined;
31 renderTrackVertical?: React.FunctionComponent<any> | undefined;
32 renderThumbHorizontal?: React.FunctionComponent<any> | undefined;
33 renderThumbVertical?: React.FunctionComponent<any> | undefined;
34
35 tagName?: string | undefined;
36 hideTracksWhenNotNeeded?: boolean | undefined;
37
38 autoHide?: boolean | undefined;
39 autoHideTimeout?: number | undefined;
40 autoHideDuration?: number | undefined;
41
42 thumbSize?: number | undefined;
43 thumbMinSize?: number | undefined;
44 universal?: boolean | undefined;
45
46 autoHeight?: boolean | undefined;
47 autoHeightMin?: number | string | undefined;
48 autoHeightMax?: number | string | undefined;
49
50 style?: React.CSSProperties | undefined;
51}
52
53export class Scrollbars extends React.Component<ScrollbarProps> {
54 scrollTop(top: number): void;
55 scrollLeft(left: number): void;
56 scrollToTop(): void;
57 scrollToBottom(): void;
58 scrollToLeft(): void;
59 scrollToRight(): void;
60 getScrollLeft(): number;
61 getScrollTop(): number;
62 getScrollWidth(): number;
63 getScrollHeight(): number;
64 getClientWidth(): number;
65 getClientHeight(): number;
66 getValues(): positionValues;
67}
68
69export default Scrollbars;
70
\No newline at end of file