TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Tool for generating dom related TypeScript and JavaScript library files

Results 220 TypeScript-DOM-lib-generator issues
Sort by recently updated
recently updated
newest added

add URLPattern type in DOM or something lib?

[{"_id":"635ae036ea01ec786e7ce9b8","body":"Per MDN only Chromium enabled that feature yet. https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/URLPattern#browser_compatibility","issue_id":1661112978020,"origin_id":966274482,"user_origin_id":3396686,"create_time":1636634817,"update_time":1636634817,"id":1666900022241,"updated_at":"2022-10-27T19:47:02.241000Z","created_at":"2022-10-27T19:47:02.241000Z"},{"_id":"635ae036ea01ec786e7ce9b9","body":"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:\r\n\r\n```ts\r\nconst pattern = new URLPattern('\/one\/:foo', document.baseURI);\r\nconst params = pattern.exec('http:\/\/localhost\/one\/bar').pathname.groups;\r\nconsole.log(params.foo); \/\/ no error\r\nconsole.log(params.bar); \/\/ error\r\n```","issue_id":1661112978020,"origin_id":974249334,"user_origin_id":522948,"create_time":1637341612,"update_time":1637341612,"id":1666900022255,"updated_at":"2022-10-27T19:47:02.255000Z","created_at":"2022-10-27T19:47:02.255000Z"},{"_id":"635ae036ea01ec786e7ce9ba","body":"Xref https:\/\/github.com\/denoland\/deno\/issues\/12558","issue_id":1661112978020,"origin_id":990174375,"user_origin_id":7829205,"create_time":1639078881,"update_time":1639078881,"id":1666900022342,"updated_at":"2022-10-27T19:47:02.342000Z","created_at":"2022-10-27T19:47:02.342000Z"},{"_id":"635ae036ea01ec786e7ce9bb","body":"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. \r\n\r\nhttps:\/\/github.com\/kenchris\/urlpattern-polyfill\/blob\/main\/src\/types.d.ts\r\n\r\nYou can alternatively add this line to your `global.d.ts` to just import its types:\r\n\r\n```xml\r\n\/\/\/ <reference types=\"urlpattern-polyfill\" \/>\r\n```\r\n\r\n","issue_id":1661112978020,"origin_id":1146844509,"user_origin_id":1402241,"create_time":1654446878,"update_time":1658295904,"id":1666900022416,"updated_at":"2022-10-27T19:47:02.415000Z","created_at":"2022-10-27T19:47:02.415000Z"}] comment

# lib Update Request ## Configuration Check My compilation *target* is `ESNEXT` and my *lib* is `the default`. ## Missing / Incorrect Definition [URLPattern](https://web.dev/urlpattern/) is enabled by default in Chrome...

Ambiguity in the Contribution Guidelines

[{"_id":"635ad1aaea01ec786e7cdeb2","body":"As I understand most API are pulled (over different sources) from the idl-definitions directly from the spec.\r\n\r\nSo most cases you have to change here. An example:\r\n\r\nhttps:\/\/www.w3.org\/TR\/web-animations-1\/#the-animatable-interface-mixin\r\n\r\nThe `interface mixin Animatable` has a function `animate` where the first param is of type `object` wich in typescript would be `any` so this is overwritten to a better type here\r\n\r\nhttps:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator\/blob\/main\/inputfiles\/overridingTypes.jsonc#L10-L21\r\n\r\nAs the browsers use the IDL while implementing features those definitions are near 100% correct.\r\n\r\nI would guess most of the type overrides are cases where we can make the IDL more specific. \r\n\r\nThis is also true for when you make functions generic.\r\n\r\n\r\n","issue_id":1661112978023,"origin_id":1173130337,"user_origin_id":24830662,"create_time":1656865265,"update_time":1656865265,"id":1666896298944,"updated_at":"2022-10-27T18:44:58.944000Z","created_at":"2022-10-27T18:44:58.944000Z"},{"_id":"635ad1aaea01ec786e7cdeb3","body":"> Once MDN gets updated then _eventually_ this project will pull them in, and the changes will then _eventually_ make it into a subsequent version of TypeScript after [deploying the changes here to the TypeScript repo](https:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator#deployment-to-typescript). Is this understanding correct?\r\n\r\nYes, exactly. Data from MDN will reflect here e.g. #1365 adding new `AuthenticatorAttestationResponse` members.\r\n\r\nI guess you are confused because `AuthenticatorTransport` is not covered in MDN. I guess the readme should mention which things are in MDN and which things are not, and perhaps more details about how `overridingTypes` works. (It basically works based on https:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator\/blob\/main\/src\/build\/types.d.ts)","issue_id":1661112978023,"origin_id":1250261372,"user_origin_id":3396686,"create_time":1663504526,"update_time":1663504526,"id":1666896298947,"updated_at":"2022-10-27T18:44:58.947000Z","created_at":"2022-10-27T18:44:58.947000Z"}] comment

I'm interested in updating some WebAuthn-related types like `AuthenticatorTransport` and `AuthenticatorAttestationResponse` that have gained new properties and values in the wild, but these new values aren't represented in the respective...

[QUESTION] Any plans to include Window-Placement API

[{"_id":"635ae2263056137e265f6093","body":"You are right.\r\nWe need to have this browser support. After that we can (and probably will) add it here.","issue_id":1661112978028,"origin_id":1150723138,"user_origin_id":2410353,"create_time":1654756079,"update_time":1654756079,"id":1666900518970,"updated_at":"2022-10-27T19:55:18.970000Z","created_at":"2022-10-27T19:55:18.970000Z"},{"_id":"635ae2263056137e265f6094","body":"The whole process is automated.\r\n\r\nFirst it gets all proposals from [w3c\/webref](https:\/\/github.com\/w3c\/webref), then it filters APIs supported by at least two browsers according to [mdn\/browser-compat-data](https:\/\/github.com\/mdn\/browser-compat-data). It rarely excludes APIs manually.","issue_id":1661112978028,"origin_id":1173124483,"user_origin_id":1330321,"create_time":1656863090,"update_time":1656863090,"id":1666900518975,"updated_at":"2022-10-27T19:55:18.975000Z","created_at":"2022-10-27T19:55:18.975000Z"},{"_id":"667f7a07899db58b59015ccc","body":"> I have read that a feature have to be supported by two major browser engines to be included.\r\n\r\nWell, you answered your own question. In the mean time you can manually install a package like\r\nhttps:\/\/www.npmjs.com\/package\/@types\/webscreens-window-placement","issue_id":1661112978028,"origin_id":1445309159,"user_origin_id":787865,"create_time":1677404047,"update_time":1677404047,"id":1719630343043,"updated_at":"2024-06-29T03:05:43.042000Z","created_at":"2024-06-29T03:05:43.042000Z"}] comment

Hello! I have read that a feature have to be supported by two major browser engines to be included. However, I was just wondering if there are any plans in...

Support for `structuredClone`

[{"_id":"635ad8583056137e265f58cf","body":"Thanks for the ping. It will be automatically added when it gets multiple implementations.","issue_id":1661112978032,"origin_id":1004101847,"user_origin_id":3396686,"create_time":1641217444,"update_time":1641217444,"id":1666898008066,"updated_at":"2022-10-27T19:13:28.066000Z","created_at":"2022-10-27T19:13:28.066000Z"},{"_id":"635ad8583056137e265f58d0","body":"Note: `@mdn\/[email protected]` now has enough browser implementations for `structuredClone`, but it need an override to become generic: \r\n\r\n```ts\r\ndeclare function structuredClone(value: any, options?: StructuredSerializeOptions): any;\r\n```\r\n\r\nAnd 4.1.8 breaks `XMLHttpRequestEventTarget`","issue_id":1661112978032,"origin_id":1056313611,"user_origin_id":1330321,"create_time":1646200843,"update_time":1646202311,"id":1666898008070,"updated_at":"2022-10-27T19:13:28.070000Z","created_at":"2022-10-27T19:13:28.070000Z"},{"_id":"635ad8583056137e265f58d1","body":"Yeah, #1282. \ud83d\ude2c","issue_id":1661112978032,"origin_id":1056765178,"user_origin_id":3396686,"create_time":1646216950,"update_time":1646216950,"id":1666898008074,"updated_at":"2022-10-27T19:13:28.073000Z","created_at":"2022-10-27T19:13:28.073000Z"},{"_id":"635ad8583056137e265f58d2","body":"fixed with #1283","issue_id":1661112978032,"origin_id":1056855896,"user_origin_id":2410353,"create_time":1646222818,"update_time":1646222818,"id":1666898008077,"updated_at":"2022-10-27T19:13:28.077000Z","created_at":"2022-10-27T19:13:28.077000Z"},{"_id":"635ad8583056137e265f58d3","body":">but it need an override to become generic:\r\n\r\nI guess this one still needs to be done","issue_id":1661112978032,"origin_id":1056914858,"user_origin_id":3396686,"create_time":1646226683,"update_time":1646226683,"id":1666898008080,"updated_at":"2022-10-27T19:13:28.079000Z","created_at":"2022-10-27T19:13:28.079000Z"},{"_id":"635ad8583056137e265f58d5","body":"Any progress here?","issue_id":1661112978032,"origin_id":1095298211,"user_origin_id":1749623,"create_time":1649695935,"update_time":1649695935,"id":1666898008084,"updated_at":"2022-10-27T19:13:28.084000Z","created_at":"2022-10-27T19:13:28.084000Z"},{"_id":"635ad8583056137e265f58d6","body":"PRs welcome.","issue_id":1661112978032,"origin_id":1095298765,"user_origin_id":3396686,"create_time":1649695970,"update_time":1649695970,"id":1666898008087,"updated_at":"2022-10-27T19:13:28.087000Z","created_at":"2022-10-27T19:13:28.087000Z"},{"_id":"635ad8583056137e265f58d7","body":"FWIW, one issue I ran into with my own generic version is that if the source object is (deeply) `readonly` (I had a complex template object defined with `as const` to get good type information), the result of the structured clone is _also_ considered (deeply) `readonly`.\r\n\r\nIn my case, the whole point was to clone the template object a few times and then write to the clones, so I had to add a hacky `DeepWritable<T>` to make it work. I don't know whether it _always_ makes sense for `readonly` to be stripped as the result of cloning, but simply specifying that the output type match the input type might not be ideal either.","issue_id":1661112978032,"origin_id":1162352287,"user_origin_id":55082669,"create_time":1655845076,"update_time":1655845153,"id":1666898008091,"updated_at":"2022-10-27T19:13:28.091000Z","created_at":"2022-10-27T19:13:28.091000Z"},{"_id":"6396dd1f70db72139b222851","body":"Any chance we could get a typed return value in the future?\r\n\r\nSomething like `declare function structuredClone(value: T, options?: StructuredSerializeOptions): T;` ?\r\n\r\nI know that `structuredClone` is not returning a strictly identical object (functions are silently removed for instance).\r\nMaybe that's the reason to use `: any` here?\r\n\r\n","issue_id":1661112978032,"origin_id":1342638876,"user_origin_id":1979087,"create_time":1670501690,"update_time":1670502584,"id":1670831391245,"updated_at":"2022-12-12T07:49:51.244000Z","created_at":"2022-12-12T07:49:51.244000Z"},{"_id":"6396dd1f70db72139b222852","body":"My current \"workaround\" (let me know what you think)\r\n\r\n```typescript\r\ntype MyType = {\r\n ok?: boolean\r\n}\r\n\r\nconst foo: MyType = {}\r\n\r\nconst bar = structuredClone(foo) as typeof foo\r\n\/*\r\nWhy use \"typeof foo\" instead of \"MyType\" above?\r\n - To be sure to pick the right type\r\n - To define the type only in 1 place (at the definition of \"foo\")\r\n - That way, changing the type of \"foo\" in the future will automatically apply to \"bar\".\r\n*\/\r\n\r\nbar.ok = true \/\/ OK\r\nbar.something = 'else' \/\/ Typescript error, because bar belongs to MyType\r\n```","issue_id":1661112978032,"origin_id":1342653567,"user_origin_id":1979087,"create_time":1670502379,"update_time":1670505651,"id":1670831391249,"updated_at":"2022-12-12T07:49:51.248000Z","created_at":"2022-12-12T07:49:51.248000Z"},{"_id":"6396dd1f70db72139b222853","body":"This type declaration works for me:\r\n```ts\r\ntype Cloneable<T> = T extends Function | Symbol\r\n ? never \r\n : T extends Record<any, any> \r\n ? {-readonly [k in keyof T]: Cloneable<T[k]>}\r\n : T\r\n\r\ndeclare function structuredClone<T>(value: Cloneable<T>, options?: StructuredSerializeOptions | undefined): Cloneable<T>\r\n```\r\n\r\n1. Return type = value type\r\n2. In the returned type, all fields are writable. But maybe returned type should keep `readonly`?\r\n3. Will throw a type error if the passed object at any depth contains data that cannot be cloned (function or symbol). This is most important, in my opinion.\r\n\r\n```ts\r\nconst value = {foo: 1} as const\r\nstructuredClone(value) \/\/ { foo: 1 } Note, foo now writable\r\n\r\nconst value = {foo: 1, fn() {}} as const\r\nstructuredClone(value) \/\/ expect type error because function can't be cloned and it will throw DOMException in runtime\r\n```\r\n\r\n[Playground](https:\/\/www.typescriptlang.org\/play?#code\/FAFwngDgpgBAwgGwPYDsoEMBGCoB4AqAfDALwz4xQAeIUKAJgM4wBiArigMYgCWqMAHxgBlMAFtMSBMBgwA-DDQA3KACcYMmAC5ylGnSYwASlE5JV9XOhRgANDGthim2QoDeAWlUZ6qBGBgAbQBrGB4UGGCoMCQAM3IAXR1EVAxsPHwQhMIAXxdtcmAi+lMEdG8YWI5uPgjGEFU2bjZvehS0AHE6NR5OAkIACiV0BDYoZOQ0LBx++yQIXlRGOR1hBqaQFqh6YR6RngAvKAB5BdrmIQ4S2PDtgEoJ1OmMwiLgesbm1vaoLrRVXoDADkH3CAHMgXcANzvdZfbY-P49TgDACMACYAMzQ2GfTbfSa-boAlGxEaMKA4j4bLZtQlIkkDQIJKlw-EI+nEwEoNgIBA4gD0ApgAAEQIwPNRoNxJapVOYYAARY4AWQAolROFAzqgdOwuIsIkhMAArUwgGBmXn0RRIC2YWCcQn0XE0gmpBmAgZ3UjEVGC4ViiVS82y+XqZXqzXaw06ADq4V8AHcAHTU+F01I6DiMNgQCDmWg28DQSoK9Psm30dAgdCujOIrkotBJkTiST8mFFIUwACCcvQYEY9crjf+gMCIIa4KB9lR9nWUHsVygNzQ9HsPL5LJhPaDkqo0pAYYVkY1Wp1KHjiaQqYrtJ+2ZQufzhe2MBLsFi5bZtJg1drEcH05ccUUnUEUAhOcF0aJcYBXNdtk3XkEHsUQJCkb0d2APdxQPI8TwjVVzxjWo9WqQ0YGNM1uEtJBrVte1HWdFMgPdTomyZKcAUg2cYHnD9YOXBhV1uDdFBQ+xvV9fjsO7YVjlNc02I5D1OLcCCwR0biZ2QiQ1B0ATJCkDAr0EsZhOuMSnys9dkL5HQtwQHIA1FPCQxlNRwyVYjo0va8GFvNNf3Y8Z4OfPMC1UIsP0gL8fzxP8ALre9Qs9FENOnSDtM0vieX01RDPsYycGsHRF0s0T1xsqqkIkhz6tQmBGHbKRVlahBvRc3dA3cw9Qy809fIvWNWAo2oqKU2irQQG0UDtGAHUtFiVMzDjQIGTKeK0mAdN4vSHUK-jiqQEyyvMuCEOs8LbLqpzHMkyozOkkg-W6t4e0VKBtRgRSaJAVax2RTaECUBBUR0NxQYQdFIehzFIc0nKsqgiSCqKxbTtKsyKpu2r6BqxDxPuxqcjJ97cODfrPLlIaoxGsiYATQK7xC1S0CfF8opiz8y3UVL32SwGQOBqGwYhmAxZhuGwYRyWkd23KDoM47MbOnGhLxonCbE+yEAevl7BajD9bbE2uvJ1z9w849BqI+nSN1MaDQm6jzTohj5qY5bUnoViBbWokNqliWpdhyX4cRlHke2vK2HR1WStM8rNau6qtd1xqDaa2Jnp9V7+PJ96gA)","issue_id":1661112978032,"origin_id":1345515448,"user_origin_id":1662812,"create_time":1670754550,"update_time":1670771204,"id":1670831391251,"updated_at":"2022-12-12T07:49:51.251000Z","created_at":"2022-12-12T07:49:51.251000Z"},{"_id":"6396dd1f70db72139b222854","body":"That one failed for me on types containing arrays (or maybe just tuples). I managed to get my overly complex type to work using this:\r\n```typescript\r\ntype Cloneable<T> = T extends Function | Symbol\r\n ? never\r\n : T extends readonly [infer e0]\r\n ? readonly [Cloneable<e0>]\r\n : T extends [infer e1]\r\n ? [Cloneable<e1>]\r\n : T extends readonly [infer e2, ...infer A2]\r\n ? readonly [Cloneable<e2>, ...Cloneable<[...A2]>]\r\n : T extends [infer e3, ...infer A3]\r\n ? [Cloneable<e3>, ...Cloneable<[...A3]>]\r\n : T extends readonly (infer e4)[]\r\n ? readonly Cloneable<e4>[]\r\n : T extends (infer e5)[]\r\n ? Cloneable<e5>[]\r\n : T extends object\r\n ? { [k in keyof T]: Cloneable<T[k]> }\r\n : T;\r\n```\r\nThat one does not strip `readonly` however (which is fine for me, but maybe not in general).","issue_id":1661112978032,"origin_id":1345575596,"user_origin_id":55082669,"create_time":1670770548,"update_time":1670770548,"id":1670831391255,"updated_at":"2022-12-12T07:49:51.255000Z","created_at":"2022-12-12T07:49:51.255000Z"},{"_id":"667f79ea74fb49ab3a04613d","body":"Props to both attempts, unfortunately both fail for me with branded types, which I understand is somewhat of a second class citizen in TS, but are used in the official [nominal typing example](https:\/\/www.typescriptlang.org\/play?#code\/PTAEEFQOwewWwJZQIYBtQBcCeAHApqAM5aEZ5yhx7JSGYAWyGo1AxvZrgQnQK5QIAjrzwAoEKBoATFgDc8UUAgBmnfHUbyGBQsiqgpTZKCwxeoVjVjNkhQggDmUcWGSsATjDtq8hAHSiLqAAKlwAyh4IOBgA5HTY+EQkZBQ8RBjuvKwYvO5oADSgAO70COyU1LRBKto+SnSEjPgyqAgA1gTGUllthQixdF09fqAAkqrIQQ4wXgSMg6joGPQ6ep0YGQgARrxkg4MGPYXLCko2qIQw1QfdrG0jAJpmFjSgqNTuinAw7nN4vwAuFgADz0OHeANImWyuTQAFoEkgHIEJMFSnRLIpNAQpHkils3G1CIVlD8QWD3tpfpJqZZCL4giV-p10u4kaAyVBeHAtv8XljkFpCPhWAg0BYYFAyMCbFAZKZeEEpJKYswijRmBgYHI+XBkB1arI0CJ4nlaMp-nktu8RgAxH5BPCguDgvAAlxBOGgUAAVXp7jGUBwu1AYU2UAcdAAFPxdBaAJSe73BM2EVBMBCS0PhyNJ33+sZSBQYFRlDNZgBy3N57kIefArFYvjowRgHSqQQA6gRMaAHHhmN9SBzVCdQEbUCJQMpPBRjLBECgllwgsRSORiv0OMZWhtKVt+iOQRljKwYEWAl28DFqdN2VrQLx6ZJFEgyLW8NlM0ufIUilvJEfARhDECQz1oE83yURQx1JdwKBgCZQBwTx8HcbAXkWPAZAAfRwrYzRkKNlh4a4JSgeQpW-eNilKco9Q6OhDwQF0vHsa0CAfWx7CcSQglgeDxShe9tWMAA1NAEEMMgpFGINdjDNkI0vBICAk1ppOwuTgwwRT2QAXlZdkADJQAAb1APCCOkIEACI-T5bSQwABS8Zh1Kk8soFs0AAF8AG4UTAbtN0WR9n2MZR+C-LMHxPc0fjnIyI0wK4JHEyTNNk+TdJzUAvR2TUVmQmAoKKH5lmgGASwjMjliYYpr2pAArJ9mBwshFiRHCQnCSJogYBr+jiTBMjwS9wOHCdPLIBz3Cc5hDKjJAdKBYSIxo-SAD5zNEb1JuYewXXeDysoW0BDJW3Y-F+cE3DwKNgAAHQAHmABxClswATIls+NAu9X4ck+IgWNdU6mC0nLJDocGZIWvSI0CgKgtACsYCKRr+QsX4IenaKS0lOgSjKDh-zCyVUCwSRGzwaIgjMAMoDwDGFyQcVVMKaQqqKgh+yZvJ0HWhwfAmwnmBQt8KzWC7QCjFAqCBWHIZ0hGHE2nazL28jLhtVAYAcOW1j+0RkaCe0AydCk8EKFZfhGy59FjZALWgnTp1nQCn3+Qo71qiRlk8XgHA4MdpukskuZORReXZNA9aKbDUtAXlkKUmT3VEA7XZDQzbLQf4MCjGIthgLYtipjBkA4wgYnjWzAqzsOIeyt3DKb2b-QW5acuNiWpSlqgo3b5XdmNoIAHkYOK6rbdARg5UKHBuPvYr+DhYeZCF1Kgj7jAB4IMn0DyHgWTPF0EHeC33E8dwM93-fu50seJCecxexxmRT3gFC8BWWgEC0DAeQ7hZAIGZkeE4SoVAWl+FKYoyASBJw8NQMgVVFzsy4MSF8MgTgIHcEEE8RY4SIWUExKeaQAAsAAGKhEo4BUDgXrFKABxfoAAJXgWx6iEBEO6EAQR6AbBwIQAEIAHBbk4X4M+wAACyZRPCXGUBgYAoR8ARDZNEYAPAeG+GAAAJioXoj06U5QMDSDgNy9RAIOBxodbkep3BYD4cAARQiREgEQOwNAAAvfOdwEBSPgMAVmS4ES4CRHCJAYT1D9WUaIIAA) in the playground. Note I also tried the `unique symbol` method of branding. Chucking in a `T extends Primitive ? T : ...` where `type Primitive = string | number | boolean | null | undefined | symbol;` fixes it (I think?).","issue_id":1661112978032,"origin_id":1464591915,"user_origin_id":47338477,"create_time":1678488618,"update_time":1678488618,"id":1719630314388,"updated_at":"2024-06-29T03:05:14.387000Z","created_at":"2024-06-29T03:05:14.387000Z"},{"_id":"667f79ea74fb49ab3a04613e","body":"I'm slightly worried that the recently merged generic type signature for `structuredClone` is a bit too permissive. While the PR mentions the lack of support for the error case where a provided object causes the function to throw an error, it does not address [properties that are not preserved (see third bullet point)](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Web_Workers_API\/Structured_clone_algorithm#things_that_dont_work_with_structured_clone). I think this is an even more important case as it is one that will not surface at the `structuredClone` callsite, but instead elsewhere in the code where a property is unexpectedly undefined.","issue_id":1661112978032,"origin_id":1486731042,"user_origin_id":4227194,"create_time":1680004595,"update_time":1680004595,"id":1719630314396,"updated_at":"2024-06-29T03:05:14.396000Z","created_at":"2024-06-29T03:05:14.396000Z"},{"_id":"667f79ea74fb49ab3a04613f","body":"I merged it because it's certainly better than `any`, but yes, it could be confusing as now the IDE will suggest fields that can't be cloned. Not sure there's a better way, though.","issue_id":1661112978032,"origin_id":1486830383,"user_origin_id":3396686,"create_time":1680007854,"update_time":1680007854,"id":1719630314401,"updated_at":"2024-06-29T03:05:14.400000Z","created_at":"2024-06-29T03:05:14.400000Z"},{"_id":"667f79ea74fb49ab3a046140","body":"Well anything is better than `any` but I do understand the usability of having an entirely permissive signature for this function. I manage types for an internal codebase that recently added support for `structuredClone` and our definition was `(unknown) => unknown` with the assertion being that if you wanted to use it, you would need to manually cast the cloned result to whatever type you wanted. From a type perspective the type cast would be equivalent to the \"identity type parameter\" signature used above, but with the added benefit of having an explicit cast that raises the appropriate yellow flags (i.e. lint warnings).","issue_id":1661112978032,"origin_id":1486864024,"user_origin_id":4227194,"create_time":1680009138,"update_time":1680009138,"id":1719630314404,"updated_at":"2024-06-29T03:05:14.403000Z","created_at":"2024-06-29T03:05:14.403000Z"},{"_id":"667f79ea74fb49ab3a046141","body":"Seems a bit too late to share more robust implementation, how about snippet in https:\/\/github.com\/uhyo\/better-typescript-lib\/issues\/37#issuecomment-1916384592 ?\r\nIt eliminates functions and symbols, inheritance, therefore more robust about both argument and return type.\r\n","issue_id":1661112978032,"origin_id":1918429449,"user_origin_id":48310258,"create_time":1706680076,"update_time":1706680076,"id":1719630314408,"updated_at":"2024-06-29T03:05:14.408000Z","created_at":"2024-06-29T03:05:14.408000Z"}] comment

New DOM api `structuredClone` should be added. MDN: https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

TypeScript 4.4 libdom changes

[{"_id":"635ada058041c95dfb172084","body":"# High Level Changes from 4.3 to 4.4\r\n\r\n## `dom.d.ts`\r\n\r\n## New interfaces\r\n\r\n* `BlobEvent`\r\n* `CSSAnimation`\r\n* `CSSCounterStyleRule`\r\n* `CSSTransition`\r\n* `ClipboardItem`\r\n* `FileSystem`\r\n* `FileSystemDirectoryEntry`\r\n* `FileSystemDirectoryReader`\r\n* `FileSystemEntry`\r\n* `FileSystemFileEntry`\r\n* `FontFace`\r\n* `FontFaceSet`\r\n* `FontFaceSetLoadEvent`\r\n* `FormDataEvent`\r\n* `IdleDeadline`\r\n* `MathMLElement`\r\n* `MediaCapabilities`\r\n* `MediaMetadata`\r\n* `MediaRecorder`\r\n* `MediaRecorderErrorEvent`\r\n* `MediaSession`\r\n* `NetworkInformation`\r\n* `PerformanceEventTiming`\r\n* `PerformancePaintTiming`\r\n* `PictureInPictureWindow`\r\n* `RemotePlayback`\r\n* `SVGMPathElement`\r\n* `SVGSetElement`\r\n* `SubmitEvent`\r\n\r\n## Removed interfaces\r\n\r\n* `ApplicationCache`\r\n* `BhxBrowser`\r\n* `CaretPosition`\r\n* `ClientRect`\r\n* `ClientRectList`\r\n* `CryptoKeyPair`\r\n* `DOMError`\r\n* `DOMSettableTokenList`\r\n* `DataCue`\r\n* `DeferredPermissionRequest`\r\n* `DeviceAcceleration`\r\n* `DeviceRotationRate`\r\n* `ExtensionScriptApis`\r\n* `FocusNavigationEvent`\r\n* `GamepadPose`\r\n* `HTMLAppletElement`\r\n* `HTMLDialogElement`\r\n* `HTMLTableDataCellElement`\r\n* `HTMLTableHeaderCellElement`\r\n* `InputDeviceInfo`\r\n* `ListeningStateChangedEvent`\r\n* `MSAssertion`\r\n* `MSBlobBuilder`\r\n* `MSFIDOCredentialAssertion`\r\n* `MSFIDOSignature`\r\n* `MSFIDOSignatureAssertion`\r\n* `MSGesture`\r\n* `MSGraphicsTrust`\r\n* `MSInputMethodContext`\r\n* `MSMediaKeyError`\r\n* `MSMediaKeySession`\r\n* `MSMediaKeys`\r\n* `MSStream`\r\n* `MediaStreamError`\r\n* `MediaStreamErrorEvent`\r\n* `MediaStreamEvent`\r\n* `MediaStreamTrackAudioSourceNode`\r\n* `NavigationPreloadManager`\r\n* `NodeFilter`\r\n* `OffscreenCanvas`\r\n* `OffscreenCanvasRenderingContext2D`\r\n* `OverflowEvent`\r\n* `PerfWidgetExternal`\r\n* `PermissionRequest`\r\n* `PermissionRequestedEvent`\r\n* `RTCDtlsTransportStateChangedEvent`\r\n* `RTCDtmfSender`\r\n* `RTCError`\r\n* `RTCErrorEvent`\r\n* `RTCIceCandidatePairChangedEvent`\r\n* `RTCIceGatherer`\r\n* `RTCIceGathererEvent`\r\n* `RTCIceTransportStateChangedEvent`\r\n* `RTCIdentityAssertion`\r\n* `RTCSctpTransport`\r\n* `RTCSrtpSdesTransport`\r\n* `RTCSsrcConflictEvent`\r\n* `RTCStatsProvider`\r\n* `RandomSource`\r\n* `SVGCursorElement`\r\n* `SVGElementInstance`\r\n* `SVGElementInstanceList`\r\n* `SVGPathSeg`\r\n* `SVGPathSegArcAbs`\r\n* `SVGPathSegArcRel`\r\n* `SVGPathSegClosePath`\r\n* `SVGPathSegCurvetoCubicAbs`\r\n* `SVGPathSegCurvetoCubicRel`\r\n* `SVGPathSegCurvetoCubicSmoothAbs`\r\n* `SVGPathSegCurvetoCubicSmoothRel`\r\n* `SVGPathSegCurvetoQuadraticAbs`\r\n* `SVGPathSegCurvetoQuadraticRel`\r\n* `SVGPathSegCurvetoQuadraticSmoothAbs`\r\n* `SVGPathSegCurvetoQuadraticSmoothRel`\r\n* `SVGPathSegLinetoAbs`\r\n* `SVGPathSegLinetoHorizontalAbs`\r\n* `SVGPathSegLinetoHorizontalRel`\r\n* `SVGPathSegLinetoRel`\r\n* `SVGPathSegLinetoVerticalAbs`\r\n* `SVGPathSegLinetoVerticalRel`\r\n* `SVGPathSegList`\r\n* `SVGPathSegMovetoAbs`\r\n* `SVGPathSegMovetoRel`\r\n* `SVGZoomEvent`\r\n* `ServiceUIFrameContext`\r\n* `SpeechGrammar`\r\n* `SpeechGrammarList`\r\n* `SpeechRecognition`\r\n* `SpeechRecognitionErrorEvent`\r\n* `SpeechRecognitionEvent`\r\n* `StyleMedia`\r\n* `SyncManager`\r\n* `TextEvent`\r\n* `VRDisplay`\r\n* `VRDisplayCapabilities`\r\n* `VRDisplayEvent`\r\n* `VREyeParameters`\r\n* `VRFieldOfView`\r\n* `VRFrameData`\r\n* `VRPose`\r\n* `WebKitPoint`\r\n* `webkitRTCPeerConnection`\r\n\r\n## Modified\r\n\r\n* Animation\r\n * Added: `onremove`, `replaceState`, `commitStyles`, `persist`\r\n* AudioContext\r\n * Removed: `outputLatency`, `createMediaStreamTrackSource`\r\n* CSSStyleDeclaration\r\n * Added: `appearance`, `aspectRatio`, `backgroundBlendMode`, `borderBlock`, `borderBlockColor`, `borderBlockStyle`, `borderBlockWidth`, `borderEndEndRadius`, `borderEndStartRadius`, `borderInline`, `borderInlineColor`, `borderInlineStyle`, `borderInlineWidth`, `borderStartEndRadius`, `borderStartStartRadius`, `colorScheme`, `contain`, `counterSet`, `fontOpticalSizing`, `fontVariantAlternates`, `fontVariationSettings`, `inset`, `insetBlock`, `insetBlockEnd`, `insetBlockStart`, `insetInline`, `insetInlineEnd`, `insetInlineStart`, `isolation`, `marginBlock`, `marginInline`, `mixBlendMode`, `offset`, `offsetAnchor`, `offsetDistance`, `offsetPath`, `offsetRotate`, `paddingBlock`, `paddingInline`, `scrollMargin`, `scrollMarginBlock`, `scrollMarginBlockEnd`, `scrollMarginBlockStart`, `scrollMarginBottom`, `scrollMarginInline`, `scrollMarginInlineEnd`, `scrollMarginInlineStart`, `scrollMarginLeft`, `scrollMarginRight`, `scrollMarginTop`, `scrollPadding`, `scrollPaddingBlock`, `scrollPaddingBlockEnd`, `scrollPaddingBlockStart`, `scrollPaddingBottom`, `scrollPaddingInline`, `scrollPaddingInlineEnd`, `scrollPaddingInlineStart`, `scrollPaddingLeft`, `scrollPaddingRight`, `scrollPaddingTop`, `scrollSnapAlign`, `scrollSnapStop`, `scrollSnapType`, `shapeImageThreshold`, `shapeMargin`, `shapeOutside`, `textDecorationSkipInk`, `textDecorationThickness`, `textUnderlineOffset`\r\n * Removed: `glyphOrientationVertical`, `maskComposite`, `maskImage`, `maskPosition`, `maskRepeat`, `maskSize`, `rubyAlign`, `textJustify`, `webkitTapHighlightColor`, `webkitTextSizeAdjust`, `zoom`\r\n* CanvasRenderingContext2D\r\n * Added: `getContextAttributes`\r\n* Clipboard\r\n * Added: `read`, `write`\r\n* CompositionEvent\r\n * Added: `initCompositionEvent`\r\n* DataTransferItemList\r\n * Removed: `item`\r\n* Document\r\n * Added: `pictureInPictureEnabled`, `rootElement`, `exitPictureInPicture`, `hasStorageAccess`, `requestStorageAccess`\r\n * Removed: `caretPositionFromPoint`, `getAnimations`\r\n* Element\r\n * Added: `part`\r\n * Removed: `msGetRegionContent`\r\n* File\r\n * Added: `webkitRelativePath`\r\n* Gamepad\r\n * Removed: `hand`, `pose`\r\n* GamepadHapticActuator\r\n * Removed: `pulse`\r\n* HTMLCanvasElement\r\n * Added: `captureStream`\r\n * Removed: `transferControlToOffscreen`\r\n* HTMLElement\r\n * Added: `outerText`\r\n* HTMLFormElement\r\n * Added: `requestSubmit`\r\n* HTMLIFrameElement\r\n * Removed: `allowPaymentRequest`\r\n* HTMLInputElement\r\n * Added: `capture`, `webkitEntries`, `webkitdirectory`\r\n* HTMLMarqueeElement\r\n * Removed: `onbounce`, `onfinish`, `onstart`\r\n* HTMLMediaElement\r\n * Added: `disableRemotePlayback`, `remote`\r\n* HTMLOptGroupElement\r\n * Removed: `form`\r\n* HTMLVideoElement\r\n * Added: `disablePictureInPicture`, `onenterpictureinpicture`, `onleavepictureinpicture`, `requestPictureInPicture`\r\n* IDBCursor\r\n * Added: `request`\r\n* IDBFactory\r\n * Added: `databases`\r\n* IDBTransaction\r\n * Added: `commit`\r\n* InputEvent\r\n * Added: `dataTransfer`, `getTargetRanges`\r\n* KeyboardEvent\r\n * Added: `initKeyboardEvent`\r\n * Removed: `char`\r\n* KeyframeEffect\r\n * Added: `pseudoElement`\r\n* MediaDevices\r\n * Added: `getDisplayMedia`\r\n* MediaStreamTrack\r\n * Added: `contentHint`\r\n* MessageEvent\r\n * Added: `initMessageEvent`\r\n* Navigator\r\n * Added: `mediaCapabilities`, `mediaSession`\r\n * Removed: `activeVRDisplays`, `msManipulationViewsEnabled`, `msMaxTouchPoints`, `msPointerEnabled`, `getUserMedia`, `getVRDisplays`, `msLaunchUri`, `msSaveBlob`, `msSaveOrOpenBlob`\r\n* Node\r\n * Removed: `namespaceURI`\r\n* Notification\r\n * Removed: `actions`, `badge`, `image`, `renotify`, `requireInteraction`, `silent`, `timestamp`, `vibrate`\r\n* PaymentRequest\r\n * Removed: `onshippingaddresschange`, `onshippingoptionchange`, `shippingAddress`, `shippingOption`, `shippingType`\r\n* PaymentResponse\r\n * Removed: `onpayerdetailchange`, `payerEmail`, `payerName`, `payerPhone`, `shippingAddress`, `shippingOption`, `addEventListener`, `removeEventListener`\r\n* PerformanceMark\r\n * Added: `detail`\r\n* PerformanceMeasure\r\n * Added: `detail`\r\n* PushSubscription\r\n * Removed: `expirationTime`\r\n* PushSubscriptionOptions\r\n * Removed: `userVisibleOnly`\r\n* RTCDtlsTransport\r\n * Removed: `iceTransport`, `onerror`, `getRemoteCertificates`\r\n* RTCIceCandidate\r\n * Added: `address`\r\n* RTCIceTransport\r\n * Removed: `ongatheringstatechange`, `onselectedcandidatepairchange`, `onstatechange`, `role`, `getLocalCandidates`, `getLocalParameters`, `getRemoteCandidates`, `getRemoteParameters`, `getSelectedCandidatePair`, `addEventListener`, `removeEventListener`\r\n* RTCPeerConnection\r\n * Removed: `idpErrorInfo`, `idpLoginUrl`, `peerIdentity`, `sctp`, `getIdentityAssertion`, `setIdentityProvider`\r\n* RTCRtpTransceiver\r\n * Removed: `setCodecPreferences`\r\n* ReadableStream\r\n * Added: `forEach`\r\n* Request\r\n * Removed: `isHistoryNavigation`, `isReloadNavigation`\r\n* Response\r\n * Removed: `trailer`\r\n* SVGAElement\r\n * Added: `rel`, `relList`\r\n* SVGAnimationElement\r\n * Added: `beginElement`, `beginElementAt`, `endElement`, `endElementAt`\r\n* SVGPathElement\r\n * Removed: `pathSegList`, `getPointAtLength`, `getTotalLength`\r\n* SVGSVGElement\r\n * Removed: `onunload`, `onzoom`, `getComputedStyle`\r\n* SVGTransformList\r\n * Added: `length`\r\n* SVGViewElement\r\n * Removed: `viewTarget`\r\n* SecurityPolicyViolationEvent\r\n * Added: `disposition`, `sample`\r\n* ServiceWorkerRegistration\r\n * Removed: `navigationPreload`, `sync`\r\n* ShadowRoot\r\n * Added: `delegatesFocus`\r\n* SourceBuffer\r\n * Added: `changeType`\r\n* StorageEvent\r\n * Added: `initStorageEvent`\r\n* TextMetrics\r\n * Added: `fontBoundingBoxAscent`, `fontBoundingBoxDescent`\r\n* Touch\r\n * Removed: `altitudeAngle`, `azimuthAngle`, `touchType`\r\n* UIEvent\r\n * Added: `initUIEvent`\r\n* VideoPlaybackQuality\r\n * Added: `corruptedVideoFrames`\r\n* Window\r\n * Added: `cancelIdleCallback`, `requestIdleCallback`\r\n * Removed: `applicationCache`, `defaultStatus`, `doNotTrack`, `msContentScript`, `offscreenBuffering`, `oncompassneedscalibration`, `ondeviceorientationabsolute`, `ongamepadconnected`, `ongamepaddisconnected`, `onmousewheel`, `onreadystatechange`, `onvrdisplayactivate`, `onvrdisplayblur`, `onvrdisplayconnect`, `onvrdisplaydeactivate`, `onvrdisplaydisconnect`, `onvrdisplaypresentchange`, `styleMedia`, `departFocus`, `getMatchedCSSRules`, `msWriteProfilerMark`, `webkitCancelAnimationFrame`, `webkitConvertPointFromNodeToPage`, `webkitConvertPointFromPageToNode`, `webkitRequestAnimationFrame`\r\n* WritableStream\r\n * Added: `close`\r\n\r\n### Non-value types\r\n\r\n* AddEventListenerOptions\r\n * Added: `signal`\r\n* CanvasRenderingContext2DSettings\r\n * Added: `colorSpace`, `willReadFrequently`\r\n* ComputedEffectTiming\r\n * Added: `startTime`\r\n* EffectTiming\r\n * Added: `playbackRate`\r\n* InputEventInit\r\n * Added: `dataTransfer`, `targetRanges`\r\n* KeyframeEffectOptions\r\n * Added: `pseudoElement`\r\n* MediaKeySystemMediaCapability\r\n * Added: `encryptionScheme`\r\n* MediaStreamConstraints\r\n * Added: `preferCurrentTab`\r\n* MediaTrackCapabilities\r\n * Added: `cursor`, `displaySurface`, `logicalSurface`\r\n* MediaTrackConstraintSet\r\n * Added: `suppressLocalAudioPlayback`\r\n * Removed: `autoGainControl`, `noiseSuppression`, `resizeMode`\r\n* MediaTrackSettings\r\n * Added: `restrictOwnAudio`\r\n * Removed: `autoGainControl`, `channelCount`, `latency`, `noiseSuppression`, `resizeMode`\r\n* MediaTrackSupportedConstraints\r\n * Added: `suppressLocalAudioPlayback`\r\n * Removed: `autoGainControl`, `channelCount`, `latency`, `noiseSuppression`, `resizeMode`\r\n* OptionalEffectTiming\r\n * Added: `playbackRate`\r\n* PaymentDetailsBase\r\n * Removed: `shippingOptions`\r\n* PaymentDetailsUpdate\r\n * Removed: `error`, `payerErrors`, `shippingAddressErrors`\r\n* PaymentValidationErrors\r\n * Removed: `payer`, `shippingAddress`\r\n* RTCIceCandidatePairStats\r\n * Removed: `bytesDiscardedOnSend`, `circuitBreakerTriggerCount`, `consentExpiredTimestamp`, `consentRequestsSent`, `currentRtt`, `firstRequestTimestamp`, `lastPacketReceivedTimestamp`, `lastPacketSentTimestamp`, `lastRequestTimestamp`, `lastResponseTimestamp`, `packetsDiscardedOnSend`, `packetsReceived`, `packetsSent`, `priority`, `retransmissionsReceived`, `retransmissionsSent`, `totalRtt`\r\n* RTCPeerConnectionIceErrorEventInit\r\n * Added: `errorText`\r\n * Removed: `statusText`\r\n* RTCRtpEncodingParameters\r\n * Added: `priority`\r\n* RTCRtpSendParameters\r\n * Added: `degradationPreference`\r\n* RTCRtpSynchronizationSource\r\n * Removed: `voiceActivityFlag`\r\n* RTCTransportStats\r\n * Removed: `iceRole`, `packetsReceived`, `packetsSent`, `selectedCandidatePairChanges`, `tlsGroup`\r\n* SecurityPolicyViolationEventInit\r\n * Added: `disposition`, `sample`\r\n* ShadowRootInit\r\n * Added: `slotAssignment`\r\n* ShareData\r\n * Added: `files`\r\n* UIEventInit\r\n * Added: `which`\r\n* AnimationEventMap\r\n * Added: `\"remove\"`\r\n* CanvasUserInterface\r\n * Removed: `scrollPathIntoView`\r\n* DocumentOrShadowRoot\r\n * Added: `pictureInPictureElement`, `getAnimations`\r\n * Removed: `caretPositionFromPoint`, `caretRangeFromPoint`, `elementFromPoint`, `elementsFromPoint`, `getSelection`\r\n* GlobalEventHandlersEventMap\r\n * Added: `\"formdata\"`, `\"webkitanimationend\"`, `\"webkitanimationiteration\"`, `\"webkitanimationstart\"`, `\"webkittransitionend\"`\r\n * Removed: `\"cancel\"`, `\"dragexit\"`\r\n* GlobalEventHandlers\r\n * Added: `onformdata`, `onwebkitanimationend`, `onwebkitanimationiteration`, `onwebkitanimationstart`, `onwebkittransitionend`\r\n * Removed: `oncancel`, `ondragexit`, `onsecuritypolicyviolation`\r\n* NavigatorContentUtils\r\n * Removed: `unregisterProtocolHandler`\r\n* ParentNode\r\n * Added: `replaceChildren`\r\n* PaymentRequestEventMap\r\n * Removed: `\"shippingaddresschange\"`, `\"shippingoptionchange\"`\r\n* RTCDtlsTransportEventMap\r\n * Removed: `\"error\"`\r\n* SVGSVGElementEventMap\r\n * Removed: `\"SVGUnload\"`, `\"SVGZoom\"`\r\n* WindowEventMap\r\n * Removed: `\"abort\"`, `\"afterprint\"`, `\"beforeprint\"`, `\"beforeunload\"`, `\"blur\"`, `\"canplay\"`, `\"canplaythrough\"`, `\"change\"`, `\"click\"`, `\"compassneedscalibration\"`, `\"contextmenu\"`, `\"dblclick\"`, `\"deviceorientationabsolute\"`, `\"drag\"`, `\"dragend\"`, `\"dragenter\"`, `\"dragleave\"`, `\"dragover\"`, `\"dragstart\"`, `\"drop\"`, `\"durationchange\"`, `\"emptied\"`, `\"ended\"`, `\"error\"`, `\"focus\"`, `\"hashchange\"`, `\"input\"`, `\"invalid\"`, `\"keydown\"`, `\"keypress\"`, `\"keyup\"`, `\"load\"`, `\"loadeddata\"`, `\"loadedmetadata\"`, `\"loadstart\"`, `\"message\"`, `\"mousedown\"`, `\"mouseenter\"`, `\"mouseleave\"`, `\"mousemove\"`, `\"mouseout\"`, `\"mouseover\"`, `\"mouseup\"`, `\"mousewheel\"`, `\"offline\"`, `\"online\"`, `\"pagehide\"`, `\"pageshow\"`, `\"pause\"`, `\"play\"`, `\"playing\"`, `\"popstate\"`, `\"progress\"`, `\"ratechange\"`, `\"readystatechange\"`, `\"reset\"`, `\"resize\"`, `\"scroll\"`, `\"seeked\"`, `\"seeking\"`, `\"select\"`, `\"stalled\"`, `\"storage\"`, `\"submit\"`, `\"suspend\"`, `\"timeupdate\"`, `\"unload\"`, `\"volumechange\"`, `\"vrdisplayactivate\"`, `\"vrdisplayblur\"`, `\"vrdisplayconnect\"`, `\"vrdisplaydeactivate\"`, `\"vrdisplaydisconnect\"`, `\"vrdisplaypresentchange\"`, `\"waiting\"`\r\n* WindowEventHandlersEventMap\r\n * Added: `\"gamepadconnected\"`, `\"gamepaddisconnected\"`\r\n* WindowEventHandlers\r\n * Added: `ongamepadconnected`, `ongamepaddisconnected`\r\n* WindowOrWorkerGlobalScope\r\n * Added: `crossOriginIsolated`\r\n* Console\r\n * Removed: `memory`, `exception`\r\n* HTMLElementTagNameMap\r\n * Removed: `\"applet\"`\r\n* SVGElementTagNameMap\r\n * Added: `\"animate\"`, `\"animateMotion\"`, `\"animateTransform\"`, `\"feDropShadow\"`, `\"mpath\"`, `\"set\"`\r\n\r\n## `index.iterable.d.ts`\r\n\r\n### Non-value types\r\n\r\n* Navigator\r\n * Added: `vibrate`","issue_id":1661112978035,"origin_id":869224737,"user_origin_id":49038,"create_time":1624828500,"update_time":1630151871,"id":1666898437725,"updated_at":"2022-10-27T19:20:37.725000Z","created_at":"2022-10-27T19:20:37.725000Z"},{"_id":"635ada058041c95dfb172085","body":"The following four types also seems to be removed, but are not mentioned in the above list : \r\n\r\n* AudioParamDescriptor\r\n* RTCInboundRTPStreamStats\r\n* RTCMediaStreamTrackStats\r\n* RTCStatsCallback","issue_id":1661112978035,"origin_id":881509595,"user_origin_id":13726714,"create_time":1626447256,"update_time":1626447313,"id":1666898437729,"updated_at":"2022-10-27T19:20:37.729000Z","created_at":"2022-10-27T19:20:37.729000Z"},{"_id":"635ada058041c95dfb172086","body":"`@types\/[email protected]` should be the version which is shipped with TS 4.4rc","issue_id":1661112978035,"origin_id":896763262,"user_origin_id":49038,"create_time":1628682959,"update_time":1628682959,"id":1666898437732,"updated_at":"2022-10-27T19:20:37.732000Z","created_at":"2022-10-27T19:20:37.732000Z"},{"_id":"635ada058041c95dfb172087","body":"Found undocumented breaking change: `PermissionName` has less union members than 4.3 which cause the following code type error.\r\n\r\n```ts\r\nnavigator.permissions.query({ name: 'camera' })\r\n```\r\n\r\nSee: https:\/\/w3c.github.io\/permissions\/#enumdef-permissionname","issue_id":1661112978035,"origin_id":898868275,"user_origin_id":5390719,"create_time":1628931722,"update_time":1628931722,"id":1666898437736,"updated_at":"2022-10-27T19:20:37.735000Z","created_at":"2022-10-27T19:20:37.735000Z"},{"_id":"635ada058041c95dfb172088","body":"Breaking change documented wrong:\r\n\r\n`CryptoKeyPair` didn't get removed.\r\n\r\n```ts\r\n\/\/ 4.3\r\ninterface CryptoKeyPair {\r\n privateKey: CryptoKey;\r\n publicKey: CryptoKey;\r\n}\r\n\/\/ 4.4\r\ninterface CryptoKeyPair {\r\n privateKey?: CryptoKey;\r\n publicKey?: CryptoKey;\r\n}\r\n```","issue_id":1661112978035,"origin_id":898868533,"user_origin_id":5390719,"create_time":1628931871,"update_time":1628931871,"id":1666898437739,"updated_at":"2022-10-27T19:20:37.738000Z","created_at":"2022-10-27T19:20:37.738000Z"},{"_id":"635ada058041c95dfb172089","body":"`ClipboardItem` constructor type is wrong. According to MDN, it should be `string | Blob | Promise<string | Blob>`.\r\n\r\nIn 4.3 it is `string | Blob`, in 4.4 it is `Promise<string | Blob>` which is wrong.","issue_id":1661112978035,"origin_id":898868750,"user_origin_id":5390719,"create_time":1628932007,"update_time":1628932007,"id":1666898437741,"updated_at":"2022-10-27T19:20:37.741000Z","created_at":"2022-10-27T19:20:37.741000Z"},{"_id":"635ada058041c95dfb17208a","body":"> Found undocumented breaking change: `PermissionName` has less union members than 4.3 which cause the following code type error.\r\n> \r\n> ```ts\r\n> navigator.permissions.query({ name: 'camera' })\r\n> ```\r\n> \r\n> See: https:\/\/w3c.github.io\/permissions\/#enumdef-permissionname\r\n\r\nCamera permission is [at risk](https:\/\/w3c.github.io\/permissions\/#media-devices) because of lack of multiple implementation, so I guess the work item is to document the removal.\r\n\r\n> `ClipboardItem` constructor type is wrong. According to MDN, it should be `string | Blob | Promise<string | Blob>`.\r\n> \r\n> In 4.3 it is `string | Blob`, in 4.4 it is `Promise<string | Blob>` which is wrong.\r\n\r\n#1102","issue_id":1661112978035,"origin_id":898954358,"user_origin_id":3396686,"create_time":1628972139,"update_time":1628972164,"id":1666898437745,"updated_at":"2022-10-27T19:20:37.744000Z","created_at":"2022-10-27T19:20:37.744000Z"},{"_id":"635ada058041c95dfb17208b","body":"I want to add (deprecated: ref #884) `mouseWheelEvent` to the list of removed types","issue_id":1661112978035,"origin_id":907141728,"user_origin_id":2410353,"create_time":1630064722,"update_time":1630064722,"id":1666898437748,"updated_at":"2022-10-27T19:20:37.748000Z","created_at":"2022-10-27T19:20:37.748000Z"},{"_id":"635ada058041c95dfb17208c","body":"Undocumented change `msSaveBlob` was removed from `window.navigator` in TypeScript 4.4.2.","issue_id":1661112978035,"origin_id":907219854,"user_origin_id":857700,"create_time":1630072362,"update_time":1630072371,"id":1666898437752,"updated_at":"2022-10-27T19:20:37.751000Z","created_at":"2022-10-27T19:20:37.751000Z"},{"_id":"635ada058041c95dfb17208d","body":"I tried upgrading from TS 4.3.5 to 4.4.2 today and encountered two issues:\r\n\r\n1. `HTMLDialogElement` went missing (as a value, not as a type). This is noted in the list above. But why? It's [supported](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLDialogElement#browser_compatibility) by Chrome, Edge, and Opera, and by Firefox behind a flag. The type is still present, as it is needed to represent `<dialog>` elements. I can write `declare var HTMLDialogElement: HTMLDialogElement;` to allow using it as a value, but then `element instanceof HTMLDialogElement` no longer works as a type guard.\r\n2. `HTMLInputElement.autofocus` was removed. This is _not_ noted in the list above. This seems like a bug since it is supported in every browser. The [MDN page](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLSelectElement\/autofocus)'s browser compatibility section just refers to the page for the [global autofocus attribute](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Global_attributes\/autofocus) where it is noted as fully supported in Chrome, Edge, and Opera, and supported everywhere on several elements including HTMLInputElement. In my case, I have a custom JSX implementation, and I basically have to patch the `HTMLInputElement` type to work around this.\r\n\r\nIt would be great if these changes could be reverted.","issue_id":1661112978035,"origin_id":907490128,"user_origin_id":203177,"create_time":1630100295,"update_time":1630100295,"id":1666898437756,"updated_at":"2022-10-27T19:20:37.755000Z","created_at":"2022-10-27T19:20:37.755000Z"},{"_id":"635ada058041c95dfb17208e","body":">1. `HTMLDialogElement` went missing (as a value, not as a type). This is noted in the list above. But why? It's [supported](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLDialogElement#browser_compatibility) by Chrome, Edge, and Opera, and by Firefox behind a flag. The type is still present, as it is needed to represent `<dialog>` elements. I can write `declare var HTMLDialogElement: HTMLDialogElement;` to allow using it as a value, but then `element instanceof HTMLDialogElement` no longer works as a type guard.\r\n\r\nChrome\/Edge\/Opera all uses the same engine Blink and no other engine supports it without a flag, that is why. Please refer to https:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator#when-the-type-is-missing for the reasoning here.\r\n\r\n>2. `HTMLInputElement.autofocus` was removed. This is _not_ noted in the list above. This seems like a bug since it is supported in every browser. The [MDN page](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLSelectElement\/autofocus)'s browser compatibility section just refers to the page for the [global autofocus attribute](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Global_attributes\/autofocus) where it is noted as fully supported in Chrome, Edge, and Opera, and supported everywhere on several elements including HTMLInputElement. In my case, I have a custom JSX implementation, and I basically have to patch the `HTMLInputElement` type to work around this.\r\n\r\nFixed by #1111","issue_id":1661112978035,"origin_id":907499726,"user_origin_id":3396686,"create_time":1630101909,"update_time":1630101937,"id":1666898437758,"updated_at":"2022-10-27T19:20:37.758000Z","created_at":"2022-10-27T19:20:37.758000Z"},{"_id":"635ada058041c95dfb17208f","body":"Thanks, I read that section of the README but it's not clear about flagged features, plus `<dialog>` is enabled by default in Firefox Nightly.","issue_id":1661112978035,"origin_id":907547231,"user_origin_id":203177,"create_time":1630114941,"update_time":1630114941,"id":1666898437761,"updated_at":"2022-10-27T19:20:37.761000Z","created_at":"2022-10-27T19:20:37.761000Z"},{"_id":"635ada058041c95dfb172090","body":"Why was `hashchange` event removed? Now there is only `Event` which doesn't have `newURL` property:\r\nhttps:\/\/www.typescriptlang.org\/play?ts=4.4.2#code\/O4SwdgJg9sB0CGEIFEBuBTMAXAMiAzlpugE4AUA5ABbz5UDGNYA5uhQDQAEZ6AXJwAlaVAMJNWaTFgCUnALwA+TgG90sMOmABVAEo4AvtKA","issue_id":1661112978035,"origin_id":908264150,"user_origin_id":6358971,"create_time":1630322819,"update_time":1630322819,"id":1666898437765,"updated_at":"2022-10-27T19:20:37.764000Z","created_at":"2022-10-27T19:20:37.764000Z"},{"_id":"635ada058041c95dfb172091","body":"> Why was `hashchange` event removed? Now there is only `Event` which doesn't have `newURL` property:\r\n> https:\/\/www.typescriptlang.org\/play?ts=4.4.2#code\/O4SwdgJg9sB0CGEIFEBuBTMAXAMiAzlpugE4AUA5ABbz5UDGNYA5uhQDQAEZ6AXJwAlaVAMJNWaTFgCUnALwA+TgG90sMOmABVAEo4AvtKA\r\n\r\nFixed by #1104","issue_id":1661112978035,"origin_id":908264907,"user_origin_id":3396686,"create_time":1630322900,"update_time":1630322900,"id":1666898437767,"updated_at":"2022-10-27T19:20:37.767000Z","created_at":"2022-10-27T19:20:37.767000Z"},{"_id":"635ada058041c95dfb172092","body":"`Location#reload(forcedReload: boolean): void` was removed as well.\r\nWas that intended?","issue_id":1661112978035,"origin_id":908309384,"user_origin_id":10351787,"create_time":1630327295,"update_time":1630327295,"id":1666898437772,"updated_at":"2022-10-27T19:20:37.771000Z","created_at":"2022-10-27T19:20:37.771000Z"},{"_id":"635ada058041c95dfb172093","body":"> `Location#reload(forcedReload: boolean): void` was removed as well.\r\n> Was that intended?\r\n\r\nIt's currently a Firefox specific extension, so yes, that was intended.","issue_id":1661112978035,"origin_id":908311409,"user_origin_id":3396686,"create_time":1630327479,"update_time":1630327479,"id":1666898437775,"updated_at":"2022-10-27T19:20:37.774000Z","created_at":"2022-10-27T19:20:37.774000Z"},{"_id":"635ada058041c95dfb172094","body":"Hello,\r\nspeech recognition apis have been removed but i don't find informations about deprecation of this technology.\r\n\r\nis there a remplacement api ?\r\n","issue_id":1661112978035,"origin_id":908452319,"user_origin_id":16596256,"create_time":1630338279,"update_time":1630338279,"id":1666898437778,"updated_at":"2022-10-27T19:20:37.777000Z","created_at":"2022-10-27T19:20:37.777000Z"},{"_id":"635ada058041c95dfb172095","body":"> Hello,\r\n> speech recognition apis have been removed but i don't find informations about deprecation of this technology.\r\n> \r\n> is there a remplacement api ?\r\n\r\nIt's not deprecated, it's just not mature enough with no prefix-less implementation and being still in [WICG](https:\/\/github.com\/WICG\/speech-api) (where immature specifications exist).","issue_id":1661112978035,"origin_id":908454034,"user_origin_id":3396686,"create_time":1630338416,"update_time":1630338454,"id":1666898437781,"updated_at":"2022-10-27T19:20:37.780000Z","created_at":"2022-10-27T19:20:37.780000Z"},{"_id":"635ada058041c95dfb172096","body":"Just a query, maybe my bad understanding, but File.webkitRelativePath is not a standard property and, according to MDN, should NOT be used on production sites. Can this be made optional or removed (or is my understanding here wrong)? https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/File\/webkitRelativePath","issue_id":1661112978035,"origin_id":909906086,"user_origin_id":290460,"create_time":1630474383,"update_time":1630474397,"id":1666898437785,"updated_at":"2022-10-27T19:20:37.784000Z","created_at":"2022-10-27T19:20:37.784000Z"},{"_id":"635ada058041c95dfb172097","body":"I believe ClipboardItem constructor should be restricted to only accept `Blob`. Blink has only partial support for ClipboardItem - as per MDN:\r\n\r\n> The ClipboardItem constructor only accepts a blob as the item data, but not strings or Promises that resolve to strings or blobs. See bug 1014310.\r\n","issue_id":1661112978035,"origin_id":912503766,"user_origin_id":68713,"create_time":1630672444,"update_time":1630672482,"id":1666898437789,"updated_at":"2022-10-27T19:20:37.789000Z","created_at":"2022-10-27T19:20:37.789000Z"},{"_id":"635ada058041c95dfb172098","body":"> \r\n> \r\n> I believe ClipboardItem constructor should be restricted to only accept `Blob`. Blink has only partial support for ClipboardItem - as per MDN:\r\n> \r\n> > The ClipboardItem constructor only accepts a blob as the item data, but not strings or Promises that resolve to strings or blobs. See bug 1014310.\r\n\r\nMakes sense, do you want to write a patch?","issue_id":1661112978035,"origin_id":912975670,"user_origin_id":3396686,"create_time":1630762605,"update_time":1630762605,"id":1666898437793,"updated_at":"2022-10-27T19:20:37.793000Z","created_at":"2022-10-27T19:20:37.793000Z"},{"_id":"635ada058041c95dfb172099","body":"sorry for the noob question: how is it decided which interfaces get added or removed? at what point do [changes](https:\/\/github.com\/microsoft\/TypeScript\/commit\/9d443b76aac0832d7f3c890441264d39307fe31a) usually end up in microsoft\/TypeScript?\r\n\r\nthe new TS features are great, but sadly all the dom type changes are a bit of a disincentive to upgrade for me at the moment. for example, some code that I work on uses `RTCSctpTransport` which [is still in the spec](https:\/\/w3c.github.io\/webrtc-pc\/#rtcsctptransport-interface), has no \"feature at risk\" annotation, and still works in chrome :\/\r\n\r\nnonetheless thanks for all the great work.","issue_id":1661112978035,"origin_id":913288121,"user_origin_id":882995,"create_time":1630894455,"update_time":1630894455,"id":1666898437798,"updated_at":"2022-10-27T19:20:37.797000Z","created_at":"2022-10-27T19:20:37.797000Z"},{"_id":"635ada058041c95dfb17209a","body":"Mostly based on MDN browser compatibility data. For example, `RTCSctpTransport` is marked as Chrome(ium)-only on MDN: https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/RTCSctpTransport#browser_compatibility","issue_id":1661112978035,"origin_id":913292447,"user_origin_id":3396686,"create_time":1630895309,"update_time":1630895309,"id":1666898437801,"updated_at":"2022-10-27T19:20:37.800000Z","created_at":"2022-10-27T19:20:37.800000Z"},{"_id":"635ada058041c95dfb17209b","body":"FYI at Chrome DevTools we have started our attempts to upgrade to TypeScript 4.4.2, but sadly this issue is one the major timesinks for this release. Initial big hitters are:\r\n\r\n- `getSelection` removed from `ShadowRoot`\r\n- `getElementFromPoint` removed from `ShadowRoot`\r\n- Removed `DOMError`\r\n- `unknown` in catch (but we were able to turn off the config setting for this \ud83d\udc4d )\r\n\r\nUnfortunately, adding `@types\/web` isn't as straightforward for us and also does not appear to resolve the situation for us where we rely on Chromium-only API's. That said, Chrome DevTools is probably in a special situation where we run on a single engine, so sometimes we use modern API's that are not supported on other engines just yet.\r\n\r\nIt seems like our Google internal team ran into similar issues before: https:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator\/issues\/1067 But since we use a different stack and upgrade TypeScript at our own pace, we ran into this later than them.","issue_id":1661112978035,"origin_id":915177439,"user_origin_id":5948271,"create_time":1631102914,"update_time":1631102914,"id":1666898437804,"updated_at":"2022-10-27T19:20:37.804000Z","created_at":"2022-10-27T19:20:37.804000Z"},{"_id":"635ada058041c95dfb17209d","body":"I think the correct approach would be to add `@deprecated` with an explanation to the functions or properties that will be removed in the next major release. With this approach, developers will be able to see that object.~~deprecated~~ is going to be removed and can raise their concerns before the removal happens.\r\n\r\nWith the current approach, you need won't realize that a change is coming if you are not actively using the beta or RC version of TypeScript, because in 4.3 the function exists and in 4.4 the function is gone.","issue_id":1661112978035,"origin_id":915254622,"user_origin_id":36661752,"create_time":1631108832,"update_time":1631108832,"id":1666898437809,"updated_at":"2022-10-27T19:20:37.808000Z","created_at":"2022-10-27T19:20:37.808000Z"},{"_id":"635ada058041c95dfb17209e","body":"4.4 was a special release that trimmed a lot of nonstandard things, I think any future releases will follow W3C\/WHATWG deprecation step.","issue_id":1661112978035,"origin_id":915291973,"user_origin_id":3396686,"create_time":1631111510,"update_time":1631111510,"id":1666898437811,"updated_at":"2022-10-27T19:20:37.811000Z","created_at":"2022-10-27T19:20:37.811000Z"},{"_id":"635ada058041c95dfb17209f","body":"The removal of autoGainControl and noiseSuppression caused a build break. This is supported in most browsers and outlined in W3C Capture Streams - https:\/\/www.w3.org\/TR\/mediacapture-streams\/#dom-mediatracksupportedconstraints-autogaincontrol\r\nCan you provide any insight into why it was removed?","issue_id":1661112978035,"origin_id":919543781,"user_origin_id":1418465,"create_time":1631656919,"update_time":1631656919,"id":1666898437817,"updated_at":"2022-10-27T19:20:37.817000Z","created_at":"2022-10-27T19:20:37.817000Z"},{"_id":"635ada058041c95dfb1720a1","body":"The removal of the `userVisibleOnly` property from the `PushSubscriptionOptions` interface caused issues in a project where WebPush is being used. Chrome & Edge still require `userVisibleOnly` to be set when calling `PushManager.subscribe()` or the call will fail. `userVisibleOnly` is also still documented in the latest W3C Push API Draft: [https:\/\/www.w3.org\/TR\/push-api\/#pushsubscriptionoptions-interface](https:\/\/www.w3.org\/TR\/push-api\/#pushsubscriptionoptions-interface). Is there a reason why this property was removed?","issue_id":1661112978035,"origin_id":921271636,"user_origin_id":46695059,"create_time":1631828092,"update_time":1631828170,"id":1666898437822,"updated_at":"2022-10-27T19:20:37.821000Z","created_at":"2022-10-27T19:20:37.821000Z"},{"_id":"635ada058041c95dfb1720a2","body":"> The removal of autoGainControl and noiseSuppression caused a build break. This is supported in most browsers and outlined in W3C Capture Streams - https:\/\/www.w3.org\/TR\/mediacapture-streams\/#dom-mediatracksupportedconstraints-autogaincontrol\r\n> Can you provide any insight into why it was removed?\r\n\r\nSeems they are supported on Firefox and Chrome. PR welcome.\r\n\r\n> `userVisibleOnly` is also still documented in the latest W3C Push API Draft: https:\/\/www.w3.org\/TR\/push-api\/#pushsubscriptionoptions-interface. Is there a reason why this property was removed?\r\n\r\nYes: https:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator#why-is-my-fancy-api-still-not-available-here\r\n\r\nSee [MDN](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/PushSubscriptionOptions\/userVisibleOnly#browser_compatibility) for the data. Note that `PushSubscrptionOptionsInit` still has `userVisibleOnly` so the option still can be set. (Logically it shouldn't exist either but there is no good way to autodetect dictionary member support.)","issue_id":1661112978035,"origin_id":921285470,"user_origin_id":3396686,"create_time":1631829796,"update_time":1631829796,"id":1666898437825,"updated_at":"2022-10-27T19:20:37.824000Z","created_at":"2022-10-27T19:20:37.824000Z"},{"_id":"635ada058041c95dfb1720a3","body":"Why did you remove OffscreenCanvas? It is available in Edge, Chrome and Opera. ","issue_id":1661112978035,"origin_id":921629871,"user_origin_id":767334,"create_time":1631869151,"update_time":1631869151,"id":1666898437828,"updated_at":"2022-10-27T19:20:37.828000Z","created_at":"2022-10-27T19:20:37.828000Z"}] comment

### Beta With TypeScript 4.4, we coordinated some pretty [fundamental infrastructure work](https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1023) to prepare for the version of `dom.d.ts` with the future of the generator repo. This work resulted in...

Type "clipboard-write" is not assignable to type "PermissionName"

[{"_id":"635adcbc8041c95dfb17231f","body":"Clipboard permissions are at risk:\r\n\r\n1. clipboard-read is officially removed from the spec: https:\/\/github.com\/w3c\/clipboard-apis\/pull\/132\r\n2. clipboard-write has no multiple implementer interest and thus will probably be removed too: https:\/\/github.com\/w3c\/clipboard-apis\/issues\/163\r\n\r\nAnd thus I think this won't be solved, at least not anytime soon.","issue_id":1661112978040,"origin_id":1013954285,"user_origin_id":3396686,"create_time":1642367905,"update_time":1642369543,"id":1666899132110,"updated_at":"2022-10-27T19:32:12.110000Z","created_at":"2022-10-27T19:32:12.110000Z"},{"_id":"635adcbc8041c95dfb172320","body":"Hi!\r\nSo \"officially\" has been removed both `clipboard-write` and `clipboard-read` but in [MDN Permissions API](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Permissions_API) documentation they are already there? (even [compatibility](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Permissions_API#browser_compatibility) is not the best)\r\n\r\nAlso, I guess I can use `navigator.clipboard.writeText()` without requesting the user the permission?\r\n\r\nThank you.\r\n\r\nEDIT:\r\nSorry, `clipboard-write` is not officially removed but is not detected as a `Permission Name` when using Typescript...","issue_id":1661112978040,"origin_id":1140839713,"user_origin_id":59806216,"create_time":1653898190,"update_time":1653898340,"id":1666899132116,"updated_at":"2022-10-27T19:32:12.116000Z","created_at":"2022-10-27T19:32:12.116000Z"},{"_id":"662e4e8d23eede2dcf09d6ce","body":"**Still relevant**. Any updates?\r\nWay to solve this problem:\r\n```javascript\r\nnavigator.permissions.query({ name: \"clipboard-write\" as PermissionName }).then(result => {});\r\n```","issue_id":1661112978040,"origin_id":1522189307,"user_origin_id":40333036,"create_time":1682445343,"update_time":1682445853,"id":1714310797446,"updated_at":"2024-04-28T13:26:37.445000Z","created_at":"2024-04-28T13:26:37.445000Z"},{"_id":"662e4e8d23eede2dcf09d6cf","body":"`clipboard-write` is still a Blink-only thing as of today.","issue_id":1661112978040,"origin_id":1522204068,"user_origin_id":3396686,"create_time":1682446050,"update_time":1682446050,"id":1714310797449,"updated_at":"2024-04-28T13:26:37.449000Z","created_at":"2024-04-28T13:26:37.449000Z"},{"_id":"662e4e8d23eede2dcf09d6d0","body":"@saschanaz. Oh, I got it. An open issue misled me, I thought it was an error ...\r\nThanks\r\n","issue_id":1661112978040,"origin_id":1522225074,"user_origin_id":40333036,"create_time":1682447158,"update_time":1682447158,"id":1714310797452,"updated_at":"2024-04-28T13:26:37.452000Z","created_at":"2024-04-28T13:26:37.452000Z"}] comment

## Description When using the [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API), one might need to request permission for the [`clipboard-write`](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API) in case we want to add something to the user's system clipboard if the...

CustomElementConstructor is missing observedAttributes

[{"_id":"635ae3863056137e265f6199","body":"To clarify: the `observedAttributes` property is optional, so my proposed change is:\r\n\r\n```diff\r\n interface CustomElementConstructor {\r\n new (...params: any[]): HTMLElement;\r\n+ observedAttributes?: string[];\r\n }\r\n```","issue_id":1661112978044,"origin_id":1138886565,"user_origin_id":283842,"create_time":1653589758,"update_time":1653589758,"id":1666900870620,"updated_at":"2022-10-27T20:01:10.619000Z","created_at":"2022-10-27T20:01:10.619000Z"},{"_id":"667f7a1d63673df7300e597d","body":"It's missing all the lifecycle callbacks too. It makes it tricky to derive custom element constructors without some workarounds.\r\n\r\n```typescript\r\nfunction derive(ctor: CustomElementConstructor) {\r\n static get observedAttributes() {\r\n return [...super.observedAttributes || [], \"my-extra-attr\"]; \/\/ error, as above\r\n }\r\n\r\n attributeChangedCallback(...params: any[]) {\r\n super.attributeChangedCallback?.(...params); \/\/ Property 'attributeChangedCallback' does not exist on type 'HTMLElement'.\r\n }\r\n}\r\n```\r\n\r\nThis isn't as straightforward to fix as adding those properties to the interface, since the constructor is defined as returning a `HTMLElement` instance (which is obviously incorrect). I suspect this will become more of an issue as decorators become more widely used on custom element classes.\r\n\r\nThe interface should probably look something more like this:\r\n\r\n```\r\ninterface CustomElementConstructor extends HTMLElement {\r\n new (...params: any[]): CustomElementConstructor;\r\n observedAttributes?: any;\r\n adoptedCallback?(...params: any[]): any;\r\n attributeChangedCallback?(...params: any[]): any;\r\n connectedCallback?(...params: any[]): any;\r\n disconnectedCallback?(...params: any[]): any;\r\n}\r\n```\r\n\r\nNB: I've used `any` types here because, technically, you can register classes with different signatures and return values as custom elements. If narrow types were used, e.g. `string[]` for `observedAttributes`, it would restrict what you could pass to `customElements.define()`","issue_id":1661112978044,"origin_id":1563378752,"user_origin_id":1826067,"create_time":1685041487,"update_time":1685041487,"id":1719630365367,"updated_at":"2024-06-29T03:06:05.367000Z","created_at":"2024-06-29T03:06:05.367000Z"}] comment

The `CustomElementConstructor` interface defined in `lib.dom.d.ts` seems to be missing the [`observedAttributes` static property](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks) (supported in all modern browser engines). Steps to reproduce ([playground](https://www.typescriptlang.org/play?#code/MYGwhgzhAECyCeBREBTAtigdgF2igHtlgCYwASAKrADLLpa4DeAUNG9BNmNgJbDQB7AEYQUAJwBuKYgEFs2MTyEBXIjAC80ANoByAGYCBOgLrMAvs2Z7lmYLwGZoxFHp6YUACi4BzAHJgMAC4OBTdvABpoOwExYIBhZU4BNDoMHDiHTjFlaLEASmgWdijE7GTUhggAOmdXdy8wPwCUSNy81nZgTIFUKpABbw9cquFRSWk5UJU1dotmWrdPHTR4AFoUVDTsHUiECpw8oA)): ```js class MyElement extends HTMLElement {...

Improve XMLHttpRequest status usage inside onload event

[{"_id":"635ae030cecf4e081a21a6c3","body":"Just an explanation:\r\nWithout [strictFunctionTypes](https:\/\/www.typescriptlang.org\/tsconfig#strictFunctionTypes) in your tsconfig your code works out of the box.\r\n\r\nhttps:\/\/www.typescriptlang.org\/play?strictFunctionTypes=false&jsx=0&module=0#code\/MYewdgzgLgBAHgCwE4wLwzAUwO4wBoCyAMgBJRQAOASpgI4Cum0AFAJQDcAUIkgHQCGAE0EBRAG6YwUIgEtokzEmYByADYghygDQwAZvTDAoM8DGaYJUgFwwACkhABzJEwjjJUADyFS5anUZoAD5WGABvThgomFBIWCh+JEdMWHQLD14EpJSuaJjwCBBVTF5BGSUs5KheaH4oeggOSOjYwuLS8uZKlN4XCAoCzCaAX1ZObmRecHUhND0DIxMwM3TrOwdnV3cpb2IyShoGJigQ8Oao1vjEqrnV6u6oXJaCopKyiuue2vrGp4uX9rvLqfap9AaQIZcYZAA\r\n\r\nThe error is:\r\n```\r\nType '(this: XMLHttpRequest, event: ProgressEvent<XMLHttpRequest>) => void' is not assignable to type '(this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any'.\r\n Types of parameters 'event' and 'ev' are incompatible.\r\n Type 'ProgressEvent<EventTarget>' is not assignable to type 'ProgressEvent<XMLHttpRequest>'.\r\n Type 'EventTarget' is missing the following properties from type 'XMLHttpRequest': onreadystatechange, readyState, response, responseText, and 27 more.\r\n","issue_id":1661112978051,"origin_id":1089871158,"user_origin_id":2410353,"create_time":1649226483,"update_time":1649226483,"id":1666900016833,"updated_at":"2022-10-27T19:46:56.833000Z","created_at":"2022-10-27T19:46:56.833000Z"}] comment

Hi I am trying to use the `status` property inside the `onload` event of the XMLHttpRequest object but it is throwing a type error on it. There are different approaches...

Add support for generics in the URLSearchParams interface

[{"_id":"635ae21ed297b6213235fb88","body":"@MartinJohns why do you disagree with this proposal?","issue_id":1661112978055,"origin_id":967003964,"user_origin_id":12529395,"create_time":1636714027,"update_time":1636714027,"id":1666900510078,"updated_at":"2022-10-27T19:55:10.078000Z","created_at":"2022-10-27T19:55:10.078000Z"},{"_id":"635ae21ed297b6213235fb89","body":"Same reason I'm against making `JSON.parse` generic. It doesn't add type-safety, but instead obfuscates and hides potential issues. Especially users not familiar with TypeScript could easily assume that using the generic type means no other parameters could be present, when this is not the case.","issue_id":1661112978055,"origin_id":967026167,"user_origin_id":5269069,"create_time":1636716150,"update_time":1636716150,"id":1666900510082,"updated_at":"2022-10-27T19:55:10.082000Z","created_at":"2022-10-27T19:55:10.082000Z"},{"_id":"635ae21ed297b6213235fb8a","body":"@MartinJohns I see. Do you have a different solution in mind for adding type safety to these APIs?","issue_id":1661112978055,"origin_id":967037654,"user_origin_id":12529395,"create_time":1636717339,"update_time":1636717339,"id":1666900510085,"updated_at":"2022-10-27T19:55:10.085000Z","created_at":"2022-10-27T19:55:10.085000Z"},{"_id":"635ae21ed297b6213235fb8b","body":"It's reasonable in a given project to want to have a list of possible query string to document which keys are going to be used, and prevent typos or misuses. Currently, we have to create a little boilerplate on the side to achieve this. The proposal in this ticket would make seems simpler.\r\n\r\n`URLSearchParams` is a container of generic things. Generics is the right abstraction to use here.\r\n\r\nTo address @MartinJohns's concerns, I think this proposal addresses the issue by having the default by `string`, thus less expert users won't see a difference with today's behavior, while more advanced users have the *option* of more control over the possible keys to secure\/document things.","issue_id":1661112978055,"origin_id":1061361775,"user_origin_id":106195,"create_time":1646709139,"update_time":1646709139,"id":1666900510089,"updated_at":"2022-10-27T19:55:10.088000Z","created_at":"2022-10-27T19:55:10.088000Z"},{"_id":"667f79ee74fb49ab3a046142","body":"I'd find this very handy developing in Remix, where I could be accessing the URL search params either client side in my route component, or server side in my action and loader functions. Given I might reference the same search params in 3 different places within the same file, I want to define from the outset the params I intend to use. This helps by:\r\n- being explicit about what I'm expecting\r\n- making those expectations more visible\r\n- preventing typos, copy-paste errors, etc\r\n\r\n@lwouis do you have some boilerplate you'd be happy to share as a workaround? I've got the following but I don't love the extent of the original interface I'm having to redefine.\r\n\r\n```ts\r\ntype TypedURLSearchParams<T extends string> = Omit<\r\n URLSearchParams,\r\n 'append' | 'delete' | 'forEach' | 'get' | 'getAll' | 'has' | 'set'\r\n> & {\r\n append(name: T, value: string): void;\r\n delete(name: T, value?: string): void;\r\n forEach(\r\n callbackfn: (\r\n value: string,\r\n key: T,\r\n parent: TypedURLSearchParams<T>,\r\n ) => void,\r\n thisArg?: any,\r\n ): void;\r\n get(name: T): string | null;\r\n getAll(name: T): string[];\r\n has(name: T, value?: string): boolean;\r\n set(name: T, value: string): void;\r\n};\r\n\r\nfunction getTypedURLSearchParams<T extends string>(urlString: string) {\r\n const url = new URL(urlString);\r\n return url.searchParams as TypedURLSearchParams<T>;\r\n}\r\n\r\ntype validSearchParams = 'userId' | 'noteId';\r\n\r\nconst getURLSearchParams = getTypedURLSearchParams<validSearchParams>;\r\nconst urlSearchParams = getURLSearchParams(myURL);\r\nconst userId = urlSearchParams.get('userId'); \/\/ safe\r\nconst noteId = urlSearchParams.get('noteId'); \/\/ safe\r\nconst foo = urlSearchParams.get('foo'); \/\/ error\r\n```","issue_id":1661112978055,"origin_id":1816220296,"user_origin_id":127837742,"create_time":1700220972,"update_time":1700220972,"id":1719630318571,"updated_at":"2024-06-29T03:05:18.570000Z","created_at":"2024-06-29T03:05:18.570000Z"},{"_id":"667f79ee74fb49ab3a046143","body":"This might help someone for setting queryParams with types\r\n\r\n```tsx\r\n'use client';\r\n\r\nimport type { ReadonlyURLSearchParams } from 'next\/navigation';\r\nimport { usePathname, useRouter, useSearchParams } from 'next\/navigation';\r\n\r\ntype TypedURLSearchParams<T extends Record<string, unknown>> = Omit<\r\n ReadonlyURLSearchParams,\r\n 'append' | 'delete' | 'forEach' | 'get' | 'getAll' | 'has' | 'set'\r\n> & {\r\n append: <K extends keyof T>(name: K, value: T[K]) => void;\r\n delete: <K extends keyof T>(name: K, value?: T[K]) => void;\r\n forEach: (\r\n callbackfn: (value: string, key: keyof T, parent: TypedURLSearchParams<T>) => void,\r\n thisArg?: unknown\r\n ) => void;\r\n get: <K extends keyof T>(name: K) => T[K] | null;\r\n getAll: <K extends keyof T>(name: K) => T[K][];\r\n has: <K extends keyof T>(name: K, value?: T[K]) => boolean;\r\n set: <K extends keyof T>(name: K, value: T[K]) => void;\r\n};\r\n\r\nfunction useQueryParams<T>() {\r\n const router = useRouter();\r\n const pathname = usePathname();\r\n const searchParams = useSearchParams() as unknown as TypedURLSearchParams<Partial<T>>;\r\n\r\n const urlSearchParams = new URLSearchParams(searchParams.toString());\r\n\r\n function setQueryParams(params: Partial<T>) {\r\n Object.entries(params).forEach(([key, value]) => {\r\n if (value === undefined || value === null) {\r\n urlSearchParams.delete(key);\r\n } else {\r\n urlSearchParams.set(key, String(value));\r\n }\r\n });\r\n\r\n const search = urlSearchParams.toString();\r\n const query = search ? `?${search}` : '';\r\n \/\/ replace since we don't want to build a history\r\n router.replace(`${pathname}${query}`);\r\n }\r\n\r\n return { queryParams: searchParams, setQueryParams };\r\n}\r\n\r\nexport { useQueryParams };\r\n```\r\n\r\n```tsx\r\n const { queryParams, setQueryParams } = useQueryParams<{\r\n id: \"1\" | \"2\"\r\n }>();\r\n\r\n const value = queryParams.get('id'); \/\/ this will return type of \"1\" | \"2\"\r\n```","issue_id":1661112978055,"origin_id":1831480410,"user_origin_id":106700975,"create_time":1701248292,"update_time":1701249932,"id":1719630318577,"updated_at":"2024-06-29T03:05:18.576000Z","created_at":"2024-06-29T03:05:18.576000Z"}] comment

# Suggestion ## 🔍 Search Terms urlsearchparams ## ✅ Viability Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code * [x]...

Convert `performance.measure()` to overloads

[{"_id":"635adb66ea01ec786e7ce623","body":"Thanks for the PR!\n\nThis section of the codebase is owned by @saschanaz - if they write a comment saying \"LGTM\" then it will be merged.\n<!-- Message About Merging -->","issue_id":1661112978059,"origin_id":1056119154,"user_origin_id":41898282,"create_time":1646191361,"update_time":1646191361,"id":1666898790531,"updated_at":"2022-10-27T19:26:30.531000Z","created_at":"2022-10-27T19:26:30.531000Z"},{"_id":"635adb66ea01ec786e7ce624","body":"Sounds like the spec should be changed too \ud83e\udd14\r\n\r\nBut for TypeScript I think it prefers unions over overloads to pass union arguments. @orta, has there been any changes over union arguments?\r\n\r\n```ts\r\ndeclare function foo(arg: number): any;\r\ndeclare function foo(arg: string): any;\r\n\r\ndeclare let arg: number | string;\r\nfoo(arg); \/\/ This fails \ud83d\ude2c\r\n```","issue_id":1661112978059,"origin_id":1057139306,"user_origin_id":3396686,"create_time":1646239437,"update_time":1646239484,"id":1666898790534,"updated_at":"2022-10-27T19:26:30.534000Z","created_at":"2022-10-27T19:26:30.534000Z"},{"_id":"635adb66ea01ec786e7ce625","body":"In this case the two overloads has different argument length. `performance.measure('name', { start: 'start' }, 'end')` is allowed in current type definition but will result a runtime error.\r\n\r\nThe WebIDL spec reads: https:\/\/webidl.spec.whatwg.org\/#idl-overloading-vs-union\r\n\r\n> When the operation has significantly different semantics for different argument types or lengths, [overloading](https:\/\/webidl.spec.whatwg.org\/#dfn-overloaded) is preferred.\r\n\r\nIn this case maybe the difference is not \"significant\".\r\n\r\nBut the spec continues:\r\n\r\n> Even though the IDL is shorter in the second version _[when using optional arguments]_, two distinctively different concepts are conflated in the first argument _[`startOrMeasureOptions`]_. Without [overloads](https:\/\/webidl.spec.whatwg.org\/#dfn-overloaded), the question \"is _[startMark]_ or _[options]_ paired with _[endMark]?\"_ is much more difficult to answer without reading the [method steps](https:\/\/webidl.spec.whatwg.org\/#method-steps) of the operation. This makes the second version remarkably less readable than the first.\r\n\r\nIMO this case can fall in this situation.\r\n\r\nI will try to make a pr upstream, but please leave this pr open.\r\n\r\n**EDIT:** It's difficult to change the spec without actually affecting implementations, because it allows `performance.measure('name', {}, 'end')`\r\n\r\n![image](https:\/\/user-images.githubusercontent.com\/1330321\/156483913-42b7aeba-6333-4c20-b2c6-8a589b2cb6a3.png)\r\n\r\nIt only throws when second argument is a **non-empty** object and third argument is given, it's not how overload resolution works.","issue_id":1661112978059,"origin_id":1057590301,"user_origin_id":1330321,"create_time":1646273561,"update_time":1646274286,"id":1666898790538,"updated_at":"2022-10-27T19:26:30.537000Z","created_at":"2022-10-27T19:26:30.537000Z"},{"_id":"635adb66ea01ec786e7ce626","body":"I merged first two overloads like `createImageBitmap` does:\r\n\r\n```ts\r\n createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;\r\n createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;\r\n```\r\n\r\nAlthough `performance.measure('name')` now satisfies both overloads, it seems TypeScript doesn't complain.","issue_id":1661112978059,"origin_id":1057605668,"user_origin_id":1330321,"create_time":1646274816,"update_time":1646274816,"id":1666898790540,"updated_at":"2022-10-27T19:26:30.540000Z","created_at":"2022-10-27T19:26:30.540000Z"}] comment

Fixes #1239 Technically the third one includes the first one (when both arguments are omitted), but if the first one is removed I feel like it's hard to discover it....