diff --git a/types/react-custom-scroll/index.d.ts b/types/react-custom-scroll/index.d.ts new file mode 100644 index 0000000000..aa555b3f2a --- /dev/null +++ b/types/react-custom-scroll/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for react-custom-scroll 4.2 +// Project: https://github.com/rommguy/react-custom-scroll +// Definitions by: Guy Romm +// rvdende +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.5 + +import { ComponentClass } from 'react'; + +/** + * Props for a CustomScroll component. + */ +export interface CustomScrollProps { + allowOuterScroll?: boolean; + heightRelativeToParent?: string; + flex?: number | string; + onScoll?: (e?: any) => any; + addScrolledClass?: boolean; + freezePosition?: boolean; + minScrollHandleHeight?: number; + rtl?: boolean; + scrollTo?: number; + keepAtBottom?: boolean; +} + +/** + * Customize scrollbar design while using native scroll behavior. + */ +declare const CustomScroll: ComponentClass; + +export default CustomScroll; diff --git a/types/react-custom-scroll/react-custom-scroll-tests.tsx b/types/react-custom-scroll/react-custom-scroll-tests.tsx new file mode 100644 index 0000000000..c1b9d972f4 --- /dev/null +++ b/types/react-custom-scroll/react-custom-scroll-tests.tsx @@ -0,0 +1,29 @@ +import * as React from 'react'; +import CustomScroll from 'react-custom-scroll'; + +const onScrollStub = () => 1; +export const _ = () => ( + <> + +
Test content
+
Test content
+
+ , + +
Test content
+
Test content
+
+ , + +); diff --git a/types/react-custom-scroll/tsconfig.json b/types/react-custom-scroll/tsconfig.json new file mode 100644 index 0000000000..34a7b9ffed --- /dev/null +++ b/types/react-custom-scroll/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "jsx": "react", + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-custom-scroll-tests.tsx" + ] +} diff --git a/types/react-custom-scroll/tslint.json b/types/react-custom-scroll/tslint.json new file mode 100644 index 0000000000..1848b605d1 --- /dev/null +++ b/types/react-custom-scroll/tslint.json @@ -0,0 +1,5 @@ +{"extends": "dtslint/dt.json", + "rules": { + "npm-naming": [true,{"mode":"code","errors":[["NoDefaultExport",false]]}] + } +}