( element: Element, )
| 18 | } |
| 19 | |
| 20 | export function hasSelectionSupport( |
| 21 | element: Element, |
| 22 | ): element is |
| 23 | | HTMLTextAreaElement |
| 24 | | (HTMLInputElement & {type: selectionSupportType}) { |
| 25 | return ( |
| 26 | isElementType(element, 'textarea') || |
| 27 | (isElementType(element, 'input') && |
| 28 | Boolean( |
| 29 | selectionSupportType[element.type as keyof typeof selectionSupportType], |
| 30 | )) |
| 31 | ) |
| 32 | } |
| 33 | |
| 34 | export function getSelectionRange( |
| 35 | element: Element, |
no test coverage detected