chore: update Env declaration to extend Record<string, unknown>
This commit is contained in:
@@ -28,7 +28,9 @@ envSourceFile.insertImportDeclaration(2, {
|
|||||||
moduleSpecifier: "hono",
|
moduleSpecifier: "hono",
|
||||||
namedImports: ["Env as HonoEnv"],
|
namedImports: ["Env as HonoEnv"],
|
||||||
});
|
});
|
||||||
envSourceFile.getInterfaceOrThrow("Env").addExtends("HonoEnv");
|
envSourceFile
|
||||||
|
.getInterfaceOrThrow("Env")
|
||||||
|
.addExtends(["HonoEnv", "Record<string, unknown>"]);
|
||||||
envSourceFile.getInterfaceOrThrow("Env").addProperties(
|
envSourceFile.getInterfaceOrThrow("Env").addProperties(
|
||||||
secretNames.map((name) => ({
|
secretNames.map((name) => ({
|
||||||
name,
|
name,
|
||||||
|
|||||||
4
src/types/env.d.ts
vendored
4
src/types/env.d.ts
vendored
@@ -1,8 +1,8 @@
|
|||||||
// Generated by Wrangler on Sun Jun 09 2024 10:47:45 GMT-0400 (Eastern Daylight Time)
|
// Generated by Wrangler on Sun Jun 09 2024 11:00:16 GMT-0400 (Eastern Daylight Time)
|
||||||
// by running `wrangler types src/types/env.d.ts`
|
// by running `wrangler types src/types/env.d.ts`
|
||||||
import type { Env as HonoEnv } from "hono";
|
import type { Env as HonoEnv } from "hono";
|
||||||
|
|
||||||
interface Env extends HonoEnv {
|
interface Env extends HonoEnv, Record<string, unknown> {
|
||||||
TURSO_URL: "libsql://humble-argent-silverandroid.turso.io";
|
TURSO_URL: "libsql://humble-argent-silverandroid.turso.io";
|
||||||
QSTASH_URL: "https://qstash.upstash.io/v2/publish";
|
QSTASH_URL: "https://qstash.upstash.io/v2/publish";
|
||||||
ENABLE_ANIFY: false;
|
ENABLE_ANIFY: false;
|
||||||
|
|||||||
Reference in New Issue
Block a user