mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
This was done once already for v3 https://github.com/DefinitelyTyped/DefinitelyTyped/pull/37489
Without doing this, tsc complains that node_modules/@types/react-custom-scrollbars/index.d.ts is not a module
This change also allows importing Scrollbars as the module default `import Scrollbars from` or as a named export `import {Scollbars} from` because either work.
Documentation that this is a UMD module: f632d08e72
69 lines
2.0 KiB
TypeScript
69 lines
2.0 KiB
TypeScript
// Type definitions for react-custom-scrollbars 4.0
|
|
// Project: https://github.com/malte-wessel/react-custom-scrollbars
|
|
// Definitions by: David-LeBlanc-git <https://github.com/David-LeBlanc-git>
|
|
// kittimiyo <https://github.com/kittimiyo>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.8
|
|
|
|
import * as React from "react";
|
|
|
|
export as namespace ReactCustomScrollbars;
|
|
|
|
export interface positionValues {
|
|
top: number;
|
|
left: number;
|
|
clientWidth: number;
|
|
clientHeight: number;
|
|
scrollWidth: number;
|
|
scrollHeight: number;
|
|
scrollLeft: number;
|
|
scrollTop: number;
|
|
}
|
|
|
|
export interface ScrollbarProps extends React.HTMLProps<Scrollbars> {
|
|
onScroll?: React.UIEventHandler<any>;
|
|
onScrollFrame?: (values: positionValues) => void;
|
|
onScrollStart?: () => void;
|
|
onScrollStop?: () => void;
|
|
onUpdate?: (values: positionValues) => void;
|
|
|
|
renderView?: React.StatelessComponent<any>;
|
|
renderTrackHorizontal?: React.StatelessComponent<any>;
|
|
renderTrackVertical?: React.StatelessComponent<any>;
|
|
renderThumbHorizontal?: React.StatelessComponent<any>;
|
|
renderThumbVertical?: React.StatelessComponent<any>;
|
|
|
|
tagName?: string;
|
|
hideTracksWhenNotNeeded?: boolean;
|
|
|
|
autoHide?: boolean;
|
|
autoHideTimeout?: number;
|
|
autoHideDuration?: number;
|
|
|
|
thumbSize?: number;
|
|
thumbMinSize?: number;
|
|
universal?: boolean;
|
|
|
|
autoHeight?: boolean;
|
|
autoHeightMin?: number | string;
|
|
autoHeightMax?: number | string;
|
|
}
|
|
|
|
export class Scrollbars extends React.Component<ScrollbarProps> {
|
|
scrollTop(top: number): void;
|
|
scrollLeft(left: number): void;
|
|
scrollToTop(): void;
|
|
scrollToBottom(): void;
|
|
scrollToLeft(): void;
|
|
scrollToRight(): void;
|
|
getScrollLeft(): number;
|
|
getScrollTop(): number;
|
|
getScrollWidth(): number;
|
|
getScrollHeight(): number;
|
|
getClientWidth(): number;
|
|
getClientHeight(): number;
|
|
getValues(): positionValues;
|
|
}
|
|
|
|
export default Scrollbars;
|