Skip to content

MediaQueryListListener should provide a MediaQueryListEvent #550

@ghost

Description

In typescript@3.0 this was:

interface MediaQueryListListener {
    (mql: MediaQueryList): void;
}
interface MediaQueryList {
    readonly matches: boolean;
    readonly media: string;
    addListener(listener: MediaQueryListListener): void;
    removeListener(listener: MediaQueryListListener): void;
}

As of microsoft/TypeScript#25944 this is now:

interface MediaQueryList extends EventTarget {
	...
    addListener(listener: EventListenerOrEventListenerObject | null): void;
    ...
}

According to mdn this is better than before, but it could be more specific -- the event will always be a MediaQueryListEvent, but currently will just be an Event.

This affects match-media-mock on DefinitelyTyped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions