diff --git a/CHANGELOG.md b/CHANGELOG.md index ff788d8..ed239fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,10 @@ ## main - #### :boom: Breaking Change - Corrected return type of `getPropertyValue` for CSS style attributes (it's nullable and now returns an option). +- Corrected signature of `toggleForced` (for `Dom.domTokenList`) to accept a bool denoting whether to toggle the class on or off. #### :bug: Bug Fix diff --git a/lib/js/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.js b/lib/js/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.js index 7d2f005..b750684 100644 --- a/lib/js/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.js +++ b/lib/js/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.js @@ -28,7 +28,9 @@ var supports = tlist.supports("my-class"); var toggle = tlist.toggle("my-class"); -var toggleForced = tlist.toggle("my-class", true); +var toggleForced_true = tlist.toggle("my-class", true); + +var toggleForced_false = tlist.toggle("my-class", false); var toString = tlist.toString(); @@ -46,7 +48,8 @@ exports.item = item$1; exports.contains = contains; exports.supports = supports; exports.toggle = toggle; -exports.toggleForced = toggleForced; +exports.toggleForced_true = toggleForced_true; +exports.toggleForced_false = toggleForced_false; exports.toString = toString; exports.value = value; exports.setValue = setValue; diff --git a/src/Webapi/Dom/Webapi__Dom__DomTokenList.res b/src/Webapi/Dom/Webapi__Dom__DomTokenList.res index d3db60a..9464302 100644 --- a/src/Webapi/Dom/Webapi__Dom__DomTokenList.res +++ b/src/Webapi/Dom/Webapi__Dom__DomTokenList.res @@ -14,7 +14,7 @@ type t = Dom.domTokenList @send external replace: (t, string, string) => unit = "replace" /* experimental */ @send external supports: (t, string) => bool = "supports" /* experimental, Content Management Level 1 */ @send external toggle: (t, string) => bool = "toggle" -@send external toggleForced: (t, string, @as(json`true`) _) => bool = "toggle" +@send external toggleForced: (t, string, bool) => bool = "toggle" @send external toString: t => string = "toString" /* values: iterator API, should have language support */ diff --git a/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.res b/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.res index 4a65d4f..2a7da50 100644 --- a/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.res +++ b/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.res @@ -15,7 +15,8 @@ tlist->removeMany(["my-class", "my-other-class"]) tlist->replace("my-class", "my-other-class") let supports: bool = tlist->supports("my-class") let toggle: bool = tlist->toggle("my-class") -let toggleForced: bool = tlist->toggleForced("my-class") +let toggleForced_true: bool = tlist->toggleForced("my-class", true) +let toggleForced_false: bool = tlist->toggleForced("my-class", false) let toString: string = tlist->toString let value: string = tlist->value let setValue: unit = tlist->setValue("foo")