Check out example codes for "typescript declare process.env". It will help you in understanding the concepts better.

Code Example 1

npm install dotenv;
 OR 
yarn add dotenv;


import * as dotenv from 'dotenv';

//inside your starter code, do this
...
...
dotenv.config();
...

Code Example 2

declare namespace NodeJS {  export interface ProcessEnv {    HOST: string;    DB_URL: string;    DB_NAME?: string;  }}

Learn ReactJs, React Native from akashmittal.com