DOMStringMap is defined as an empty interface - this makes it awkward to use #1852
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Fixed
A PR has been merged for this issue
Revisit
An issue worth coming back to
Milestone
The
DOMStringMap
interface is defined as follows:https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts#L10556
This means it's a compile error to directly access the object properties, but it's also an
implicit any
error if the--noImplicitAny
switch is turned on in the compiler. This makes using a node'sdataset
somewhat arduous since a cast is required.I'm not sure if there is some way to declare that an object has arbitrary properties of some given type, but perhaps a minimal working solution would be to give this interface a string indexer:
The text was updated successfully, but these errors were encountered: