I noticed that getSelection can return null in the implementation, but the type definition in index.d.ts does not reflect this possibility.
Source code (shows possible null return):
Type definition (does not include null in its type):
|
getSelection: () => [number, number, number, number]; |
The type definition should be updated to indicate that getSelection may return null. For example:
getSelection: () => [number, number, number, number] | null;