Skip to content

Commit ba6affb

Browse files
define types for env vars
1 parent 44f86f3 commit ba6affb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/react-app-env.d.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,26 @@
66
*/
77

88
/// <reference types="react-scripts" />
9+
10+
import { UrlString } from '@gridsuite/commons-ui';
11+
12+
type EnvDev = {
13+
REACT_APP_USE_AUTHENTICATION: true;
14+
REACT_APP_SRV_STUDY_URI: string;
15+
};
16+
17+
type EnvProd = {
18+
REACT_APP_USE_AUTHENTICATION: false;
19+
REACT_APP_API_GATEWAY: string;
20+
REACT_APP_WS_GATEWAY: string;
21+
};
22+
23+
type EnvCompile = EnvProd | EnvDev;
24+
25+
declare global {
26+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
27+
namespace NodeJS {
28+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
29+
interface ProcessEnv extends EnvCompile {}
30+
}
31+
}

0 commit comments

Comments
 (0)