From 30721b9ef91179338d04e2e051947a00e1487939 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 18 Jan 2024 13:11:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F(app-desk)=20add=20custom-?= =?UTF-8?q?next.d.ts=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add custom-next.d.ts file to augment types. We add our environment variables to avoid mispelling and to have better autocompletion. --- src/frontend/apps/desk/src/custom-next.d.ts | 11 +++++++++++ src/frontend/apps/desk/tsconfig.json | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/frontend/apps/desk/src/custom-next.d.ts diff --git a/src/frontend/apps/desk/src/custom-next.d.ts b/src/frontend/apps/desk/src/custom-next.d.ts new file mode 100644 index 0000000..b14e688 --- /dev/null +++ b/src/frontend/apps/desk/src/custom-next.d.ts @@ -0,0 +1,11 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +namespace NodeJS { + interface ProcessEnv { + NEXT_PUBLIC_API_URL: string; + NEXT_PUBLIC_KEYCLOAK_URL: string; + NEXT_PUBLIC_KEYCLOAK_REALM: string; + NEXT_PUBLIC_KEYCLOAK_CLIENT_ID: string; + NEXT_PUBLIC_KEYCLOAK_LOGIN: string; + } +} diff --git a/src/frontend/apps/desk/tsconfig.json b/src/frontend/apps/desk/tsconfig.json index e59724b..ebff7dc 100644 --- a/src/frontend/apps/desk/tsconfig.json +++ b/src/frontend/apps/desk/tsconfig.json @@ -22,6 +22,12 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "src/custom-next.d.ts", + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], "exclude": ["node_modules"] }