/*! * @license * Copyright Squiz Australia Pty Ltd. All Rights Reserved. */ /** * Change the result of a `media` query. * @export * @template K The `MediaQueryList` event types. * @param {MediaQueryList['media']} media The query to change. * @param {K} eventType The type of `MediaQueryList` event. * @param {MediaQueryList['matches']} matches The new value for `MediaQueryList['matches']`. */ export declare type MatchMediaEventDispatcher = (media: MediaQueryList['media'], eventType: K, matches: MediaQueryList['matches']) => void; /** * Handler `MediaQueryList` events. * @export * @template K The `MediaQueryList` event types. * @param {MediaQueryListEventMap[K]} event The `MediaQueryList` event. */ export declare type MatchMediaEventHandler = (event: MediaQueryListEventMap[K]) => void; /** * A tuple of an event type, and a handler for that event type. * @export * @template K The `MediaQueryList` event types. */ export declare type MatchMediaEventTuple = [K, MatchMediaEventHandler]; /** * Respond to a given `matchMedia` query. * @export * @param {string} query The query to respond to. * @returns {boolean | undefined} Whether or not the given query `matches`. */ export declare type MatchMediaMatchesHandler = (query: string) => boolean | undefined; /** * Update the handler that responds to `matchMedia` queries. * @export * @param {(MatchMediaMatchesHandler | Array)} [handler] The new handler(s) to use to respond * to queries. * @returns {MatchMediaEventDispatcher} A handler to change the result of a `media` query. */ export declare type MatchMediaMatchesHandlerFactory = (handler?: MatchMediaMatchesHandler | Array) => MatchMediaEventDispatcher; /** * Create and set a mock version of `matchMedia` and `MediaQueryListEvent`. * @export * @template K The `MediaQueryList` event types. * @param {Array} [unsupportedQueries=[]] The queries that are not supported. * @returns {MatchMediaMatchesHandlerFactory} A factory that can be used to update the `handleMatches` Function. */ export declare function createAndAttachMockMatchMedia(unsupportedQueries?: Array): MatchMediaMatchesHandlerFactory;