diff --git a/react-json-pretty/index.d.ts b/react-json-pretty/index.d.ts new file mode 100644 index 0000000000..5ca8bbf13b --- /dev/null +++ b/react-json-pretty/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for react-json-pretty 1.3 +// Project: https://github.com/chenckang/react-json-pretty +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { ComponentClass, HTMLProps } from "react"; + +export as namespace JSONPretty; + +export = JSONPretty; + +declare const JSONPretty: JSONPretty; +type JSONPretty = ComponentClass; + +declare namespace JSONPretty { + + export interface JSONPrettyProps extends HTMLProps { + json: {} | string; + } + +} diff --git a/react-json-pretty/react-json-pretty-tests.tsx b/react-json-pretty/react-json-pretty-tests.tsx new file mode 100644 index 0000000000..59f8eb74f3 --- /dev/null +++ b/react-json-pretty/react-json-pretty-tests.tsx @@ -0,0 +1,17 @@ +import * as React from "react"; +import * as JSONPretty from "react-json-pretty"; + +export class Test extends React.Component { + render() { + const json = { + foo: "bar" + } + + return ( +
+ + +
+ ); + } +} diff --git a/react-json-pretty/tsconfig.json b/react-json-pretty/tsconfig.json new file mode 100644 index 0000000000..ddb38d587e --- /dev/null +++ b/react-json-pretty/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "jsx": "preserve", + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-json-pretty-tests.tsx" + ] +} diff --git a/react-json-pretty/tslint.json b/react-json-pretty/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/react-json-pretty/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" }