Skip to content

Commit

Permalink
Release files
Browse files Browse the repository at this point in the history
  • Loading branch information
lostfields committed Mar 14, 2018
1 parent 90574e5 commit 88bfbef
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 28 deletions.
34 changes: 17 additions & 17 deletions lib/express/route.d.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/// <reference types="express" />
import { Request, Response, RequestHandler, NextFunction } from 'express';
export interface IRoute<TRequest, TResponse> {
import * as Express from 'express';
export interface IRoute<TRequest extends Express.Request, TResponse extends Express.Response> {
readonly path: string;
use(...handler: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
get(...handler: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
post(...handler: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
patch(...handler: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
put(...handler: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
delete(...handler: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
use(...handler: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
get(...handler: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
post(...handler: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
patch(...handler: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
put(...handler: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
delete(...handler: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
handlers: {
[method: string]: RequestHandler[];
[method: string]: Express.RequestHandler[];
};
}
export declare class Route<TRequest extends Request, TResponse extends Response> implements IRoute<TRequest, TResponse> {
export declare class Route<TRequest extends Express.Request, TResponse extends Express.Response> implements IRoute<TRequest, TResponse> {
readonly path: string;
private _handlers;
constructor(path: string);
readonly handlers: {
[index: string]: ((req: TRequest, res: TResponse, next?: NextFunction) => void)[];
[index: string]: ((req: TRequest, res: TResponse, next?: Express.NextFunction) => void)[];
};
use(...handlers: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
get(...handlers: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
post(...handlers: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
patch(...handlers: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
put(...handlers: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
delete(...handlers: Array<(req: TRequest, res: TResponse, next?: NextFunction) => any>): this;
use(...handlers: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
get(...handlers: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
post(...handlers: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
patch(...handlers: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
put(...handlers: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
delete(...handlers: Array<(req: TRequest, res: TResponse, next?: Express.NextFunction) => any>): this;
private handle(method, ...handlers);
}
2 changes: 1 addition & 1 deletion lib/express/route.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/express/router.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/// <reference types="express" />
import { Router as ExpressRouter, NextFunction, Request, Response } from 'express';
import * as Express from 'express';
import { IRoute } from './route';
export declare class Router<TRequest extends Request, TResponse extends Response> {
export declare class Router<TRequest extends Express.Request, TResponse extends Express.Response> {
private _stack;
private _extendRequest;
private _extendResponse;
private _handler;
constructor(extendRequest: (req: Request) => TRequest, extendResponse: (req: Response) => TResponse);
constructor(handler?: (req: Request, res: Response, next?: NextFunction) => void);
constructor(handler?: (req: Request, res: Response, next?: Express.NextFunction) => void);
route(path: string): IRoute<TRequest, TResponse>;
getRouter(): ExpressRouter;
getRouter(): Express.Router;
}
4 changes: 2 additions & 2 deletions lib/express/router.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/express/router.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export { Router } from './express/router';
import { Router as CoreRouter, Request, Response } from 'express';
import { Router } from './express/router';
export default Router;
export { Router, CoreRouter, Request, Response };
5 changes: 4 additions & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 88bfbef

Please sign in to comment.