How can I add fetch onto the global object in TypeScript so I don't have to do this:
(global as any).fetch
I've tried this in a file in ./types/index.d.ts
And tried to reference it by including it in the tsconfig.json.
How can I add fetch onto the global object in TypeScript so I don't have to do this:
(global as any).fetch
I've tried this in a file in ./types/index.d.ts
And tried to reference it by including it in the tsconfig.json.
Copyright © 2021 Jogjafile Inc.
If you use Go to Definition on
globalyou will see it declared in node definition files as :So in order to add things to it you just need to augment the
Globalinterface in theNodeJSnamespace: