TypeScript-DOM-lib-generator
                                
                                 TypeScript-DOM-lib-generator copied to clipboard
                                
                                    TypeScript-DOM-lib-generator copied to clipboard
                            
                            
                            
                        add URLPattern type in DOM or something lib?
lib Update Request
Configuration Check
My compilation target is ESNEXT and my lib is the default.
Missing / Incorrect Definition
URLPattern is enabled by default in Chrome and Edge version 95 and above.
But TypeScript missing the definition
Sample Code
new window.URLPattern({
    pathname: '/:a/:b',
})

Documentation Link
doc: https://web.dev/urlpattern/
Per MDN only Chromium enabled that feature yet. https://developer.mozilla.org/en-US/docs/Web/API/URLPattern#browser_compatibility
It would be really awesome to also get a utility type that produces the correct groups types based on the pattern string. So we could write code like:
const pattern = new URLPattern('/one/:foo', document.baseURI);
const params = pattern.exec('http://localhost/one/bar').pathname.groups;
console.log(params.foo); // no error
console.log(params.bar); // error
Xref https://github.com/denoland/deno/issues/12558
For reference, there's a polyfill that comes with types. You just have to import it without assignments so it's available globally, including the types.
https://github.com/kenchris/urlpattern-polyfill/blob/main/src/types.d.ts
You can alternatively add this line to your global.d.ts to just import its types:
/// <reference types="urlpattern-polyfill" />