Merge pull request #32132 from bySabi/master

[react-lifecycles-compat] add typedef
This commit is contained in:
Daniel Rosenwasser
2019-01-14 13:40:21 -08:00
committed by GitHub
4 changed files with 44 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for react-lifecycles-compat 3.0
// Project: https://github.com/reactjs/react-lifecycles-compat#readme
// Definitions by: bySabi Files <https://github.com/bySabi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
export function polyfill<P>(Comp: React.ComponentType<P>): React.ComponentType<P>;
@@ -0,0 +1,10 @@
import * as React from 'react';
import { polyfill } from 'react-lifecycles-compat';
class A extends React.Component {
render() {
return null;
}
}
const Comp = polyfill(A);
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve"
},
"files": [
"index.d.ts",
"react-lifecycles-compat-tests.ts"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }