mock-match-media
Version:
mock window.matchMedia for tests or node
16 lines (15 loc) • 565 B
TypeScript
declare const EventCompat: typeof Event;
export declare const matchMedia: typeof window.matchMedia;
export declare class MediaQueryListEvent extends EventCompat {
readonly media: string;
readonly matches: boolean;
constructor(type: "change", options?: {
media?: string;
matches?: boolean;
});
}
export declare const setMedia: (media: Record<string, string>) => void;
export declare const cleanupListeners: () => void;
export declare const cleanupMedia: () => void;
export declare const cleanup: () => void;
export {};