Currently, this construct is being utilized to create a global LOG
:
declare global {
let LOG: Logger;
}
// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace globalThis {
let LOG: Logger;
}
globalThis.LOG = new Logger();
It functions as intended, but why do I have to declare it twice?
Extra query: What can be done to optimize this process and improve efficiency?