From f7d76b4bd16bd6f00d4979aafe55bfa3daeefd2e Mon Sep 17 00:00:00 2001 From: Prain Date: Wed, 6 Nov 2019 05:11:33 +0800 Subject: [PATCH] Add typing for graphql-bigint (#40041) --- types/graphql-bigint/graphql-bigint-tests.ts | 13 +++++++++++ types/graphql-bigint/index.d.ts | 11 +++++++++ types/graphql-bigint/package.json | 6 +++++ types/graphql-bigint/tsconfig.json | 24 ++++++++++++++++++++ types/graphql-bigint/tslint.json | 1 + 5 files changed, 55 insertions(+) create mode 100644 types/graphql-bigint/graphql-bigint-tests.ts create mode 100644 types/graphql-bigint/index.d.ts create mode 100644 types/graphql-bigint/package.json create mode 100644 types/graphql-bigint/tsconfig.json create mode 100644 types/graphql-bigint/tslint.json diff --git a/types/graphql-bigint/graphql-bigint-tests.ts b/types/graphql-bigint/graphql-bigint-tests.ts new file mode 100644 index 0000000000..c864409113 --- /dev/null +++ b/types/graphql-bigint/graphql-bigint-tests.ts @@ -0,0 +1,13 @@ +import { GraphQLObjectType } from 'graphql'; +import * as GraphQLBigInt from 'graphql-bigint'; + +const fooType = new GraphQLObjectType({ + name: 'Foo', + description: 'Some foo type', + fields: { + created: { + type: GraphQLBigInt, + description: 'BigInt foo was created', + } + } +}); diff --git a/types/graphql-bigint/index.d.ts b/types/graphql-bigint/index.d.ts new file mode 100644 index 0000000000..d77fc7420e --- /dev/null +++ b/types/graphql-bigint/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for graphql-bigint 1.0 +// Project: https://github.com/stems/graphql-bigint#readme +// Definitions by: proudrain +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { GraphQLScalarType } from 'graphql'; + +declare const GraphQLBigInt: GraphQLScalarType; + +export = GraphQLBigInt; diff --git a/types/graphql-bigint/package.json b/types/graphql-bigint/package.json new file mode 100644 index 0000000000..1e9e930126 --- /dev/null +++ b/types/graphql-bigint/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "graphql": "^14.5.3" + } +} diff --git a/types/graphql-bigint/tsconfig.json b/types/graphql-bigint/tsconfig.json new file mode 100644 index 0000000000..473bff804a --- /dev/null +++ b/types/graphql-bigint/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "esnext.asynciterable" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "graphql-bigint-tests.ts" + ] +} diff --git a/types/graphql-bigint/tslint.json b/types/graphql-bigint/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-bigint/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }