Added types for mongoose-unique-validator

This commit is contained in:
Steve Hipwell
2017-05-09 09:48:18 +01:00
parent 46ad6f9833
commit 41df2ed0f7
4 changed files with 44 additions and 0 deletions

View File

@@ -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 <https://github.com/stevehipwell>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Schema } from "mongoose";
export = mongooseUniqueValidator;
declare function mongooseUniqueValidator(schema: Schema, options?: any): void;
declare namespace mongooseUniqueValidator {
}

View File

@@ -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);

View File

@@ -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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }