Using OmniFocus.d.ts

Can anybody help with using the omnifocus.d.ts that was recently added?
I’m no expert in javascript, but I tried to follow the directions in the release notes and created a file called omnifocus.d.ts and tsconfig.json.
My project does seems to recognize it for some objects, for example it gives me the right help for a new project:

But, at the same time visual studio does not recognize many other methods such as folderNamed

It seems the work around is to instead us globalThis… is this the right approach?

this also seems to work.