Merge pull request #14545 from ruslanchek/master

react-custom-scrollbars added
This commit is contained in:
Arthur Ozga 2017-02-10 15:07:39 -08:00 committed by GitHub
commit 53869592fe
3 changed files with 92 additions and 0 deletions

58
react-custom-scrollbars/index.d.ts vendored Normal file
View File

@ -0,0 +1,58 @@
// Type definitions for react-css-transition-replace 2.0.1
// Project: https://github.com/malte-wessel/react-custom-scrollbars
// Definitions by: David-LeBlanc-git <https://github.com/David-LeBlanc-git>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as React from "react";
declare module "react-custom-scrollbars" {
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>;
autoHide?: boolean;
autoHideTimeout?: number;
autoHideDuration?: number;
thumbSize?: number;
thumbMinSize?: number;
universal?: boolean;
}
export default 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;
getWidth(): number;
getHeight(): number;
getValues(): positionValues;
}
}

View File

@ -0,0 +1,10 @@
import * as React from "react"
import { render } from 'react-dom';
import Scrollbars from "react-custom-scrollbars"
render(
<Scrollbars>
<div>Test</div>
</Scrollbars>,
document.getElementById("main")
)

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"index.d.ts",
"react-custom-scrollbars-tests.tsx"
]
}