Skip to content

Commit

Permalink
chore: update types for env_vars
Browse files Browse the repository at this point in the history
  • Loading branch information
denchiklut committed Jan 30, 2025
1 parent 34817f2 commit a272f59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion @types/env/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import type { Env } from "src/common"

type PickClientVars<T> = {
[K in keyof T as K extends `CLIENT_${string}` ? K : never]: T[K]
}

declare global {
declare var IS_DEV: boolean
declare var IS_PROD: boolean
Expand All @@ -12,6 +16,6 @@ declare global {
}

interface Window {
env_vars: Partial<Collection<keyof Env, string>>
env_vars: PickClientVars<Env>
}
}

0 comments on commit a272f59

Please sign in to comment.