Skip to content

Fixed bindings that end with *.js #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ReactDOMServer.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@module("react-dom/server.js")
@module("react-dom/server")
external renderToString: React.element => string = "renderToString"

@module("react-dom/server.js")
@module("react-dom/server")
external renderToStaticMarkup: React.element => string = "renderToStaticMarkup"
32 changes: 16 additions & 16 deletions src/ReactTestUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type undefined = Js.undefined<unit>

let undefined: undefined = Js.Undefined.empty

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external reactAct: ((. unit) => undefined) => unit = "act"

let act: (unit => unit) => unit = func => {
Expand All @@ -13,40 +13,40 @@ let act: (unit => unit) => unit = func => {
reactAct(reactFunc)
}

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external reactActAsync: ((. unit) => Js.Promise.t<'a>) => Js.Promise.t<unit> = "act"

let actAsync = func => {
let reactFunc = (. ()) => func()
reactActAsync(reactFunc)
}

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isElement: 'element => bool = "isElement"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isElementOfType: ('element, React.component<'props>) => bool = "isElementOfType"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isDOMComponent: 'element => bool = "isDOMComponent"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isCompositeComponent: 'element => bool = "isCompositeComponent"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isCompositeComponentWithType: ('element, React.component<'props>) => bool =
"isCompositeComponentWithType"

module Simulate = {
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external click: Dom.element => unit = "click"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external clickWithEvent: (Dom.element, 'event) => unit = "click"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external change: Dom.element => unit = "change"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external blur: Dom.element => unit = "blur"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external changeWithEvent: (Dom.element, 'event) => unit = "change"
let changeWithValue = (element, value) => {
let event = {
Expand All @@ -64,13 +64,13 @@ module Simulate = {
}
changeWithEvent(element, event)
}
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external canPlay: Dom.element => unit = "canPlay"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external timeUpdate: Dom.element => unit = "timeUpdate"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external ended: Dom.element => unit = "ended"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external focus: Dom.element => unit = "focus"
}

Expand Down
28 changes: 14 additions & 14 deletions src/ReactTestUtils.resi
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ let act: (unit => unit) => unit

let actAsync: (unit => Js.Promise.t<'a>) => Js.Promise.t<unit>

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isElement: 'element => bool = "isElement"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isElementOfType: ('element, React.component<'props>) => bool = "isElementOfType"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isDOMComponent: 'element => bool = "isDOMComponent"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isCompositeComponent: 'element => bool = "isCompositeComponent"

@module("react-dom/test-utils.js")
@module("react-dom/test-utils")
external isCompositeComponentWithType: ('element, React.component<'props>) => bool =
"isCompositeComponentWithType"

module Simulate: {
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external click: Dom.element => unit = "click"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external clickWithEvent: (Dom.element, 'event) => unit = "click"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external change: Dom.element => unit = "change"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external blur: Dom.element => unit = "blur"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external changeWithEvent: (Dom.element, 'event) => unit = "change"
let changeWithValue: (Dom.element, string) => unit
let changeWithChecked: (Dom.element, bool) => unit
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external canPlay: Dom.element => unit = "canPlay"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external timeUpdate: Dom.element => unit = "timeUpdate"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external ended: Dom.element => unit = "ended"
@module("react-dom/test-utils.js") @scope("Simulate")
@module("react-dom/test-utils") @scope("Simulate")
external focus: Dom.element => unit = "focus"
}

Expand Down