arrow-express
Advanced tools
Comparing version 1.2.0 to 1.2.1
import { RouteConfigurator } from "../route/route"; | ||
export type ControllerHandler<C> = (request: any, response: any) => Promise<C>; | ||
export declare class ControllerConfiguration<C = unknown> { | ||
export declare class ControllerConfiguration<C = undefined> { | ||
private _prefix; | ||
@@ -5,0 +5,0 @@ private _controllers; |
import Express from "express"; | ||
export type RouteHandler<C = unknown, R = unknown> = (request: Express.Request, response: Express.Response, context?: C) => R | Promise<R>; | ||
export type RouteHandler<C = undefined, R = unknown> = (request: Express.Request, response: Express.Response, context: C) => R | Promise<R>; | ||
export type HttpMethod = "get" | "post" | "head" | "put" | "delete" | "options" | "patch"; | ||
export declare class RouteConfigurator<C = unknown, R = unknown> { | ||
export declare class RouteConfigurator<C = undefined, R = unknown> { | ||
private _method; | ||
@@ -31,2 +31,2 @@ private _path; | ||
} | ||
export declare function Route<C, R>(): RouteConfigurator<C, R>; | ||
export declare function Route<C = undefined, R = unknown>(): RouteConfigurator<C, R>; |
import { RouteConfigurator } from "../route/route"; | ||
export type ControllerHandler<C> = (request: any, response: any) => Promise<C>; | ||
export class ControllerConfiguration<C = unknown> { | ||
export class ControllerConfiguration<C = undefined> { | ||
private _prefix = ""; | ||
@@ -6,0 +6,0 @@ private _controllers: ControllerConfiguration[] = []; |
import Express from "express"; | ||
export type RouteHandler<C = unknown, R = unknown> = ( | ||
export type RouteHandler<C = undefined, R = unknown> = ( | ||
request: Express.Request, | ||
response: Express.Response, | ||
context?: C | ||
context: C | ||
) => R | Promise<R>; | ||
export type HttpMethod = "get" | "post" | "head" | "put" | "delete" | "options" | "patch"; | ||
export class RouteConfigurator<C = unknown, R = unknown> { | ||
export class RouteConfigurator<C = undefined, R = unknown> { | ||
private _method: HttpMethod; | ||
@@ -59,4 +59,4 @@ private _path: string; | ||
export function Route<C, R>(): RouteConfigurator<C, R> { | ||
export function Route<C = undefined, R = unknown>(): RouteConfigurator<C, R> { | ||
return new RouteConfigurator<C, R>(); | ||
} |
{ | ||
"name": "arrow-express", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Library to bootstrap express applications with zero configuration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
792303