diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..33363b6 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,2 @@ +/// +export * from "./dist/src"; \ No newline at end of file diff --git a/package.json b/package.json index 9f1c241..4e09016 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "graphql-sequelize-crud", "version": "0.4.0", "description": "Automatically generate queries and mutations from Sequelize models", - "main": "./dist/src/index.js", + "main": "./dist/src/index", "types": "./dist/src/index.d.ts", "directories": { "test": "test", @@ -10,7 +10,8 @@ "example": "demo" }, "files": [ - "dist/src" + "dist/src", + "src/@types" ], "scripts": { "prepublishOnly": "npm run build", diff --git a/src/declarations.ts b/src/@types/graphql-sequelize/index.d.ts similarity index 95% rename from src/declarations.ts rename to src/@types/graphql-sequelize/index.d.ts index a08e5b2..eeb5b23 100644 --- a/src/declarations.ts +++ b/src/@types/graphql-sequelize/index.d.ts @@ -4,16 +4,13 @@ declare module "graphql-sequelize" { import { GraphQLFieldResolver, GraphQLFieldConfigArgumentMap, - GraphQLFieldConfig, GraphQLFieldConfigMap, GraphQLInputFieldConfigMap, GraphQLObjectType, GraphQLInputObjectType, } from "graphql"; import { ConnectionConfig } from "graphql-relay"; - import { Sequelize } from "sequelize"; - import { Model as SequelizeModel } from "sequelize"; - import { SequelizeConnection } from "graphql-sequelize"; + import { Sequelize, Model as SequelizeModel } from "sequelize"; export interface Model extends SequelizeModel { associations: { diff --git a/src/@types/index.d.ts b/src/@types/index.d.ts new file mode 100644 index 0000000..9601d4a --- /dev/null +++ b/src/@types/index.d.ts @@ -0,0 +1,2 @@ +// tslint:disable no-reference no-useless-files +/// diff --git a/src/OperationFactory.ts b/src/OperationFactory.ts index 2c72b1e..9e5ddd9 100644 --- a/src/OperationFactory.ts +++ b/src/OperationFactory.ts @@ -1,3 +1,6 @@ +// tslint:disable-next-line:no-reference +/// + import { GraphQLObjectType, GraphQLInt, diff --git a/src/getSchema.ts b/src/getSchema.ts index ba32668..c7aef16 100644 --- a/src/getSchema.ts +++ b/src/getSchema.ts @@ -1,3 +1,6 @@ +// tslint:disable-next-line:no-reference +/// + import { GraphQLObjectType, GraphQLSchema, diff --git a/src/types.ts b/src/types.ts index 46335b1..4667a62 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1 +1,4 @@ +// tslint:disable-next-line:no-reference +/// + export { Model, Association, ModelsHashInterface, ModelTypes } from "graphql-sequelize"; diff --git a/tsconfig.json b/tsconfig.json index 712e44b..be2b376 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,8 +15,22 @@ "es6", "dom", "esnext" - ] + ], + "paths": { + "graphql-sequelize/*": [ + "src/@types/graphql-sequelize/*" + ] + }, + "baseUrl": "." }, + "files": [ + "src/@types/graphql-sequelize/index.d.ts" + ], + "include": [ + "demo", + "src", + "test" + ], "exclude": [ "node_modules", "dist"