Issue
I declare a global variable in typescript something like: global.test = "something" I try to do that I get the error property ‘test’ does not exist on type ‘Global’.
Solution
I try to do that I get the error property ‘test’ does not exist on type ‘Global’.
Create a file globals.d.ts with
interface Global {
test: string;
}
More
Declaration files : https://basarat.gitbook.io/typescript/docs/types/ambient/d.ts.html
Answered By - basarat
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.