export function registerMatchMedia({ matchMedia, matchMediaChangeListener, errorMonitor, }) {
    try {
        if (typeof matchMedia.addEventListener === 'function') {
            matchMedia.addEventListener('change', matchMediaChangeListener);
        }
        else if (typeof matchMedia.addListener === 'function') {
            matchMedia.addListener(matchMediaChangeListener);
        }
        else {
            throw new Error('window.matchMedia does not support `addEventListener` or `addListener`');
        }
    }
    catch (e) {
        errorMonitor.captureException(e);
    }
    return () => matchMedia.removeEventListener('change', matchMediaChangeListener);
}
//# sourceMappingURL=matchMediaQuery.js.map