diff --git a/types/react-d3-graph/index.d.ts b/types/react-d3-graph/index.d.ts new file mode 100644 index 0000000000..f787497e2a --- /dev/null +++ b/types/react-d3-graph/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for react-d3-graph 2.3 +// Project: https://github.com/danielcaldas/react-d3-graph#readme +// Definitions by: hrngoode +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Component } from "react"; + +export class Graph extends Component { + constructor(props: any, ...args: any[]); + + UNSAFE_componentWillReceiveProps(nextProps: any): any; + + componentDidMount(): void; + + componentDidUpdate(): void; + + componentWillUnmount(): void; + + render(): any; +} + +export class Link extends Component { + constructor(...args: any[]); + + render(): any; +} + +export class Node extends Component { + constructor(...args: any[]); + + render(): any; +} diff --git a/types/react-d3-graph/react-d3-graph-tests.tsx b/types/react-d3-graph/react-d3-graph-tests.tsx new file mode 100644 index 0000000000..e8cf7e6c36 --- /dev/null +++ b/types/react-d3-graph/react-d3-graph-tests.tsx @@ -0,0 +1,14 @@ +import { Graph, Link, Node } from "react-d3-graph"; +import * as React from 'react'; + +export class Example extends React.Component { + render(): React.ReactElement { + return ( +
+ + + +
+ ); + } +} diff --git a/types/react-d3-graph/tsconfig.json b/types/react-d3-graph/tsconfig.json new file mode 100644 index 0000000000..f51bc77575 --- /dev/null +++ b/types/react-d3-graph/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-d3-graph-tests.tsx" + ] +} diff --git a/types/react-d3-graph/tslint.json b/types/react-d3-graph/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-d3-graph/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }