TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
Tool for generating dom related TypeScript and JavaScript library files
Simplify / fix HTMLCollection overrides
Use an extra optional type param on HTMLCollection for `namedItem` override. This simplifies / removes quite a lot of emitter code that was necessary to maintain just for this override....
Emit modular.generated.d.ts
This is a draft for #1207. Another way would be to create a package that can be used as a build dependency, so that other packages can generate their own...
Certain types such as MouseEvent.button not defined
I noticed some values for types such as `MouseEvent.button` are [defined in Web API specs](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button) but are not defined in `lib.dom.ts`: ``` 0: Main button pressed, usually the left button...
Types for CSS painting API - `registerPaint`
# Suggestion ## 🔍 Search Terms registerPaint, CSS paint API, types ## ✅ Viability Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in existing...
fix: Mark `prototype` property of constructors as `readonly`
This more closely matches runtime behaviour. --- It also causes code that would try to re‑assign the `prototype` property of **WebIDL** constructors to have the error caught at compile time,...
 **DOMRect** https://developer.mozilla.org/en-US/docs/Web/API/DOMRect#methods  **DOMPointReadOnly.toJSON()** https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/toJSON
`DOMStringList` missing iterator method
TypeScript blocks using `[...location.ancestorOrigins]` with the error > Type 'DOMStringList' must have a '\[Symbol.iterator]()' method that returns an iterator. ts(2488) However, it is present in Chrome: 
Reduce the use of `overrideType`
`overrideType` is intended to be the last resort, but the existing uses confuse people and incorrectly guide them to use it when it's not the ideal way. See also https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1196
DOMString and friends are too narrow
[`DOMString`](https://developer.mozilla.org/en-US/docs/Web/API/DOMString), [`USVString`](https://developer.mozilla.org/en-US/docs/Web/API/USVString), [`CSSOMString`](https://developer.mozilla.org/en-US/docs/Web/API/CSSOMString) and [`ByteString`](https://developer.mozilla.org/en-US/docs/Web/API/ByteString) are currently mapped to simply `string`: https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/1fd97d19c109bc6ec2780605709f6e819356e942/src/helpers.ts#L53 However it doesn't include objects that can be stringified using the [`ToString`](https://tc39.es/ecma262/#sec-tostring) abstract operation. For example, the following...
Adjust `.parentElement` type to include `SVGElement`
In reality, this also includes `| null` but this has been removed in https://github.com/microsoft/TypeScript-DOM-lib-generator/commit/2cd8ad3974b63affd454164028960821e77a2e17 so I guess you want to omit that for pragmatic reasons. Originally this was typed as...