diff --git a/types/mongoose-unique-validator/index.d.ts b/types/mongoose-unique-validator/index.d.ts new file mode 100644 index 0000000000..3cc2a13d80 --- /dev/null +++ b/types/mongoose-unique-validator/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for mongoose-unique-validator 1.0 +// Project: https://github.com/blakehaswell/mongoose-unique-validator#readme +// Definitions by: Steve Hipwell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Schema } from "mongoose"; + +export = mongooseUniqueValidator; + +declare function mongooseUniqueValidator(schema: Schema, options?: any): void; + +declare namespace mongooseUniqueValidator { +} diff --git a/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts b/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts new file mode 100644 index 0000000000..59ada92a3c --- /dev/null +++ b/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts @@ -0,0 +1,8 @@ +import { Schema } from "mongoose"; +import * as uniqueValidator from "mongoose-unique-validator"; + +const schema = new Schema({ + test: { type: String } +}); + +schema.plugin(uniqueValidator); diff --git a/types/mongoose-unique-validator/tsconfig.json b/types/mongoose-unique-validator/tsconfig.json new file mode 100644 index 0000000000..069b7515ff --- /dev/null +++ b/types/mongoose-unique-validator/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", + "mongoose-unique-validator-tests.ts" + ] +} diff --git a/types/mongoose-unique-validator/tslint.json b/types/mongoose-unique-validator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mongoose-unique-validator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }