Skip to content

Add StyleSheetList and CSSRuleList to dom.iterable.d.ts #23406

@cnshenj

Description

@cnshenj

TypeScript Version: 2.8.1

Search Terms: StyleSheetList iterable

Code

// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
for (const styleSheet of document.styleSheets) {
}

Both latest Chrome 65 and Firefox 59 support iterable on StyleSheetList and CSSRuleList.
I can submitted a PR if needed.

Expected behavior:
Code compiled without error.

Actual behavior:
Type 'StyleSheetList' is not an array type or a string type or does not have a 'Symbol.iterator' method that returns an iterator.

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions