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.
In
typescript@3.0this was:As of microsoft/TypeScript#25944 this is now:
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 anEvent.This affects
match-media-mockon DefinitelyTyped.