UNPKG

1.18 kBTypeScriptView Raw
1import { EventData, Observable } from '../data/observable';
2declare function checkIfMediaQueryMatches(mediaQueryString: string): boolean;
3declare function matchMedia(mediaQueryString: string): MediaQueryListImpl;
4declare class MediaQueryListImpl extends Observable implements MediaQueryList {
5 static readonly changeEvent = "change";
6 _media: string;
7 _matches: boolean;
8 private _onChange;
9 private mediaQueryChangeListeners;
10 constructor();
11 get media(): string;
12 get matches(): boolean;
13 addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
14 removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: any): void;
15 addListener(callback: (this: MediaQueryList, ev: MediaQueryListEvent) => any): void;
16 removeListener(callback: (this: MediaQueryList, ev: MediaQueryListEvent) => any): void;
17 get onchange(): (this: MediaQueryList, ev: MediaQueryListEvent) => any;
18 set onchange(callback: (this: MediaQueryList, ev: MediaQueryListEvent) => any);
19 private _throwInvocationError;
20}
21export { matchMedia, MediaQueryListImpl as MediaQueryList, checkIfMediaQueryMatches };