Feature/react d3 graph (#41953)

* react-d3-graph types

This is our first time submitting something to this git repo.
This is the type definition for the node module 'react-d3-graph'.

* Test added

* tests fixed

* Update package.json

* Update react-d3-graph-tests.tsx

* Update package.json

* Delete package.json

* Create tslint.json

* Update index.d.ts

* Update react-d3-graph-tests.tsx

* Update package.json
This commit is contained in:
Harry Goode
2020-01-30 13:20:21 -08:00
committed by GitHub
parent 0e197b3fa6
commit 7092c0f044
4 changed files with 71 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
// Type definitions for react-d3-graph 2.3
// Project: https://github.com/danielcaldas/react-d3-graph#readme
// Definitions by: hrngoode <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Component } from "react";
export class Graph extends Component<any, any> {
constructor(props: any, ...args: any[]);
UNSAFE_componentWillReceiveProps(nextProps: any): any;
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
render(): any;
}
export class Link extends Component<any, any> {
constructor(...args: any[]);
render(): any;
}
export class Node extends Component<any, any> {
constructor(...args: any[]);
render(): any;
}
@@ -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 (
<div>
<Graph id="test"/>
<Link/>
<Node/>
</div>
);
}
}
+24
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }