@vite-hub/runtime 0.1.0 → 0.3.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/README.md +151 -117
- package/dist/durability.d.ts +107 -0
- package/dist/durability.js +168 -0
- package/dist/error-diagnostics-BKICpwZp.js +85 -0
- package/dist/error-diagnostics-BsJr9VdW.d.ts +15 -0
- package/dist/{errors-CbqHQTvn.js → errors-BEomN3fX.js} +1 -1
- package/dist/{execution-budget-D8SwJE8_.d.ts → execution-budget-BPXbISEt.d.ts} +9 -6
- package/dist/index-Bcl-Hr-a.d.ts +678 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/internal/drain.d.ts +17 -0
- package/dist/internal/drain.js +75 -0
- package/dist/internal/execution-budget.d.ts +1 -1
- package/dist/internal/grant.js +2 -2
- package/dist/internal/h3.d.ts +42 -0
- package/dist/internal/h3.js +181 -0
- package/dist/{node.d.ts → internal/node.d.ts} +2 -2
- package/dist/{node.js → internal/node.js} +4 -4
- package/dist/internal/public-url.d.ts +2 -0
- package/dist/internal/public-url.js +2 -0
- package/dist/internal/run-scope.d.ts +11 -0
- package/dist/internal/run-scope.js +30 -0
- package/dist/internal/runtime-type.d.ts +9 -2
- package/dist/internal/runtime-type.js +3 -2
- package/dist/{shutdown.d.ts → internal/shutdown.d.ts} +1 -1
- package/dist/{shutdown.js → internal/shutdown.js} +1 -1
- package/dist/internal/test-mode-setup.d.ts +7 -0
- package/dist/internal/test-mode-setup.js +114 -0
- package/dist/internal/test-mode.d.ts +32 -0
- package/dist/internal/test-mode.js +9 -0
- package/dist/operations.d.ts +167 -0
- package/dist/operations.js +406 -0
- package/dist/public-url-1WeOw54Z.d.ts +34 -0
- package/dist/public-url-B6x0HMgY.js +140 -0
- package/dist/{src-jy-gyPPu.js → request-context-CP9NhgLL.js} +635 -551
- package/dist/runtime-type-BftydMAf.js +88 -0
- package/package.json +61 -26
- package/dist/drain.d.ts +0 -1
- package/dist/drain.js +0 -69
- package/dist/error-diagnostics-Bkym4e6y.d.ts +0 -12
- package/dist/h3.d.ts +0 -49
- package/dist/h3.js +0 -404
- package/dist/index-Rl4DbP8B.d.ts +0 -574
- package/dist/runtime-type-CgfU6SWl.js +0 -52
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineDiagnostics } from "nostics";
|
|
2
|
+
//#region ../internal/dist/invariant.js
|
|
3
|
+
const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
4
|
+
docsBase: "https://vitehub.dev/docs/development/diagnostics",
|
|
5
|
+
codes: { INTERNAL_INVARIANT_FAILED: {
|
|
6
|
+
why: ({ what }) => `ViteHub reached a state that it does not expect: ${what}`,
|
|
7
|
+
fix: "This is a ViteHub bug. Open an issue at https://github.com/vite-hub/vitehub/issues with this error message and its stack trace."
|
|
8
|
+
} }
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* The error for a state that only a ViteHub bug can reach, such as an impossible branch. `what` says which rule broke.
|
|
12
|
+
* Use a code from the package catalog when a developer can cause the error or fix it.
|
|
13
|
+
*/
|
|
14
|
+
function invariantError(what) {
|
|
15
|
+
return invariantDiagnostics.INTERNAL_INVARIANT_FAILED({ what });
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/internal/runtime-type.ts
|
|
19
|
+
/** Narrows opaque inputs without reading their properties. Kept for `@vite-hub/presets`; other packages use `typeof`. */
|
|
20
|
+
function hasRuntimeType(value, expected) {
|
|
21
|
+
switch (expected) {
|
|
22
|
+
case "bigint":
|
|
23
|
+
case "boolean":
|
|
24
|
+
case "function":
|
|
25
|
+
case "number":
|
|
26
|
+
case "object":
|
|
27
|
+
case "string":
|
|
28
|
+
case "symbol":
|
|
29
|
+
case "undefined": {
|
|
30
|
+
const representation = typeof value;
|
|
31
|
+
return (representation === "undefined" && value !== void 0 ? "function" : representation) === expected;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
throw invariantError(`hasRuntimeType() receives only a key of RuntimeTypeMap, not ${String(expected)}`);
|
|
35
|
+
}
|
|
36
|
+
/** Marks an intentional structural boundary that TypeScript cannot express. */
|
|
37
|
+
function asUnknownBoundary(value) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
function isRuntimeObject(value) {
|
|
41
|
+
return value !== null && Object(value) === value;
|
|
42
|
+
}
|
|
43
|
+
/** Whether a value is an object literal or a null-prototype record. A built-in object whose prototype code replaced reads as one. */
|
|
44
|
+
function isPlainRecord(value) {
|
|
45
|
+
const prototype = Object.getPrototypeOf(value);
|
|
46
|
+
return prototype === Object.prototype || prototype === null;
|
|
47
|
+
}
|
|
48
|
+
/** The native Response class and its `status` getter, and the proxy check of Node.js. Read once, at import. */
|
|
49
|
+
function captureResponseChecks() {
|
|
50
|
+
const response = globalThis.Response;
|
|
51
|
+
return {
|
|
52
|
+
response,
|
|
53
|
+
status: typeof response === "function" ? Object.getOwnPropertyDescriptor(Response.prototype, "status")?.get : void 0,
|
|
54
|
+
isProxy: globalThis.process?.getBuiltinModule?.("node:util")?.types.isProxy
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const nativeResponseChecks = /* @__PURE__ */ captureResponseChecks();
|
|
58
|
+
/**
|
|
59
|
+
* The `status` getter of the global `Response` when a server replaced the native class. srvx, which Nitro uses on Node.js,
|
|
60
|
+
* installs its own `Response` class, so `Response.json()` in app code and in ViteHub returns an instance of that class.
|
|
61
|
+
* Its getters read private fields, so they check the brand like the native getter does.
|
|
62
|
+
*/
|
|
63
|
+
function replacedResponseStatus() {
|
|
64
|
+
const current = globalThis.Response;
|
|
65
|
+
if (typeof current !== "function" || current === nativeResponseChecks.response) return void 0;
|
|
66
|
+
const prototype = Reflect.get(current, "prototype");
|
|
67
|
+
return isRuntimeObject(prototype) ? Object.getOwnPropertyDescriptor(prototype, "status")?.get : void 0;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Return whether `value` is a Response of this runtime: of the native class, or of the class that the server installed
|
|
71
|
+
* as the global `Response`.
|
|
72
|
+
* The `status` getter checks the internal Response slot, so a copied prototype, an object tagged `Response`,
|
|
73
|
+
* and a Response from another Fetch implementation all fail. A proxy fails too. The check reads no property of `value`.
|
|
74
|
+
*/
|
|
75
|
+
function isRuntimeResponse(value) {
|
|
76
|
+
if (value === null || typeof value !== "object" || nativeResponseChecks.isProxy?.(value)) return false;
|
|
77
|
+
if (nativeResponseChecks.isProxy !== void 0 && (Array.isArray(value) || isPlainRecord(value))) return false;
|
|
78
|
+
for (const status of [nativeResponseChecks.status, replacedResponseStatus()]) {
|
|
79
|
+
if (!status) continue;
|
|
80
|
+
try {
|
|
81
|
+
Reflect.apply(status, value, []);
|
|
82
|
+
return true;
|
|
83
|
+
} catch {}
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { isRuntimeResponse as i, hasRuntimeType as n, isRuntimeObject as r, asUnknownBoundary as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/runtime",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Shared runtime context, capability, policy, approval, and tracing primitives for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"approvals",
|
|
@@ -24,12 +24,7 @@
|
|
|
24
24
|
"package.json"
|
|
25
25
|
],
|
|
26
26
|
"type": "module",
|
|
27
|
-
"sideEffects":
|
|
28
|
-
"./dist/drain.js"
|
|
29
|
-
],
|
|
30
|
-
"bin": {
|
|
31
|
-
"vitehub-drain": "./dist/drain.js"
|
|
32
|
-
},
|
|
27
|
+
"sideEffects": false,
|
|
33
28
|
"types": "./dist/index.d.ts",
|
|
34
29
|
"exports": {
|
|
35
30
|
".": {
|
|
@@ -37,10 +32,15 @@
|
|
|
37
32
|
"import": "./dist/index.js",
|
|
38
33
|
"default": "./dist/index.js"
|
|
39
34
|
},
|
|
40
|
-
"./
|
|
41
|
-
"types": "./dist/
|
|
42
|
-
"import": "./dist/
|
|
43
|
-
"default": "./dist/
|
|
35
|
+
"./durability": {
|
|
36
|
+
"types": "./dist/durability.d.ts",
|
|
37
|
+
"import": "./dist/durability.js",
|
|
38
|
+
"default": "./dist/durability.js"
|
|
39
|
+
},
|
|
40
|
+
"./internal/drain": {
|
|
41
|
+
"types": "./dist/internal/drain.d.ts",
|
|
42
|
+
"import": "./dist/internal/drain.js",
|
|
43
|
+
"default": "./dist/internal/drain.js"
|
|
44
44
|
},
|
|
45
45
|
"./internal/execution-budget": {
|
|
46
46
|
"types": "./dist/internal/execution-budget.d.ts",
|
|
@@ -52,43 +52,78 @@
|
|
|
52
52
|
"import": "./dist/internal/grant.js",
|
|
53
53
|
"default": "./dist/internal/grant.js"
|
|
54
54
|
},
|
|
55
|
+
"./internal/h3": {
|
|
56
|
+
"types": "./dist/internal/h3.d.ts",
|
|
57
|
+
"import": "./dist/internal/h3.js",
|
|
58
|
+
"default": "./dist/internal/h3.js"
|
|
59
|
+
},
|
|
60
|
+
"./internal/node": {
|
|
61
|
+
"types": "./dist/internal/node.d.ts",
|
|
62
|
+
"import": "./dist/internal/node.js",
|
|
63
|
+
"default": "./dist/internal/node.js"
|
|
64
|
+
},
|
|
65
|
+
"./internal/public-url": {
|
|
66
|
+
"types": "./dist/internal/public-url.d.ts",
|
|
67
|
+
"import": "./dist/internal/public-url.js",
|
|
68
|
+
"default": "./dist/internal/public-url.js"
|
|
69
|
+
},
|
|
70
|
+
"./internal/run-scope": {
|
|
71
|
+
"types": "./dist/internal/run-scope.d.ts",
|
|
72
|
+
"import": "./dist/internal/run-scope.js",
|
|
73
|
+
"default": "./dist/internal/run-scope.js"
|
|
74
|
+
},
|
|
55
75
|
"./internal/runtime-type": {
|
|
56
76
|
"types": "./dist/internal/runtime-type.d.ts",
|
|
57
77
|
"import": "./dist/internal/runtime-type.js",
|
|
58
78
|
"default": "./dist/internal/runtime-type.js"
|
|
59
79
|
},
|
|
60
|
-
"./
|
|
61
|
-
"types": "./dist/
|
|
62
|
-
"import": "./dist/
|
|
63
|
-
"default": "./dist/
|
|
80
|
+
"./internal/shutdown": {
|
|
81
|
+
"types": "./dist/internal/shutdown.d.ts",
|
|
82
|
+
"import": "./dist/internal/shutdown.js",
|
|
83
|
+
"default": "./dist/internal/shutdown.js"
|
|
84
|
+
},
|
|
85
|
+
"./internal/test-mode": {
|
|
86
|
+
"types": "./dist/internal/test-mode.d.ts",
|
|
87
|
+
"import": "./dist/internal/test-mode.js",
|
|
88
|
+
"default": "./dist/internal/test-mode.js"
|
|
89
|
+
},
|
|
90
|
+
"./internal/test-mode-setup": {
|
|
91
|
+
"types": "./dist/internal/test-mode-setup.d.ts",
|
|
92
|
+
"import": "./dist/internal/test-mode-setup.js",
|
|
93
|
+
"default": "./dist/internal/test-mode-setup.js"
|
|
64
94
|
},
|
|
65
|
-
"./
|
|
66
|
-
"types": "./dist/
|
|
67
|
-
"import": "./dist/
|
|
68
|
-
"default": "./dist/
|
|
95
|
+
"./operations": {
|
|
96
|
+
"types": "./dist/operations.d.ts",
|
|
97
|
+
"import": "./dist/operations.js",
|
|
98
|
+
"default": "./dist/operations.js"
|
|
69
99
|
},
|
|
70
100
|
"./package.json": "./package.json"
|
|
71
101
|
},
|
|
72
102
|
"dependencies": {
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
103
|
+
"@standard-schema/spec": "^1.1.0",
|
|
104
|
+
"@valibot/to-json-schema": "^1.8.0",
|
|
105
|
+
"h3": "^2.0.8",
|
|
106
|
+
"nostics": "1.4.0",
|
|
107
|
+
"standard-context": "0.0.4",
|
|
108
|
+
"valibot": "^1.5.0"
|
|
76
109
|
},
|
|
77
110
|
"devDependencies": {
|
|
111
|
+
"@libsql/client": "^0.18.0",
|
|
78
112
|
"@types/node": "^24.19.1",
|
|
113
|
+
"@vite-hub/internal": "0.0.1",
|
|
114
|
+
"postgres": "^3.4.9",
|
|
79
115
|
"publint": "^0.3.25",
|
|
80
116
|
"typescript": "^6.0.3",
|
|
81
117
|
"vite-plus": "^0.3.3",
|
|
82
|
-
"vitest": "^4.1.11"
|
|
83
|
-
"@vite-hub/internal": "0.0.1"
|
|
118
|
+
"vitest": "^4.1.11"
|
|
84
119
|
},
|
|
85
120
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
121
|
+
"node": ">=22.18.0"
|
|
87
122
|
},
|
|
88
123
|
"scripts": {
|
|
89
124
|
"build": "vp pack",
|
|
90
125
|
"dev": "vp pack --watch",
|
|
91
126
|
"typecheck": "vp run --cache -t @vite-hub/runtime#build && node ../../test/package-typecheck.mjs --noEmit -p ./tsconfig.json",
|
|
92
|
-
"test": "vp run -t @vite-hub/runtime#build && vp test"
|
|
127
|
+
"test": "vp run --cache -t @vite-hub/runtime#build && vp test"
|
|
93
128
|
}
|
|
94
129
|
}
|
package/dist/drain.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/dist/drain.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { i as runtimeErrorDiagnostics, n as hasRuntimeType } from "./runtime-type-CgfU6SWl.js";
|
|
3
|
-
//#region src/internal/drain-process.ts
|
|
4
|
-
/** Check whether a process still exists without confusing access denial for exit. */
|
|
5
|
-
function isProcessRunning(pid) {
|
|
6
|
-
try {
|
|
7
|
-
process.kill(pid, 0);
|
|
8
|
-
return true;
|
|
9
|
-
} catch (error) {
|
|
10
|
-
try {
|
|
11
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "EPERM";
|
|
12
|
-
} catch {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/** Request a drain signal, allowing status polling when signal permission is denied. */
|
|
18
|
-
function signalProcess(pid) {
|
|
19
|
-
try {
|
|
20
|
-
process.kill(pid, "SIGUSR2");
|
|
21
|
-
return "signaled";
|
|
22
|
-
} catch (error) {
|
|
23
|
-
if (typeof error === "object" && error !== null && "code" in error && error.code === "EPERM") return "permission-denied";
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/drain.ts
|
|
29
|
-
const pidInput = process.argv[2];
|
|
30
|
-
const statusUrl = process.argv[3] || "http://127.0.0.1:3000/api/drain";
|
|
31
|
-
const pid = Number(pidInput);
|
|
32
|
-
if (pidInput === "-h" || pidInput === "--help") {
|
|
33
|
-
console.log("Usage: vitehub-drain MAINPID [STATUS_URL]");
|
|
34
|
-
process.exit(0);
|
|
35
|
-
}
|
|
36
|
-
if (!Number.isSafeInteger(pid) || pid <= 0) {
|
|
37
|
-
console.error("usage: vitehub-drain MAINPID [STATUS_URL]");
|
|
38
|
-
process.exit(2);
|
|
39
|
-
}
|
|
40
|
-
async function readStatus() {
|
|
41
|
-
try {
|
|
42
|
-
const response = await fetch(statusUrl, { signal: AbortSignal.timeout(5e3) });
|
|
43
|
-
if (!response.ok) {
|
|
44
|
-
await response.body?.cancel();
|
|
45
|
-
return "unavailable";
|
|
46
|
-
}
|
|
47
|
-
const body = await response.json();
|
|
48
|
-
const status = body && hasRuntimeType(body, "object") ? body.status : void 0;
|
|
49
|
-
return status === "accepting" || status === "drained" || status === "draining" || status === "failed" ? status : "invalid";
|
|
50
|
-
} catch {
|
|
51
|
-
return "unavailable";
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
try {
|
|
55
|
-
let signalAttempted = false;
|
|
56
|
-
while (isProcessRunning(pid)) {
|
|
57
|
-
const status = await readStatus();
|
|
58
|
-
if (status === "failed" || status === "invalid") throw runtimeErrorDiagnostics.RUNTIME_R0004({ message: `Process drain reported ${status}.` });
|
|
59
|
-
if (status === "drained") process.exit(0);
|
|
60
|
-
if (status === "accepting" && !signalAttempted) signalAttempted = signalProcess(pid) === "signaled";
|
|
61
|
-
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
62
|
-
}
|
|
63
|
-
throw runtimeErrorDiagnostics.RUNTIME_R0005({ message: `Process ${pid} exited before drain completed.` });
|
|
64
|
-
} catch (error) {
|
|
65
|
-
console.error(error instanceof Error ? error.message : error);
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Diagnostics } from "nostics";
|
|
2
|
-
//#region src/error-diagnostics.d.ts
|
|
3
|
-
declare const dynamicError: {
|
|
4
|
-
why: (params: {
|
|
5
|
-
message?: unknown;
|
|
6
|
-
}) => string;
|
|
7
|
-
};
|
|
8
|
-
type RuntimeErrorCode = "RUNTIME_R0001" | "RUNTIME_R0002" | "RUNTIME_R0003" | "RUNTIME_R0004" | "RUNTIME_R0005" | "RUNTIME_R0006" | "RUNTIME_R0007" | "RUNTIME_R0008" | "RUNTIME_R0009" | "RUNTIME_R0010" | "RUNTIME_R0011" | "RUNTIME_R0012" | "RUNTIME_R0013" | "RUNTIME_R0014" | "RUNTIME_R0015" | "RUNTIME_R0016";
|
|
9
|
-
declare const codes: Record<RuntimeErrorCode, typeof dynamicError>;
|
|
10
|
-
declare const runtimeErrorDiagnostics: Diagnostics<typeof codes, []>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { runtimeErrorDiagnostics as t };
|
package/dist/h3.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { O as RuntimeContextInput, d as CreatedRuntimeContext, k as RuntimeHostContext } from "./index-Rl4DbP8B.js";
|
|
2
|
-
import { EventHandlerRequest } from "h3";
|
|
3
|
-
import { StandardContext } from "standard-context";
|
|
4
|
-
//#region ../internal/dist/runtime/cloudflare-env.d.ts
|
|
5
|
-
interface CloudflareWorkerExecutionContext {
|
|
6
|
-
waitUntil?: (promise: Promise<unknown>) => void;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/h3.d.ts
|
|
10
|
-
/** The host data that ViteHub puts in `runtime` of a Standard Context. */
|
|
11
|
-
export interface ViteHubRuntime {
|
|
12
|
-
cloudflare?: {
|
|
13
|
-
context?: CloudflareWorkerExecutionContext;
|
|
14
|
-
env: Record<string, unknown>;
|
|
15
|
-
};
|
|
16
|
-
/** The client IP address that the host reports. ViteHub does not read it from forwarding headers. */
|
|
17
|
-
clientAddress?: string;
|
|
18
|
-
}
|
|
19
|
-
/** The `~standard` properties of a request event in a ViteHub app. */
|
|
20
|
-
export type ViteHubStandardProps = StandardContext.Props<ViteHubRuntime, void>;
|
|
21
|
-
/** A request event in a ViteHub app: any server context with Standard Context properties. */
|
|
22
|
-
export type ViteHubContext<C = {}> = StandardContext<C, ViteHubRuntime, void>;
|
|
23
|
-
declare module "h3" {
|
|
24
|
-
interface H3Event<_RequestT extends EventHandlerRequest = EventHandlerRequest> {
|
|
25
|
-
/** Set by ViteHub for each request until H3 implements Standard Context. */
|
|
26
|
-
readonly "~standard": ViteHubStandardProps;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
type H3RuntimeName = "cloudflare-agents" | "deno" | "unknown" | "vercel" | "vite";
|
|
30
|
-
export type H3RuntimeContextOptions = Omit<RuntimeContextInput, "event" | "runtime"> & {
|
|
31
|
-
runtime?: H3RuntimeName;
|
|
32
|
-
};
|
|
33
|
-
export type H3RuntimeContext<TOptions extends H3RuntimeContextOptions = {}> = CreatedRuntimeContext<TOptions & {
|
|
34
|
-
cloudflare?: RuntimeHostContext["cloudflare"];
|
|
35
|
-
event: ViteHubContext;
|
|
36
|
-
request: Request;
|
|
37
|
-
runtime: H3RuntimeName;
|
|
38
|
-
vercel?: RuntimeHostContext["vercel"];
|
|
39
|
-
}>;
|
|
40
|
-
/**
|
|
41
|
-
* Set `event["~standard"]` on an H3 1 or H3 2 event. A value that the host set stays.
|
|
42
|
-
* ViteHub calls this for each request in a Nitro `request` hook. Call it yourself only for an event that
|
|
43
|
-
* Nitro did not create, such as in a test. Throws `RUNTIME_R0015` when the event has no request.
|
|
44
|
-
*/
|
|
45
|
-
export declare function installStandardContext<T extends object>(event: T): asserts event is T & ViteHubContext;
|
|
46
|
-
/** Adapt one request. Await flushWaitUntil when the host has no lifetime API. */
|
|
47
|
-
export declare function getRuntimeContext(event: ViteHubContext): H3RuntimeContext;
|
|
48
|
-
export declare function getRuntimeContext<const TOptions extends H3RuntimeContextOptions>(event: ViteHubContext, options: TOptions): H3RuntimeContext<TOptions>;
|
|
49
|
-
//#endregion
|