@mokup/runtime 1.0.0 → 1.0.1

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/index.d.cts CHANGED
@@ -78,8 +78,10 @@ interface RuntimeResult {
78
78
  headers: Record<string, string>;
79
79
  body: string | Uint8Array | null;
80
80
  }
81
- type RequestHandler = (context: Context) => Response | Promise<Response> | unknown;
82
- type RouteResponse = unknown | RequestHandler;
81
+ type RouteStaticResponse = string | number | boolean | bigint | symbol | null | undefined | object;
82
+ type RouteHandlerResult = RouteStaticResponse | Response;
83
+ type RequestHandler = (context: Context) => RouteHandlerResult | Promise<RouteHandlerResult>;
84
+ type RouteResponse = RouteStaticResponse | RequestHandler;
83
85
 
84
86
  interface RuntimeOptions {
85
87
  manifest: Manifest | (() => Promise<Manifest>);
package/dist/index.d.mts CHANGED
@@ -78,8 +78,10 @@ interface RuntimeResult {
78
78
  headers: Record<string, string>;
79
79
  body: string | Uint8Array | null;
80
80
  }
81
- type RequestHandler = (context: Context) => Response | Promise<Response> | unknown;
82
- type RouteResponse = unknown | RequestHandler;
81
+ type RouteStaticResponse = string | number | boolean | bigint | symbol | null | undefined | object;
82
+ type RouteHandlerResult = RouteStaticResponse | Response;
83
+ type RequestHandler = (context: Context) => RouteHandlerResult | Promise<RouteHandlerResult>;
84
+ type RouteResponse = RouteStaticResponse | RequestHandler;
83
85
 
84
86
  interface RuntimeOptions {
85
87
  manifest: Manifest | (() => Promise<Manifest>);
package/dist/index.d.ts CHANGED
@@ -78,8 +78,10 @@ interface RuntimeResult {
78
78
  headers: Record<string, string>;
79
79
  body: string | Uint8Array | null;
80
80
  }
81
- type RequestHandler = (context: Context) => Response | Promise<Response> | unknown;
82
- type RouteResponse = unknown | RequestHandler;
81
+ type RouteStaticResponse = string | number | boolean | bigint | symbol | null | undefined | object;
82
+ type RouteHandlerResult = RouteStaticResponse | Response;
83
+ type RequestHandler = (context: Context) => RouteHandlerResult | Promise<RouteHandlerResult>;
84
+ type RouteResponse = RouteStaticResponse | RequestHandler;
83
85
 
84
86
  interface RuntimeOptions {
85
87
  manifest: Manifest | (() => Promise<Manifest>);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mokup/runtime",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "Cross-runtime mock matching and response handling for mokup.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://mokup.icebreaker.top",