@wheeparam/library 0.0.4 → 0.0.5

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.
@@ -72,6 +72,18 @@ type Route<Path extends string = string> = {
72
72
  * ] as const)
73
73
  */
74
74
  declare function defineRoutes<const R extends readonly Route<string>[]>(routes: R): R;
75
+ type ApiProps = {
76
+ params: Promise<{
77
+ slug?: string[];
78
+ }>;
79
+ };
80
+ type ListResponse<T> = {
81
+ result: T[];
82
+ totalCount: number;
83
+ };
84
+ type RowResponse<T> = {
85
+ result: T;
86
+ };
75
87
 
76
88
  /**
77
89
  * @packageDocumentation
@@ -121,4 +133,4 @@ declare function matchRoute(path: string, slug: string[]): MatchResult | null;
121
133
  */
122
134
  declare function routeResponse(slug: string[], routes: readonly Route<string>[], request: Request): Promise<Response>;
123
135
 
124
- export { type ParamsFromPath, type Route, type RouteHandler, defineRoutes, matchRoute, routeResponse };
136
+ export { type ApiProps, type ListResponse, type ParamsFromPath, type Route, type RouteHandler, type RowResponse, defineRoutes, matchRoute, routeResponse };
@@ -72,6 +72,18 @@ type Route<Path extends string = string> = {
72
72
  * ] as const)
73
73
  */
74
74
  declare function defineRoutes<const R extends readonly Route<string>[]>(routes: R): R;
75
+ type ApiProps = {
76
+ params: Promise<{
77
+ slug?: string[];
78
+ }>;
79
+ };
80
+ type ListResponse<T> = {
81
+ result: T[];
82
+ totalCount: number;
83
+ };
84
+ type RowResponse<T> = {
85
+ result: T;
86
+ };
75
87
 
76
88
  /**
77
89
  * @packageDocumentation
@@ -121,4 +133,4 @@ declare function matchRoute(path: string, slug: string[]): MatchResult | null;
121
133
  */
122
134
  declare function routeResponse(slug: string[], routes: readonly Route<string>[], request: Request): Promise<Response>;
123
135
 
124
- export { type ParamsFromPath, type Route, type RouteHandler, defineRoutes, matchRoute, routeResponse };
136
+ export { type ApiProps, type ListResponse, type ParamsFromPath, type Route, type RouteHandler, type RowResponse, defineRoutes, matchRoute, routeResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wheeparam/library",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",