# DOM
DOM utilities module for WordPress.
## Installation
Install the module
```bash
npm install @wordpress/dom --save
```
## API
### computeCaretRect
Get the rectangle for the selection in a container.
_Parameters_
- _win_ `Window`: The window of the selection.
_Returns_
- `DOMRect | null`: The rectangle.
### documentHasSelection
Check whether the current document has a selection. This includes focus in input fields, textareas, and general rich-text selection.
_Parameters_
- _doc_ `Document`: The document to check.
_Returns_
- `boolean`: True if there is selection, false if not.
### documentHasTextSelection
Check whether the current document has selected text. This applies to ranges of text in the document, and not selection inside `` and `