diff --git a/examples/fetch_examples.res b/examples/fetch_examples.res index 04e76ab..c31c42f 100644 --- a/examples/fetch_examples.res +++ b/examples/fetch_examples.res @@ -8,7 +8,7 @@ let _ = { } let _ = { - Fetch.fetchWithInit("/api/hello", Fetch.RequestInit.make(~method_=Post, ())) + Fetch.fetchWithInit("/api/hello", Fetch.RequestInit.make(~method=Post, ())) ->then(Fetch.Response.text) ->then(text => print_endline(text)->resolve) } @@ -31,7 +31,7 @@ let _ = { Fetch.fetchWithInit( "/api/hello", Fetch.RequestInit.make( - ~method_=Post, + ~method=Post, ~body=Fetch.BodyInit.make(Js.Json.stringify(Js.Json.object_(payload))), ~headers=Fetch.HeadersInit.make({"Content-Type": "application/json"}), (), @@ -51,7 +51,7 @@ let _ = { Fetch.fetchWithInit( "/api/upload", Fetch.RequestInit.make( - ~method_=Post, + ~method=Post, ~body=Fetch.BodyInit.makeWithFormData(formData), ~headers=Fetch.HeadersInit.make({"Accept": "*"}), (), diff --git a/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res b/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res index 48be0ed..e3c3df5 100644 --- a/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res +++ b/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res @@ -14,7 +14,7 @@ module Impl = ( @get external length: t_htmlFormElement => int = "length" @get external name: t_htmlFormElement => string = "name" @set external setName: (t_htmlFormElement, string) => unit = "name" - @get external method_: t_htmlFormElement => string = "method_" + @get external method: t_htmlFormElement => string = "method" @set external setMethod: (t_htmlFormElement, string) => unit = "method" @get external target: t_htmlFormElement => string = "target" @set external setTarget: (t_htmlFormElement, string) => unit = "target" diff --git a/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res b/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res index abdedab..f75dcf8 100644 --- a/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res +++ b/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res @@ -125,7 +125,7 @@ module Impl = ( @send external setSelectionRange: (t_htmlInputElement, int, int) => unit = "setSelectionRange" @send - external setSelectionRangeWithDirection_: (t_htmlInputElement, int, int, string) => unit = + external setSelectionRangeWithDirection: (t_htmlInputElement, int, int, string) => unit = "setSelectionRange" let setSelectionRangeWithDirection = ( selectionStart, @@ -133,7 +133,7 @@ module Impl = ( selectionDirection, element, ) => - element->setSelectionRangeWithDirection_( + element->setSelectionRangeWithDirection( selectionStart, selectionEnd, selectionDirection->SelectionDirection.toString, @@ -161,7 +161,7 @@ module Impl = ( external setRangeTextWithinInterval: (t_htmlInputElement, string, int, int) => unit = "setRangeText" @send - external setRangeTextWithinIntervalWithSelectionMode_: ( + external setRangeTextWithinIntervalWithSelectionMode: ( t_htmlInputElement, string, int, @@ -175,7 +175,7 @@ module Impl = ( selectionMode, element, ) => - element->setRangeTextWithinIntervalWithSelectionMode_( + element->setRangeTextWithinIntervalWithSelectionMode( text, selectionStart, selectionEnd, diff --git a/src/Webapi/Webapi__Blob.res b/src/Webapi/Webapi__Blob.res index 0f2d0ea..9224d39 100644 --- a/src/Webapi/Webapi__Blob.res +++ b/src/Webapi/Webapi__Blob.res @@ -7,7 +7,7 @@ module Impl = ( @get external size: T.t => float = "size" - @send external slice: (T.t, ~start: int=?, ~end_: int=?, ~contentType: string=?, unit) => T.t = "slice" + @send external slice: (T.t, ~start: int=?, ~end: int=?, ~contentType: string=?, unit) => T.t = "slice" @send external stream: T.t => Webapi__ReadableStream.t = "stream" diff --git a/src/Webapi/Webapi__Fetch.res b/src/Webapi/Webapi__Fetch.res index c0933fb..cac9ab9 100644 --- a/src/Webapi/Webapi__Fetch.res +++ b/src/Webapi/Webapi__Fetch.res @@ -47,7 +47,7 @@ let encodeRequestMethod = x => | Options => "OPTIONS" | Trace => "TRACE" | Patch => "PATCH" - | Other(method_) => method_ + | Other(method) => method } let decodeRequestMethod = x => /* internal */ @@ -62,7 +62,7 @@ let decodeRequestMethod = x => | "OPTIONS" => Options | "TRACE" => Trace | "PATCH" => Patch - | method_ => Other(method_) + | method => Other(method) } type referrerPolicy = @@ -324,7 +324,7 @@ module RequestInit = { unit, ) => requestInit = "" let make = ( - ~method_: option=?, + ~method: option=?, ~headers: option=?, ~body: option=?, ~referrer: option=?, @@ -338,7 +338,7 @@ module RequestInit = { ~signal: option=?, ) => make( - ~_method=?map(encodeRequestMethod, method_), + ~_method=?map(encodeRequestMethod, method), ~headers?, ~body?, ~referrer?, @@ -365,8 +365,8 @@ module Request = { @new external makeWithRequest: t => t = "Request" @new external makeWithRequestInit: (t, requestInit) => t = "Request" - @get external method_: t => string = "method" - let method_: t => requestMethod = self => decodeRequestMethod(method_(self)) + @get external method: t => string = "method" + let method: t => requestMethod = self => decodeRequestMethod(method(self)) @get external url: t => string = "url" @get external headers: t => headers = "headers" @get external destination: t => string = "destination" diff --git a/src/Webapi/Webapi__Fetch.resi b/src/Webapi/Webapi__Fetch.resi index 0a8ca18..5a8ddb5 100644 --- a/src/Webapi/Webapi__Fetch.resi +++ b/src/Webapi/Webapi__Fetch.resi @@ -142,7 +142,7 @@ module RequestInit: { type t = requestInit let make: ( - ~method_: requestMethod=?, + ~method: requestMethod=?, ~headers: headersInit=?, ~body: bodyInit=?, ~referrer: string=?, @@ -166,7 +166,7 @@ module Request: { @new external makeWithRequest: t => t = "Request" @new external makeWithRequestInit: (t, requestInit) => t = "Request" - let method_: t => requestMethod + let method: t => requestMethod @get external url: t => string = "url" @get external headers: t => headers = "headers" let destination: t => requestDestination