Sha256: 9e5c7463fc0259a38938c9afbdeda92e802cff87560277fd3e385ad24663f214

Contents?: true

Size: 688 Bytes

Versions: 28

Compression:

Stored size: 688 Bytes

Contents

/**
Declare locally scoped properties on `globalThis`.

When defining a global variable in a declaration file is inappropriate, it can be helpful to define a `type` or `interface` (say `ExtraGlobals`) with the global variable and then cast `globalThis` via code like `globalThis as unknown as ExtraGlobals`.

Instead of casting through `unknown`, you can update your `type` or `interface` to extend `GlobalThis` and then directly cast `globalThis`.

@example
```
import type {GlobalThis} from 'type-fest';

type ExtraGlobals = GlobalThis & {
	readonly GLOBAL_TOKEN: string;
};

(globalThis as ExtraGlobals).GLOBAL_TOKEN;
```

@category Type
*/
export type GlobalThis = typeof globalThis;

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/type-fest/source/global-this.d.ts