Skip to content

Commit 631dd9e

Browse files
committed
fix(types): remove runtime config index signature
1 parent 926a9ab commit 631dd9e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/runtime/composables/useSafeRuntimeConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useRuntimeConfig } from '#imports'
22

33
declare global {
4-
interface NuxtSafeRuntimeConfig extends Record<string, unknown> {}
4+
interface NuxtSafeRuntimeConfig {}
55
}
66

77
/**

test/fixtures/server-typing/server/utils/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export function getTypedServerConfig(): { secretKey: string, apiBase: string } {
22
const config = useSafeRuntimeConfig()
3+
// @ts-expect-error unknown keys must be rejected to catch typos
4+
type _InvalidKey = typeof config.notARealConfigKey
35

46
const secretKey: string = config.secretKey
57
const apiBase: string = config.public.apiBase

0 commit comments

Comments
 (0)