-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Since https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#augmenting-globalmodule-scope-from-modules it's been possible to augment the global
from a module. However, in TypeScript definitions (such as dom.d.ts
or node.d.ts
) we're left to create our own "globals". This results in two issue:
- inconsistency with what is actually the global namespace
- requiring the declaration of global types multiple times in case it's used as a "real global" or from
window.
(browsers) orglobal.
(node)
Instead of this, it'd be really nice to access TypeScript's global
as a type. For instance, in dom.d.ts
we could do:
declare var window: global
Or in node.d.ts
:
declare var global: global
I couldn't see any previous issues, but it's partially related to things like #12902 - the difference though is that those issues seems to be tracking adding variables to the TypeScript global scope whereas this would be using the global scope as a type to define these variables themselves.
OliverJAsh and bre1470
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript