**feat: add global type declarations for environment detection**

### 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.
This commit is contained in:
David Snelling 2025-06-20 10:56:37 -07:00
parent dac3258265
commit 3dce27e951

15
src/global.d.ts vendored Normal file
View file

@ -0,0 +1,15 @@
/**
* 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 {};