mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Added types for mongoose-unique-validator
This commit is contained in:
13
types/mongoose-unique-validator/index.d.ts
vendored
Normal file
13
types/mongoose-unique-validator/index.d.ts
vendored
Normal 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 {
|
||||
}
|
||||
@@ -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);
|
||||
22
types/mongoose-unique-validator/tsconfig.json
Normal file
22
types/mongoose-unique-validator/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/mongoose-unique-validator/tslint.json
Normal file
1
types/mongoose-unique-validator/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user