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

Event type for readystatechange is not specific enough

[{"_id":"635ae065d297b6213235fa37","body":"This is a bit of a cherrypicking of all the unspecific typed events (even if you only look at `document`).\r\neven `document.onreadystatechange` is not changed... 8-\/\r\n\r\nref #899 and https:\/\/github.com\/Microsoft\/TypeScript\/issues\/299","issue_id":1661112978211,"origin_id":754768730,"user_origin_id":2410353,"create_time":1609866494,"update_time":1609866494,"id":1666900069322,"updated_at":"2022-10-27T19:47:49.321000Z","created_at":"2022-10-27T19:47:49.321000Z"},{"_id":"635ae065d297b6213235fa38","body":"@HolgerJeromin Thank you for these pointers!\r\n\r\nI actually would be in favor of turning the `Event`type into something like `Event<T extends EventTarget = EventTarget>`.\r\nThat shouldn't really break existing code except altering some error messages.\r\n\r\nBut this would be a larger change, so without someone from the TypeScript team chiming in and telling us they are looking for something like that, I'm somewhat hesitant to implement it. At least as part of this pr.","issue_id":1661112978211,"origin_id":754773721,"user_origin_id":13420273,"create_time":1609866987,"update_time":1609866987,"id":1666900069327,"updated_at":"2022-10-27T19:47:49.326000Z","created_at":"2022-10-27T19:47:49.326000Z"},{"_id":"635ae065d297b6213235fa39","body":"Looking at all the past issues with trying to make these types more explicit, we're very wary of changes here which adds generics to types which are re-used all of the place. I know it's not a perfect representation of the underlaying DOM as it is, but we're making perf vs memory vs accuracy trade-offs and I think we'll probably not take this.","issue_id":1661112978211,"origin_id":784344870,"user_origin_id":49038,"create_time":1614099091,"update_time":1614099091,"id":1666900069330,"updated_at":"2022-10-27T19:47:49.330000Z","created_at":"2022-10-27T19:47:49.330000Z"},{"_id":"635ae065d297b6213235fa3a","body":"@orta makes sense :) should we then close the original issue, so that we don't spend more time on this in the future?","issue_id":1661112978211,"origin_id":784357305,"user_origin_id":13420273,"create_time":1614100145,"update_time":1614100145,"id":1666900069333,"updated_at":"2022-10-27T19:47:49.333000Z","created_at":"2022-10-27T19:47:49.333000Z"}] comment

Fixes https://github.com/microsoft/TypeScript/issues/41775 I was a little bit unsure whether its best to use `ProgressEvent` vs making `Event` generic (`Event`) and then using `Event`.

Probably won't take

adding new ServiceWorkerEvent interface to allow new event target

[{"_id":"635ad8f1ea01ec786e7ce45d","body":"[![CLA assistant check](https:\/\/cla.opensource.microsoft.com\/pull\/badge\/signed)](https:\/\/cla.opensource.microsoft.com\/microsoft\/TypeScript-DOM-lib-generator?pullRequest=923) <br\/>All CLA requirements met.","issue_id":1661112978215,"origin_id":702430625,"user_origin_id":10137,"create_time":1601591354,"update_time":1601591659,"id":1666898161891,"updated_at":"2024-06-29T03:07:30.386000Z","created_at":"2022-10-27T19:16:01.891000Z"},{"_id":"635ad8f1ea01ec786e7ce45e","body":"Sorry I missed this earlier. Can you please run `npm test` followed by `npm run baseline-accept` and then check in the updated files? That's why the CI tests failed.","issue_id":1661112978215,"origin_id":708007597,"user_origin_id":293473,"create_time":1602622991,"update_time":1602622991,"id":1666898161980,"updated_at":"2022-10-27T19:16:01.979000Z","created_at":"2022-10-27T19:16:01.979000Z"}] comment

Addresses Issue microsoft/typescript#40153. - created new interface ServiceWorkerEvent - trying to edit ServiceWorkerEventMap's statechange property type.

fix: add FormData to URLSearchParams constructor

[{"_id":"635ad6233056137e265f574d","body":"`FormData` can look like `Record<string, string | File>` ([spec](https:\/\/xhr.spec.whatwg.org\/#interface-formdata)), not just `Record<string, string>`, so adding this is not valid in general.","issue_id":1661112978218,"origin_id":688754092,"user_origin_id":402777,"create_time":1599558398,"update_time":1599558398,"id":1666897443130,"updated_at":"2022-10-27T19:04:03.129000Z","created_at":"2022-10-27T19:04:03.129000Z"},{"_id":"635ad6233056137e265f574f","body":"@sandersn In your example the form doesn't have any form field values to map to the URLSearchParams.\r\nSee the following example:\r\n\r\n```js\r\nconst form = document.createElement('FORM');\r\nconst field = document.createElement('input');\r\nfield.name = 'fieldName';\r\nfield.value = 'fieldValue';\r\n\r\nform.appendChild(field);\r\n\r\nconst formData = new FormData(form);\r\nconst urlSearchParams = new URLSearchParams(formData);\r\nurlSearchParams.toString(); \/\/ \"fieldName=fieldValue\"\r\n```","issue_id":1661112978218,"origin_id":693933505,"user_origin_id":3948966,"create_time":1600322301,"update_time":1600322301,"id":1666897443135,"updated_at":"2022-10-27T19:04:03.134000Z","created_at":"2022-10-27T19:04:03.134000Z"},{"_id":"635ad6233056137e265f5750","body":"Shorter:\r\n\r\n```js\r\nconst f = new FormData();\r\nf.append('foo', 'bar');\r\nnew URLSearchParams(f).toString(); \/\/ foo=bar\r\n```\r\n\r\nIn the case of blobs it does still work, but in broken way:\r\n\r\n```js\r\nconst f = new FormData();\r\nf.append('foo', new Blob(['bar']));\r\nnew URLSearchParams(f).toString(); \/\/ foo=%5Bobject+File%5D\r\n```","issue_id":1661112978218,"origin_id":699558794,"user_origin_id":3396686,"create_time":1601161340,"update_time":1601161340,"id":1666897443139,"updated_at":"2022-10-27T19:04:03.138000Z","created_at":"2022-10-27T19:04:03.138000Z"},{"_id":"635ad6233056137e265f5751","body":"it would be great to get this in, as this pattern is quite prominently referred to already in the third sentence in the [mdn entry on `FormData`](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/FormData).","issue_id":1661112978218,"origin_id":712993135,"user_origin_id":20753323,"create_time":1603212040,"update_time":1603212040,"id":1666897443143,"updated_at":"2022-10-27T19:04:03.142000Z","created_at":"2022-10-27T19:04:03.142000Z"},{"_id":"635ad6233056137e265f5752","body":"Allowing this without a type assertion would be somewhat inconsistent. It's like changing\r\n\r\n```\r\ninterface URLSearchParams {\r\n set(name: str, value: str)\r\n}\r\n```\r\n\r\nto\r\n\r\n```\r\ninterface URLSearchParams {\r\n set(name: str, value: any \/* !* \/)\r\n}\r\n```\r\n\r\njust because any `value` will be coerced to a string, like `{}` is coerced to `[object Object]`, or a file is coerced to `[object File]` as saschanaz found.","issue_id":1661112978218,"origin_id":713002967,"user_origin_id":402777,"create_time":1603213055,"update_time":1603213086,"id":1666897443146,"updated_at":"2022-10-27T19:04:03.145000Z","created_at":"2022-10-27T19:04:03.145000Z"},{"_id":"635ad6233056137e265f5753","body":"One way could be making FormData generic. `FormData<string>` should be always safe then. ","issue_id":1661112978218,"origin_id":713007614,"user_origin_id":3396686,"create_time":1603213525,"update_time":1603213525,"id":1666897443148,"updated_at":"2022-10-27T19:04:03.148000Z","created_at":"2022-10-27T19:04:03.148000Z"},{"_id":"667f7a8974fb49ab3a04614a","body":"Any updates on this?","issue_id":1661112978218,"origin_id":1960075753,"user_origin_id":27179786,"create_time":1708628622,"update_time":1708628622,"id":1719630473391,"updated_at":"2024-06-29T03:07:53.390000Z","created_at":"2024-06-29T03:07:53.390000Z"}] comment

See https://github.com/microsoft/TypeScript/issues/30584 I'm aware that URLSearchParams also accepts generic iterators (see https://github.com/microsoft/TSJS-lib-generator/issues/741) but mostly interested in getting _this specific pattern_ fixed quickly, as it's used a lot.

fix(dom): DOMRECTList index can return undefined

[{"_id":"635ad86c8041c95dfb171f15","body":"Thanks for helping.\r\nThis is a generated file, so you have to adjust the source.","issue_id":1661112978221,"origin_id":613489042,"user_origin_id":2410353,"create_time":1586875873,"update_time":1586875873,"id":1666898028020,"updated_at":"2022-10-27T19:13:48.020000Z","created_at":"2022-10-27T19:13:48.020000Z"},{"_id":"635ad86c8041c95dfb171f16","body":"The source that's here? https:\/\/github.com\/microsoft\/TSJS-lib-generator\/blob\/15a4678e0ef6de308e79451503e444e9949ee849\/inputfiles\/idl\/Geometry%20Interfaces.widl#L79-L82 or something else?","issue_id":1661112978221,"origin_id":613491081,"user_origin_id":118266,"create_time":1586876090,"update_time":1586876090,"id":1666898028026,"updated_at":"2022-10-27T19:13:48.026000Z","created_at":"2022-10-27T19:13:48.026000Z"},{"_id":"635ad86c8041c95dfb171f17","body":"Hrm, interesting - it's reasonable that the WIDL you posted should generate an `undefined` union.\r\n\r\nIt's quite possible that the WIDL->DTS does not add the `| undefined` here for the sake of convenience (like we don't force it on array index accessors ) -- it might need an explicit override in the big JSON file","issue_id":1661112978221,"origin_id":613658296,"user_origin_id":49038,"create_time":1586895299,"update_time":1586895299,"id":1666898028030,"updated_at":"2022-10-27T19:13:48.029000Z","created_at":"2022-10-27T19:13:48.029000Z"}] comment

See https://drafts.fxtf.org/geometry-1/#domrectlist

fix(NamedNodeMap): Index signature accepts `string`

[{"_id":"635ad372ea01ec786e7cdfd7","body":"The failure explains why it isn't there \ud83d\ude13","issue_id":1661112978224,"origin_id":594773470,"user_origin_id":3396686,"create_time":1583349874,"update_time":1583349874,"id":1666896754552,"updated_at":"2022-10-27T18:52:34.552000Z","created_at":"2022-10-27T18:52:34.552000Z"}] comment

See the [**DOM Specification**](https://dom.spec.whatwg.org/#interface-namednodemap) for details.

There are some web API packages in DefinitelyTyped mainly to use APIs with bad browser support. Those should be able to be generated here to prevent unwanted deviation. (Part of...

HTMLVideoElement.play may be undefined

[{"_id":"635ad37fcecf4e081a219d71","body":"Yeah, I think this is reasonable - I'd wait a week or two before looking at contributing because this repo will be a bit of a moving target ","issue_id":1661112978231,"origin_id":869881001,"user_origin_id":49038,"create_time":1624901926,"update_time":1624901926,"id":1666896767437,"updated_at":"2022-10-27T18:52:47.436000Z","created_at":"2022-10-27T18:52:47.436000Z"},{"_id":"635ad37fcecf4e081a219d72","body":"Thanks for the tip, I'll look into it in a couple of weeks then!","issue_id":1661112978231,"origin_id":869892335,"user_origin_id":8486092,"create_time":1624902671,"update_time":1624902671,"id":1666896767440,"updated_at":"2022-10-27T18:52:47.440000Z","created_at":"2022-10-27T18:52:47.440000Z"},{"_id":"635ad37fcecf4e081a219d73","body":"I think all of modern browsers have supported promise return type for years, so I'm not very convinced here \ud83e\udd14\r\n\r\nMaybe the MDN article should be fixed instead.","issue_id":1661112978231,"origin_id":873282073,"user_origin_id":3396686,"create_time":1625264207,"update_time":1625264207,"id":1666896767444,"updated_at":"2022-10-27T18:52:47.444000Z","created_at":"2022-10-27T18:52:47.444000Z"},{"_id":"635ad37fcecf4e081a219d74","body":"@saschanaz Thanks for the clarification and for updating the MDN article! I wasn't sure how old is too old for still providing static type support, so if this scenario doesn't pass the criteria we can close the issue.","issue_id":1661112978231,"origin_id":874782653,"user_origin_id":8486092,"create_time":1625579769,"update_time":1625579769,"id":1666896767447,"updated_at":"2022-10-27T18:52:47.447000Z","created_at":"2022-10-27T18:52:47.447000Z"},{"_id":"635ad37fcecf4e081a219d75","body":"I think it's safe to close this. \ud83d\udc4d\r\n\r\n@github-actions close","issue_id":1661112978231,"origin_id":1250253723,"user_origin_id":3396686,"create_time":1663502014,"update_time":1663502014,"id":1666896767450,"updated_at":"2022-10-27T18:52:47.449000Z","created_at":"2022-10-27T18:52:47.449000Z"},{"_id":"635ad37fcecf4e081a219d76","body":"Closing because @saschanaz is one of the code-owners of this repository.","issue_id":1661112978231,"origin_id":1250253759,"user_origin_id":41898282,"create_time":1663502030,"update_time":1663502030,"id":1666896767452,"updated_at":"2022-10-27T18:52:47.452000Z","created_at":"2022-10-27T18:52:47.452000Z"}] comment

According to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play#return_value), "older browsers may not return a value from `play()`." I also got an alert about that in production shortly after deploying a change that used `play().catch()` without...

You can do this

See https://github.com/heycam/webidl/pull/936. - `BigInt64Array` and `BigUint64Array` are introduced as keywords. - The `ArrayBufferView` and `BufferSource` aliases now include BigInt64Array and BigUint64Array as part of the union. Concretely, the only change...

HTMLFormControlsCollection does not have string accessor

[{"_id":"635ae12bd297b6213235fae8","body":"This might have come in since then: https:\/\/github.com\/microsoft\/TypeScript-DOM-lib-generator\/blob\/master\/baselines\/dom.generated.d.ts#L6701-L6708\r\n\r\n```\r\n\/** A collection of HTML form control elements. *\/\r\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\r\n \/**\r\n * Returns the item with ID or name name from the collection.\r\n *\r\n * If there are multiple matching items, then a RadioNodeList object containing all those elements is returned.\r\n *\/\r\n namedItem(name: string): RadioNodeList | Element | null;\r\n}\r\n\r\n```","issue_id":1661112978242,"origin_id":869902911,"user_origin_id":49038,"create_time":1624903573,"update_time":1624903573,"id":1666900267331,"updated_at":"2022-10-27T19:51:07.331000Z","created_at":"2022-10-27T19:51:07.331000Z"},{"_id":"635ae12bd297b6213235fae9","body":"@orta as far as I know, the indexers have always just been redirected to namedItem; for some reason, this is the only HTMLCollectionBase-derived class that doesn't also override the indexer. See https:\/\/html.spec.whatwg.org\/multipage\/common-dom-interfaces.html#the-htmlformcontrolscollection-interface (which is supposedly where it appeared first in the spec) where the IDL indeed only mentions namedItem, but, below it it explains that the indexer redirects to it.","issue_id":1661112978242,"origin_id":873853476,"user_origin_id":1224734,"create_time":1625468087,"update_time":1625468189,"id":1666900267335,"updated_at":"2022-10-27T19:51:07.335000Z","created_at":"2022-10-27T19:51:07.335000Z"}] comment

As per the spec (https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection/namedItem), namedItem supports strings, but the accessor of `HTMLFormControlsCollection` is not updated to reflect this.