rouzer 1.0.0-beta.19 → 1.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/route.js CHANGED
@@ -5,7 +5,7 @@ export function $type() {
5
5
  }
6
6
  export function route(pattern, methods) {
7
7
  const path = new RoutePattern(pattern);
8
- const createFetch = (method, schema) => (args) => {
8
+ const createFetch = (method, schema) => (args = {}) => {
9
9
  return {
10
10
  schema,
11
11
  path,
@@ -82,6 +82,7 @@ interface CreateRouterConfig<TRoutes extends Routes, TMiddleware extends Middlew
82
82
  routes: TRoutes;
83
83
  middlewares?: TMiddleware;
84
84
  }
85
+ export type Router<TRoutes extends Routes, TMiddleware extends MiddlewareChain = EmptyMiddlewareChain> = ReturnType<typeof createRouter<TRoutes, TMiddleware>>;
85
86
  export declare function createRouter<TRoutes extends Routes, TMiddleware extends MiddlewareChain = EmptyMiddlewareChain>(config: CreateRouterConfig<TRoutes, TMiddleware>): (handlers: { [K in keyof TRoutes]: { [M in keyof TRoutes[K]["methods"]]: TRoutes[K]["methods"][M] extends infer T ? T extends TRoutes[K]["methods"][M] ? T extends QueryRouteSchema ? (context: MiddlewareContext<TMiddleware> & {
86
87
  path: T extends {
87
88
  path: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rouzer",
3
- "version": "1.0.0-beta.19",
3
+ "version": "1.0.0-beta.20",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {