diff --git a/types/react-json/index.d.ts b/types/react-json/index.d.ts new file mode 100644 index 0000000000..c52cabcd6b --- /dev/null +++ b/types/react-json/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for react-json 0.2 +// Project: https://github.com/arqex/react-json +// Definitions by: Christoph Spielmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from 'react'; + +export type OnChangeHandler = (value: any) => void; + +export interface JsonProperties { + value: any; + onChange?: OnChangeHandler; +} + +export class Json extends React.Component { +} diff --git a/types/react-json/react-json-tests.tsx b/types/react-json/react-json-tests.tsx new file mode 100644 index 0000000000..05e12fa9f9 --- /dev/null +++ b/types/react-json/react-json-tests.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +// import * as Json from 'react-json'; +import { Json } from "react-json"; + +let TestObject = { + s: "Hello, world", + b: true, + n: 666, + o: { + s: "Hello, world", + b: true, + n: 666, + o: { + s: "Hello, world", + b: true, + n: 666, + } + } +}; + +export class TestComponent extends React.Component<{}, {}> { + render(): JSX.Element { + return console.log(val)}/>; + } +} diff --git a/types/react-json/tsconfig.json b/types/react-json/tsconfig.json new file mode 100644 index 0000000000..ff5be5812c --- /dev/null +++ b/types/react-json/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-json-tests.tsx" + ] +} diff --git a/types/react-json/tslint.json b/types/react-json/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-json/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }