mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 13:30:28 +00:00
[react-scrollbar-size] Introduce type definitions (#38768)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
b899dec969
commit
47fc9ee659
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for react-scrollbar-size 2.1
|
||||
// Project: https://github.com/STORIS/react-scrollbar-size#readme
|
||||
// Definitions by: Alex Bukurov <https://github.com/abukurov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface Measurement {
|
||||
scrollbarWidth: number;
|
||||
scrollbarHeight: number;
|
||||
}
|
||||
|
||||
export interface ScrollbarSizeProps {
|
||||
onLoad?: (measurement: Measurement) => void;
|
||||
onChange?: (measurement: Measurement) => void;
|
||||
}
|
||||
|
||||
export default class ScrollbarSize extends React.Component<ScrollbarSizeProps> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import * as React from "react";
|
||||
import ScrollbarSize from "react-scrollbar-size";
|
||||
|
||||
const elements = [
|
||||
<ScrollbarSize/>,
|
||||
<ScrollbarSize
|
||||
onLoad={measurement => {
|
||||
console.log(measurement.scrollbarWidth, measurement.scrollbarHeight);
|
||||
}}
|
||||
onChange={measurement => {
|
||||
console.log(measurement.scrollbarWidth, measurement.scrollbarHeight);
|
||||
}}
|
||||
/>
|
||||
];
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"jsx": "react",
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-scrollbar-size-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user