itty-router
Advanced tools
Comparing version 5.0.3 to 5.0.4
import { IRequest, IttyRouterOptions, IttyRouterType } from './types'; | ||
export declare const IttyRouter: <RequestType extends IRequest = IRequest, Args extends any[] = any[], ResponseType = any>({ base, routes, ...other }?: IttyRouterOptions) => IttyRouterType<RequestType, Args, ResponseType>; | ||
export declare const IttyRouter: <RequestType extends IRequest = IRequest, Args extends any[] = any[], ResponseType = any, GlobalRequestType = RequestType>({ base, routes, ...other }?: IttyRouterOptions) => IttyRouterType<RequestType, Args, ResponseType, GlobalRequestType>; |
{ | ||
"name": "itty-router", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"description": "A tiny, zero-dependency router, designed to make beautiful APIs in any environment.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -7,14 +7,14 @@ import { GenericTraps } from './GenericTraps'; | ||
import { CustomRoutes } from './CustomRoutes'; | ||
export type IttyRouterType<R = IRequest, A extends any[] = any[], ResponseType = any> = { | ||
export type IttyRouterType<R = IRequest, A extends any[] = any[], ResponseType = any, GlobalRequestType = R> = { | ||
__proto__: IttyRouterType<R>; | ||
routes: RouteEntry[]; | ||
fetch: <Args extends any[] = A>(request: RequestLike, ...extra: Args) => Promise<ResponseType>; | ||
all: Route<R, A>; | ||
delete: Route<R, A>; | ||
get: Route<R, A>; | ||
head: Route<R, A>; | ||
options: Route<R, A>; | ||
patch: Route<R, A>; | ||
post: Route<R, A>; | ||
put: Route<R, A>; | ||
} & CustomRoutes<Route<R, A>> & GenericTraps; | ||
all: Route<GlobalRequestType, A>; | ||
delete: Route<GlobalRequestType, A>; | ||
get: Route<GlobalRequestType, A>; | ||
head: Route<GlobalRequestType, A>; | ||
options: Route<GlobalRequestType, A>; | ||
patch: Route<GlobalRequestType, A>; | ||
post: Route<GlobalRequestType, A>; | ||
put: Route<GlobalRequestType, A>; | ||
} & CustomRoutes<Route<GlobalRequestType, A>> & GenericTraps; |
import { IRequest } from './IRequest'; | ||
import { IttyRouterType } from './IttyRouterType'; | ||
import { RequestHandler } from './RequestHandler'; | ||
export type Route<R = IRequest, A extends Array<any> = any[]> = <RequestType = R, Args extends Array<any> = A>(path: string, ...handlers: RequestHandler<RequestType, Args>[]) => IttyRouterType<RequestType, Args>; | ||
export type Route<R = IRequest, A extends Array<any> = any[]> = <RequestType = R, Args extends Array<any> = A>(path: string, ...handlers: RequestHandler<RequestType, Args>[]) => IttyRouterType<R, A>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83675