/** * Mock-implementation of `MediaQueryList` with ability to control state programmatically. * Useful for unit testing. * Can be used in any runtime that implements `EventTarget` (browsers, Node.js, Deno, Bun...). */ export declare class MediaQueryListMock extends EventTarget implements MediaQueryList { readonly media: string; readonly matches: boolean; protected _onchange: ((this: MediaQueryList, event: MediaQueryListEvent) => any) | null; constructor(query: string); /** @inheritdoc */ get onchange(): ((this: MediaQueryList, event: MediaQueryListEvent) => any) | null; /** @inheritdoc */ set onchange(value: ((this: MediaQueryList, event: MediaQueryListEvent) => any) | null); /** @inheritdoc */ addEventListener(type: K, listener: (this: MediaQueryList, event: MediaQueryListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; /** @inheritdoc */ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; /** @inheritdoc */ removeEventListener(type: K, listener: (this: MediaQueryList, event: MediaQueryListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; /** @inheritdoc */ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; /** * @inheritdoc * @deprecated According to MDN. */ addListener(callback: ((this: MediaQueryList, event: MediaQueryListEvent) => any) | null): void; /** * @inheritdoc * @deprecated According to MDN. */ removeListener(callback: ((this: MediaQueryList, event: MediaQueryListEvent) => any) | null): void; /** * Changes state of matching media query. * Calling this method will cause dispatching `change` event. * @param matches Boolean. */ simulateChange({ matches }: { matches: boolean; }): void; } /** * Mock-implementation of MediaQueryListEvent. * Useful for unit testing. * Can be used in every runtime that implements `Event` (browsers, nodejs, deno, bun...). */ export declare class MediaQueryListEventMock extends Event implements MediaQueryListEvent { /** @inheritdoc */ readonly matches: boolean; /** @inheritdoc */ readonly media: string; constructor(name: string, init?: MediaQueryListEventInit); }