Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TypeScript type definition file (#374)
  • Loading branch information
pedroraft authored and Zertz committed Mar 20, 2018
1 parent a8fb1ca commit babf0ef
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions index.d.ts
@@ -0,0 +1,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);
}

0 comments on commit babf0ef

Please sign in to comment.