Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update lib.dom.d.ts: MutationObserverInit.attributeFilter can accept an iterator #55990

Copy link
Copy link
@trusktr

Description

@trusktr
Issue body actions

⚙ Compilation target

n/a

⚙ Library

lib.dom

Missing / Incorrect Definition

MutationObserverInit

Sample Code

The following code works in Chredge, Firefox, and Safari:

const obs = new MutationObserver((records) => {
    console.log(...records)
})

const s = new Set(['foo', 'bar'])

obs.observe(document.body, {
  attributeFilter: s.keys() // <--------- HERE
})

document.body.setAttribute('foo', 'foo')
document.body.removeAttribute('foo')
document.body.setAttribute('bar', 'bar')
document.body.removeAttribute('bar')

Edge screenshot:

Screenshot 2023-10-04 at 6 36 01 PM

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe#parameters

WIP Pull Request

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.