import documentIsAvailable from './documentIsAvailable';
const state = {
    primary: false,
    secondary: false,
    auxillary: false,
    fourth: false,
    fifth: false
};
if (documentIsAvailable) {
    // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
    const handleEvent = ({ buttons }) => {
        /* eslint-disable no-bitwise */
        state.primary = !!(buttons & 1);
        state.secondary = !!(buttons & 2);
        state.auxillary = !!(buttons & 4);
        state.fourth = !!(buttons & 8);
        state.fifth = !!(buttons & 16);
        /* eslint-enable no-bitwise */
    };
    document.addEventListener('mousedown', handleEvent);
    document.addEventListener('mouseup', handleEvent);
    // mouseup and drop both handle releasing mouse buttons, but are exclusive.
    document.addEventListener('drop', handleEvent);
}
export default state;
//# sourceMappingURL=mouseState.js.map