(matchMedia?: TouchMediaMatcher)
| 32 | }; |
| 33 | |
| 34 | export function getTouchMediaState(matchMedia?: TouchMediaMatcher): TouchMediaState { |
| 35 | if (!matchMedia) { |
| 36 | return { |
| 37 | isCoarsePointer: false, |
| 38 | cannotHover: false, |
| 39 | }; |
| 40 | } |
| 41 | |
| 42 | return { |
| 43 | isCoarsePointer: matchMedia(COARSE_POINTER_QUERY).matches, |
| 44 | cannotHover: matchMedia(NO_HOVER_QUERY).matches, |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | export function shouldUseTouchMode({ |
| 49 | isCoarsePointer, |
no outgoing calls
no test coverage detected