/** * Имитация window.matchMedia. */ export declare class MatchMediaMock { protected readonly registry: Set; /** * @inheritdoc */ constructor(); /** * Имитация window.matchMedia. * @inheritdoc */ matchMedia(query: string): MediaQueryListMock; /** * Меняет состояние созданных MediaQueryListEventMock и вызывает на них событие MediaQueryListEventMock с типом change. * @inheritdoc */ simulateChange({ query, matches }: { query: string; matches: boolean; }): void; } /** * Имитация MediaQueryList. */ export declare class MediaQueryListMock extends EventTarget implements MediaQueryList { /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryList/media). */ readonly media: string; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryList/matches). * @inheritdoc */ get matches(): boolean; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryList/change_event). */ onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null; /** * @inheritdoc */ constructor(media: string, matches: boolean); /** * @inheritdoc */ addEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; /** * @inheritdoc */ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; /** * @inheritdoc */ removeEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; /** * @inheritdoc */ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryList/addListener). * @deprecated * @inheritdoc */ addListener(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryList/removeListener). * @deprecated * @inheritdoc */ removeListener(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void; } /** * Имитация MediaQueryListEvent. */ export declare class MediaQueryListEventMock extends Event implements MediaQueryListEvent { /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryListEvent/matches). */ readonly matches: boolean; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryListEvent/media). */ readonly media: string; /** * @inheritdoc */ constructor(type: string, eventInitDict?: MediaQueryListEventInit); }