Global variables are considered bad practice.
In Typescript all variables are namespaced and isolated within the modules they are defined in.
However sometimes you just need a global variable. This is how you do it:
(<any>window).yourVariable = 0;
(<any>window).yourFunction = function () { alert() };