Provide typescript umd global types.
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
Just like the module “@types/react”, it declares a global variable React
. If I set allowUmdGlobalAccess
to true
in tsconfig.json, I can use it directly.
“material-ui” should declare the MaterialUI
, because in js file it is actually defined.
Examples 🌈
compile this without any import statement.
ReactDOM.render(<MaterialUI.Button>aaa</MaterialUI.Button>,document.getElementById("xxx"));
Motivation 🔦
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Documentation - Global: Plugin - TypeScript
UMD. A UMD module is one that can either be used as module (through an import), or as a global (when run in...
Read more >How to override a TypeScript UMD global type definition?
Consider adding an import instead. It tells me that 'THREE' refers to a UMD global, but the current file is a module. Consider...
Read more >Consider allowing access to UMD globals from modules #10178
What is a scenario in which your only option is to use the global version of a module, but TypeScript doesn't allow you...
Read more >Library Structures - TypeScript
Today, most popular globally-accessible libraries are actually written as UMD libraries (see below). UMD library documentation is hard to distinguish from ...
Read more >Types and type declarations | Manual - Deno
When TypeScript is type checking a file, it only cares about the types for the file ... declarations (UMD declarations) and not ambient/global...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hello @oliviertassinari, I think this will not impact non-UMD users. Because if a ts file is a module that use
import
orexport
, the umd global is not visible. Unless you set the https://www.typescriptlang.org/en/tsconfig#allowUmdGlobalAccess to true.And why do you think there are +99% users that use non-UMD? I am not a professional front-end programmer. I have some reasons that use the UMD version.
I think for jquery, it just declare the global variable
$
andjQuery
inmisc.d.ts
.