diff --git a/types/react-json/index.d.ts b/types/react-json/index.d.ts new file mode 100644 index 0000000000..58bfd488f8 --- /dev/null +++ b/types/react-json/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for react-json 0.2 +// Project: https://github.com/arqex/react-json +// Definitions by: Christoph Spielmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; + +type OnChangeHandler = (value: any) => void; + +interface JsonProperties { + value: any; + onChange?: OnChangeHandler; +} + +declare class Json extends React.Component { +} + +export = Json; diff --git a/types/react-json/react-json-tests.tsx b/types/react-json/react-json-tests.tsx new file mode 100644 index 0000000000..6bad322c9c --- /dev/null +++ b/types/react-json/react-json-tests.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; +import Json from 'react-json'; + +const TestObject = { + s: "Hello, world", + b: true, + n: 666, + o: { + s: "Hello, world", + b: true, + n: 666, + o: { + s: "Hello, world", + b: true, + n: 666, + } + } +}; + + console.log(val)}/>; diff --git a/types/react-json/tsconfig.json b/types/react-json/tsconfig.json new file mode 100644 index 0000000000..3363d26f86 --- /dev/null +++ b/types/react-json/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "allowSyntheticDefaultImports": true + }, + "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..f93cf8562a --- /dev/null +++ b/types/react-json/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}