0

Is it possible to add a function to the global namespace in TypeScript?

I have a function that I use so ubiquitously that is very much tied to a certain programming style that I don't want have an import in every file that uses it.

I thought I was close by defining this function in a file without any exports. The compiler did not complain, but at runtime the function was not found.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.