forked from florianholzapfel/express-restify-mongoose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
45 lines (40 loc) · 2.31 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Type definitions for express-restify-mongoose 3.2.0
// Project: https://github.com/florianholzapfel/express-restify-mongoose
// Definitions by: pedroraft <https://github.com/pedroraft> & ravishivt <https://github.com/ravishivt>
// Definitions: https://github.com/florianholzapfel/express-restify-mongoose
// TypeScript Version: 2.5.3
///<reference types="express" />
///<reference types="mongoose" />
// DOCS: https://florianholzapfel.github.io/express-restify-mongoose/
declare module 'express-restify-mongoose' {
import * as express from 'express';
import * as mongoose from 'mongoose';
export interface Options {
prefix?: string;
version?: string;
idProperty?: string;
restify?: boolean;
plural?: boolean;
lowercase?: boolean;
name?: string;
private?: string[];
protected?: string[];
lean?: boolean;
findOneAndUpdate?: boolean;
preMiddleware?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
preCreate?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
preRead?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
preUpdate?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
preDelete?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
access?: (req: express.Request, done?: any) => any;
contextFilter?: (model: mongoose.Model<any>, req: express.Request, done: any) => any;
postCreate?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
postRead?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
postUpdate?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
postDelete?: (req: express.Request, res: express.Response, next: express.NextFunction) => any;
outputFn?: (req: express.Request, res: express.Response) => any;
onError?: (err: any, req: express.Request, res: express.Response, next: express.NextFunction) => any;
}
export function serve(router: express.Router, mongooseModel: mongoose.Model<any>, options?: Options): string;
export function defaults(options: Options);
}