### Changes: - Introduced `global.d.ts` to define global type declarations for the `globalThis` interface. - Added `__ENV__` object with the following properties: - `isBrowser: boolean` - `isNode: string | false` - `isServerless: boolean` - Included an export statement to ensure the file is treated as a module. ### Purpose: Defined global environment properties to standardize and enhance environment detection across browser, Node.js, and serverless environments. This improves type safety and consistency in the codebase.
15 lines
299 B
TypeScript
15 lines
299 B
TypeScript
/**
|
|
* Global type declarations for Brainy
|
|
*/
|
|
|
|
// Extend the globalThis interface to include the __ENV__ property
|
|
declare global {
|
|
var __ENV__: {
|
|
isBrowser: boolean;
|
|
isNode: string | false;
|
|
isServerless: boolean;
|
|
};
|
|
}
|
|
|
|
// This export is needed to make this file a module
|
|
export {};
|