I have a variable defined like this:
(global as any).State = {
variables: {},
};
My question is, how do I declare the type signature of State
? If I say (global as any).State: Something = ...
, the compiler gives me an error saying ; expected
.
As far as I can tell, it's the same question as this one, but it's about the window
variable, not the global
variable: How do you explicitly set a new property on `window` in TypeScript?
; expected
has rather something to do with JS ASI. Try to insert a semicolon before above code snippet and it also should work (though without strong types). – ford04