From 5843dfdeb21a3d7aa786979b492818a421321065 Mon Sep 17 00:00:00 2001 From: Rushil Perera Date: Sun, 9 Jun 2024 11:01:03 -0400 Subject: [PATCH] chore: update Env declaration to extend Record --- src/scripts/generateEnv.ts | 4 +++- src/types/env.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/generateEnv.ts b/src/scripts/generateEnv.ts index 3d46ae8..0eba310 100644 --- a/src/scripts/generateEnv.ts +++ b/src/scripts/generateEnv.ts @@ -28,7 +28,9 @@ envSourceFile.insertImportDeclaration(2, { moduleSpecifier: "hono", namedImports: ["Env as HonoEnv"], }); -envSourceFile.getInterfaceOrThrow("Env").addExtends("HonoEnv"); +envSourceFile + .getInterfaceOrThrow("Env") + .addExtends(["HonoEnv", "Record"]); envSourceFile.getInterfaceOrThrow("Env").addProperties( secretNames.map((name) => ({ name, diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 29a312b..9b82d65 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -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` import type { Env as HonoEnv } from "hono"; -interface Env extends HonoEnv { +interface Env extends HonoEnv, Record { TURSO_URL: "libsql://humble-argent-silverandroid.turso.io"; QSTASH_URL: "https://qstash.upstash.io/v2/publish"; ENABLE_ANIFY: false;