Initial typings for react-scrollbar (#9185)

* Initial typings for react-scrollbar

* Fixed tests
This commit is contained in:
Steve
2016-05-06 01:57:42 +09:00
committed by Masahiro Wakame
parent d1555d272c
commit 36c7b30eb3
2 changed files with 46 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="react-scrollbar.d.ts" />
/// <reference path="../react/react.d.ts" />
import ScrollArea = require('react-scrollbar');
import * as React from 'react';
let scrollArea = <ScrollArea
speed={0.8}
className="area"
contentClassName="content"
horizontal={false}
>
<div>Some long content.</div>
</ScrollArea>;
+32
View File
@@ -0,0 +1,32 @@
// Type definitions for react-scrollbar 0.4.1
// Project: https://github.com/souhe/reactScrollbar
// Definitions by: Stephen Jelfs <https://github.com/stephenjelfs>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
declare module "react-scrollbar" {
interface ScrollAreaProps extends __React.Props<ScrollArea> {
className?: string,
style?: __React.CSSProperties,
speed?: number,
contentClassName?: string,
contentStyle?: __React.CSSProperties,
vertical?: boolean,
verticalContainerStyle?: __React.CSSProperties,
verticalScrollbarStyle?: __React.CSSProperties,
horizontal?: boolean,
horizontalContainerStyle?: __React.CSSProperties,
horizontalScrollbarStyle?: __React.CSSProperties,
onScroll?: (value: {leftPosition: number, topPosition: number, containerHeight: number, containerWidth: number, realHeight: number, realWidth: number}) => void,
contentWindow?: any,
ownerDocument?: any,
smoothScrolling?: boolean
minScrollSize?: number,
swapWheelAxes?: boolean
}
class ScrollArea extends __React.Component<ScrollAreaProps, {}> {}
export = ScrollArea;
}