process.env
has a type ProcessEnv
with this definition:
export interface ProcessEnv {
[key: string]: string | undefined;
}
I would like to extend this TypeScript interface to contain keys specific to my application, so the result looks something like this:
export interface ProcessEnv {
MY_VARIABLE_1: string;
MY_OTHER_VARIABLE: string;
[key: string]: string | undefined;
}
I can not find a way to do it, I think it will be declare module
, or declare namespace
somewhere, but can not find a specific way of achieving this.
source
share