The typings file is a module file, it uses export default, which means the declare function statement is applied to the module scope, not the window scope.
I am developing a Javascript project, which only uses Typescript for type checking but doesn't have a build process or use a bundler. I am referencing the package using a script tag. I have set up Typescript to type check my Javascript files, but since the package is referenced using a script tag, I need to let Typescript know it should use jsQR typings in the project. The way to do this is to use compilerOptions.types, which is what I do, but unfortunately the typings as they are right now don't work to make Typescript know the function exists on the window scope, which is how I am accessing it at runtime.
I don't yet understand how to create typings which at the same time use export default (or otherwise export in order to be used as a module) and also correctly contribute to the window scope. I am hoping you do, or can help me understand how to do that for me to be able to create a PR. Thank you
The typings file is a module file, it uses export default, which means the declare function statement is applied to the module scope, not the window scope.
I am developing a Javascript project, which only uses Typescript for type checking but doesn't have a build process or use a bundler. I am referencing the package using a script tag. I have set up Typescript to type check my Javascript files, but since the package is referenced using a script tag, I need to let Typescript know it should use jsQR typings in the project. The way to do this is to use compilerOptions.types, which is what I do, but unfortunately the typings as they are right now don't work to make Typescript know the function exists on the window scope, which is how I am accessing it at runtime.
I don't yet understand how to create typings which at the same time use export default (or otherwise export in order to be used as a module) and also correctly contribute to the window scope. I am hoping you do, or can help me understand how to do that for me to be able to create a PR. Thank you