mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Update definitions for react-custom-scrollbars@4.1.1 - BREAKING CHANGES (#16326)
* Update definitions for react-custom-scrollbars@4.1.1 - BREAKING CHANGES * Preserve react-custom-scrollbars v3 in folder
This commit is contained in:
committed by
Mohamed Hegazy
parent
abef2dd282
commit
581dbc2dde
17
types/react-custom-scrollbars/index.d.ts
vendored
17
types/react-custom-scrollbars/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for react-css-transition-replace 2.0.1
|
||||
// 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>
|
||||
// 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.1
|
||||
|
||||
@@ -31,6 +32,8 @@ declare module "react-custom-scrollbars" {
|
||||
renderThumbHorizontal?: React.StatelessComponent<any>;
|
||||
renderThumbVertical?: React.StatelessComponent<any>;
|
||||
|
||||
hideTracksWhenNotNeeded?: boolean;
|
||||
|
||||
autoHide?: boolean;
|
||||
autoHideTimeout?: number;
|
||||
autoHideDuration?: number;
|
||||
@@ -38,6 +41,10 @@ declare module "react-custom-scrollbars" {
|
||||
thumbSize?: number;
|
||||
thumbMinSize?: number;
|
||||
universal?: boolean;
|
||||
|
||||
autoHeight?: boolean;
|
||||
autoHeightMin?: number;
|
||||
autoHeightMax?: number;
|
||||
}
|
||||
|
||||
export default class Scrollbars extends React.Component<ScrollbarProps, {}> {
|
||||
@@ -51,8 +58,8 @@ declare module "react-custom-scrollbars" {
|
||||
getScrollTop(): number;
|
||||
getScrollWidth(): number;
|
||||
getScrollHeight(): number;
|
||||
getWidth(): number;
|
||||
getHeight(): number;
|
||||
getClientWidth(): number;
|
||||
getClientHeight(): number;
|
||||
getValues(): positionValues;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
58
types/react-custom-scrollbars/v3/index.d.ts
vendored
Normal file
58
types/react-custom-scrollbars/v3/index.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// Type definitions for react-custom-scrollbars 3.0
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@@ -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")
|
||||
)
|
||||
28
types/react-custom-scrollbars/v3/tsconfig.json
Normal file
28
types/react-custom-scrollbars/v3/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"react-custom-scrollbars": ["react-custom-scrollbars/v3"],
|
||||
"react-custom-scrollbars/*": ["react-custom-scrollbars/v3/*"]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-custom-scrollbars-tests.tsx"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user