Skip to content

Commit d9d2607

Browse files
committed
getSelection could return null
1 parent c5013d4 commit d9d2607

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/DOMAPI/Document.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ Returns an object representing the current selection of the document that is loa
442442
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getSelection)
443443
*/
444444
@send
445-
external getSelection: document => selection = "getSelection"
445+
external getSelection: document => null<selection> = "getSelection"
446446

447447
/**
448448
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/hasStorageAccess)

src/DOMAPI/Window.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,4 @@ external cancelIdleCallback: (window, int) => unit = "cancelIdleCallback"
514514
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/getSelection)
515515
*/
516516
@send
517-
external getSelection: window => selection = "getSelection"
517+
external getSelection: window => null<selection> = "getSelection"

src/Global.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,4 +744,4 @@ external cancelIdleCallback: int => unit = "cancelIdleCallback"
744744
/**
745745
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/getSelection)
746746
*/
747-
external getSelection: unit => selection = "getSelection"
747+
external getSelection: unit => null<selection> = "getSelection"

0 commit comments

Comments
 (0)