Skip to content

Commit

Permalink
1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lostfields committed Aug 22, 2019
1 parent a1b3daa commit 5ba148d
Show file tree
Hide file tree
Showing 22 changed files with 453 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

28 changes: 28 additions & 0 deletions lib/express/route.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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?: 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]: Express.RequestHandler[];
};
}
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?: Express.NextFunction) => void)[];
};
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;
}
64 changes: 64 additions & 0 deletions lib/express/route.js

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

1 change: 1 addition & 0 deletions lib/express/route.js.map

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

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

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

1 change: 1 addition & 0 deletions lib/express/router.js.map

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

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

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

1 change: 1 addition & 0 deletions lib/index.js.map

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

16 changes: 16 additions & 0 deletions lib/model/model.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export declare class Model<T extends Model<T>> {
private ctor;
constructor(ctor: {
new (...args: any[]): T;
});
protected convert(source: Partial<T>, ...constructorArgs: any[]): T;
protected static convert<T extends Model<T>>(source: Partial<T>, ...constructorArgs: any[]): T;
protected static convert<T extends Model<T>>(source: Partial<T>, ctor: {
new (...args: any[]): T;
}, ...constructorArgs: any[]): T;
assign(properties: Partial<T>, ...ignoreProperties: string[]): void;
protected convertNumber(value: any, defaultValue?: number): number;
private static isClass;
private static apply;
toJSON(): any;
}
98 changes: 98 additions & 0 deletions lib/model/model.js

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

1 change: 1 addition & 0 deletions lib/model/model.js.map

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

1 change: 1 addition & 0 deletions lib/test/basic.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Loading

0 comments on commit 5ba148d

Please sign in to comment.