From dca48ce9743abc02d4349500e56cb074ad553ffc Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Mar 2018 14:51:47 -0700 Subject: [PATCH 1/4] Added jsoneditor-for-react types --- types/jsoneditor-for-react/index.d.ts | 16 +++++++++++++ .../jsoneditor-for-react-tests.tsx | 4 ++++ types/jsoneditor-for-react/tsconfig.json | 23 +++++++++++++++++++ types/jsoneditor-for-react/tslint.json | 1 + 4 files changed, 44 insertions(+) create mode 100644 types/jsoneditor-for-react/index.d.ts create mode 100644 types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx create mode 100644 types/jsoneditor-for-react/tsconfig.json create mode 100644 types/jsoneditor-for-react/tslint.json diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts new file mode 100644 index 0000000000..cb5af6e2bb --- /dev/null +++ b/types/jsoneditor-for-react/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for jsoneditor-for-react 0.0.1 +// Project: https://github.com/mixj93/jsoneditor-for-react#readme +// Definitions by: JoshGoldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from "react" +import JSONEditor, { JSONEditorOptions } from "jsoneditor" + +export interface IReactJsoneditorProps { + values: Object +} + +export default class ReactJsoneditor extends React.Component { + private editor?: JSONEditor + private options?: JSONEditorOptions +} diff --git a/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx new file mode 100644 index 0000000000..fc8211e628 --- /dev/null +++ b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx @@ -0,0 +1,4 @@ +import * as React from "react"; +import ReactJsonEditor from "jsoneditor-for-react"; + +const component = ; diff --git a/types/jsoneditor-for-react/tsconfig.json b/types/jsoneditor-for-react/tsconfig.json new file mode 100644 index 0000000000..bc56d95c74 --- /dev/null +++ b/types/jsoneditor-for-react/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsoneditor-for-react-tests.tsx" + ] +} diff --git a/types/jsoneditor-for-react/tslint.json b/types/jsoneditor-for-react/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsoneditor-for-react/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b87aa359830da2e05f7d60d8a3b8c282e3444c6a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Mar 2018 15:27:38 -0700 Subject: [PATCH 2/4] Bumped TS to version 2.6 --- types/jsoneditor-for-react/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts index cb5af6e2bb..731820af30 100644 --- a/types/jsoneditor-for-react/index.d.ts +++ b/types/jsoneditor-for-react/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mixj93/jsoneditor-for-react#readme // Definitions by: JoshGoldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 import * as React from "react" import JSONEditor, { JSONEditorOptions } from "jsoneditor" From 7a98540cd08a2be909c0104964768a31dd8cee6f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Mar 2018 15:44:58 -0700 Subject: [PATCH 3/4] Added strictFunctionTypes --- types/jsoneditor-for-react/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jsoneditor-for-react/tsconfig.json b/types/jsoneditor-for-react/tsconfig.json index bc56d95c74..7a855a2dc9 100644 --- a/types/jsoneditor-for-react/tsconfig.json +++ b/types/jsoneditor-for-react/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ From 9427fe3dc5160e939807ae2465c64fa227aac335 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 2 Apr 2018 00:08:52 -0700 Subject: [PATCH 4/4] Lint fixups --- types/jsoneditor-for-react/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts index 731820af30..707f03c63e 100644 --- a/types/jsoneditor-for-react/index.d.ts +++ b/types/jsoneditor-for-react/index.d.ts @@ -1,17 +1,17 @@ -// Type definitions for jsoneditor-for-react 0.0.1 +// Type definitions for jsoneditor-for-react 0.0 // Project: https://github.com/mixj93/jsoneditor-for-react#readme // Definitions by: JoshGoldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import * as React from "react" -import JSONEditor, { JSONEditorOptions } from "jsoneditor" +import * as React from "react"; +import JSONEditor, { JSONEditorOptions } from "jsoneditor"; -export interface IReactJsoneditorProps { - values: Object +export interface ReactJsonEditorProps { + values: {}; } -export default class ReactJsoneditor extends React.Component { - private editor?: JSONEditor - private options?: JSONEditorOptions +export default class ReactJsoneditor extends React.Component { + private editor?: JSONEditor; + private options?: JSONEditorOptions; }