This repository was archived by the owner on Jul 30, 2018. It is now read-only.

Description
Enhancement
This is one of the most dangerous parts of Dojo 2 at the moment. Our shim/global module is untyped. This can lead to a lot of issues at design time, as well as poor practices when the global namespace is touched by modules.
I would like to propose that we type it with an interface which could be extended if necessary that extends Window since most global we want to access are already available there.
Any need to access other types in the global would ideally use module interface augmentation.
Since 1.8 you are able to do module interface augmentation. It would look something like this:
import global from '@dojo/shim/global';
declare module '@dojo/shim/global' {
interface Global {
SOME_GLOBAL_CONST: 'some-literal-value';
}
}
console.log(global.SOME_GLOBAL_CONST);
This would be a breaking change, where anyone is accessing global variables that don't have type information, and therefore are automatically being typed as any, but obviously this is a safer long term approach to accessing the global scope.
Package Version: beta2