( event: string, init?: MouseEventInit, clickCount = 0, )
| 57 | } |
| 58 | |
| 59 | export function getMouseEventOptions( |
| 60 | event: string, |
| 61 | init?: MouseEventInit, |
| 62 | clickCount = 0, |
| 63 | ) { |
| 64 | init = init ?? {} |
| 65 | return { |
| 66 | ...init, |
| 67 | // https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail |
| 68 | detail: |
| 69 | event === 'mousedown' || event === 'mouseup' || event === 'click' |
| 70 | ? 1 + clickCount |
| 71 | : clickCount, |
| 72 | buttons: convertMouseButtons(event, init, 'buttons'), |
| 73 | button: convertMouseButtons(event, init, 'button'), |
| 74 | } |
| 75 | } |
no test coverage detected