MediaQueryList
Stores information on a media query applied to a document, and handles sending notifications to listeners when the media query state change (i.e. when the media query test starts or stops evaluating to true).
interface MediaQueryList extends EventTarget {
readonly matches: boolean;
readonly media: string;
onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null;
addEventListener<K extends keyof MediaQueryListEventMap>(
type: K,
listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;addListener(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;
removeEventListener<K extends keyof MediaQueryListEventMap>(
type: K,
listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;removeListener(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;
}var MediaQueryList: {
prototype: MediaQueryList;
new (): MediaQueryList;
};§Extends
§Properties
§
onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null
[src]§Methods
§
addEventListener<K extends keyof MediaQueryListEventMap>(
[src]type: K,
listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
addListener(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void
[src]§
removeEventListener<K extends keyof MediaQueryListEventMap>(
[src]type: K,
listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void§
removeListener(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void
[src]