From 2dddf787b698b141c9449074f3122338216d47cf Mon Sep 17 00:00:00 2001
From: Pavel Ivanov
Date: Fri, 12 May 2017 19:38:19 +0300
Subject: [PATCH] Add type definitions for graphql-type-json package
---
.../graphql-type-json-tests.ts | 20 +++++++++++++++++
types/graphql-type-json/index.d.ts | 8 +++++++
types/graphql-type-json/tsconfig.json | 22 +++++++++++++++++++
types/graphql-type-json/tslint.json | 1 +
4 files changed, 51 insertions(+)
create mode 100644 types/graphql-type-json/graphql-type-json-tests.ts
create mode 100644 types/graphql-type-json/index.d.ts
create mode 100644 types/graphql-type-json/tsconfig.json
create mode 100644 types/graphql-type-json/tslint.json
diff --git a/types/graphql-type-json/graphql-type-json-tests.ts b/types/graphql-type-json/graphql-type-json-tests.ts
new file mode 100644
index 0000000000..3282681845
--- /dev/null
+++ b/types/graphql-type-json/graphql-type-json-tests.ts
@@ -0,0 +1,20 @@
+import {GraphQLObjectType, GraphQLInputObjectType} from "graphql";
+import * as GraphQLJSON from "graphql-type-json";
+
+const TestType = new GraphQLObjectType({
+ name: "TestType",
+ fields: {
+ test: {
+ type: GraphQLJSON
+ }
+ }
+});
+
+const TestInputType = new GraphQLInputObjectType({
+ name: "TestInputType",
+ fields: {
+ test: {
+ type: GraphQLJSON
+ }
+ }
+});
diff --git a/types/graphql-type-json/index.d.ts b/types/graphql-type-json/index.d.ts
new file mode 100644
index 0000000000..7d41b83013
--- /dev/null
+++ b/types/graphql-type-json/index.d.ts
@@ -0,0 +1,8 @@
+// Type definitions for graphql-type-json 0.1
+// Project: https://github.com/taion/graphql-type-json#readme
+// Definitions by: Pavel Ivanov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+import {GraphQLScalarType} from "graphql";
+
+declare const GraphQLJSON: GraphQLScalarType;
+export = GraphQLJSON;
diff --git a/types/graphql-type-json/tsconfig.json b/types/graphql-type-json/tsconfig.json
new file mode 100644
index 0000000000..4120681b12
--- /dev/null
+++ b/types/graphql-type-json/tsconfig.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "graphql-type-json-tests.ts"
+ ]
+}
diff --git a/types/graphql-type-json/tslint.json b/types/graphql-type-json/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/graphql-type-json/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }