diff --git a/CHANGELOG.md b/CHANGELOG.md index d327bbf..a8976db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ ## main +# 0.9.1 + +#### :bug: Bug Fix + +- Fix binding compatibility with ReScript 11, which removed `_` variable mangling. https://github.com/TheSpyder/rescript-webapi/pull/129 + ## 0.9.0 #### :boom: Breaking Change diff --git a/src/Webapi/Webapi__Blob.res b/src/Webapi/Webapi__Blob.res index 0f2d0ea..c6623d1 100644 --- a/src/Webapi/Webapi__Blob.res +++ b/src/Webapi/Webapi__Blob.res @@ -7,7 +7,8 @@ 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" @@ -27,7 +28,11 @@ type endingType = [#transparent | #native] type blobPropertyBag @obj -external makeBlobPropertyBag: (~_type: string=?, ~endings: endingType=?, unit) => blobPropertyBag = "" +external makeBlobPropertyBag: ( + @as("type") ~_type: string=?, + ~endings: endingType=?, + unit, +) => blobPropertyBag = "" type blobPart @@ -45,4 +50,4 @@ external int32ArrayToBlobPart: Js.Typed_array.Int32Array.t => blobPart = "%ident external uint32ArrayToBlobPart: Js.Typed_array.Uint32Array.t => blobPart = "%identity" external float32ToBlobPart: Js.Typed_array.Float32Array.t => blobPart = "%identity" external float64ArrayToBlobPart: Js.Typed_array.Float64Array.t => blobPart = "%identity" -external dataViewToBlobPart: Js.Typed_array.DataView.t => blobPart = "%identity" +external dataViewToBlobPart: Js.Typed_array.DataView.t => blobPart = "%identity" \ No newline at end of file diff --git a/src/Webapi/Webapi__Fetch.res b/src/Webapi/Webapi__Fetch.res index 5736395..bcb74bf 100644 --- a/src/Webapi/Webapi__Fetch.res +++ b/src/Webapi/Webapi__Fetch.res @@ -309,7 +309,7 @@ module RequestInit = { @obj external make: ( - ~_method: string=?, + @as("method") ~_method: string=?, ~headers: headersInit=?, ~body: bodyInit=?, ~referrer: string=?, @@ -336,7 +336,7 @@ module RequestInit = { ~integrity: string="", ~keepalive: option=?, ~signal: option=?, - () + (), ) => make( ~_method=?map(encodeRequestMethod, method_), @@ -351,7 +351,7 @@ module RequestInit = { ~integrity, ~keepalive?, ~signal?, - () + (), ) } @@ -403,7 +403,7 @@ module ResponseInit = { ~status: option=?, ~statusText: option=?, ~headers: option=?, - () + (), ) => make(~status?, ~statusText?, ~headers?, ()) } @@ -436,4 +436,4 @@ module Response = { @val external fetch: string => Js.Promise.t = "fetch" @val external fetchWithInit: (string, requestInit) => Js.Promise.t = "fetch" @val external fetchWithRequest: request => Js.Promise.t = "fetch" -@val external fetchWithRequestInit: (request, requestInit) => Js.Promise.t = "fetch" +@val external fetchWithRequestInit: (request, requestInit) => Js.Promise.t = "fetch" \ No newline at end of file diff --git a/src/Webapi/Webapi__File.res b/src/Webapi/Webapi__File.res index 8b4ab38..a6fcf64 100644 --- a/src/Webapi/Webapi__File.res +++ b/src/Webapi/Webapi__File.res @@ -6,13 +6,12 @@ include Webapi__Blob.Impl({ type t = t }) - type filePropertyBag @obj external makeFilePropertyBag: ( ~endings: Webapi__Blob.endingType=?, - ~_type: string=?, + @as("type") ~_type: string=?, ~lastModified: float=?, unit, ) => filePropertyBag = "" @@ -20,8 +19,8 @@ external makeFilePropertyBag: ( @@text("{1 File class}") @new external make: (array, string) => t = "File" -@new external makeWithOptions: (array, string, filePropertyBag) => t = "File"; +@new external makeWithOptions: (array, string, filePropertyBag) => t = "File" @get external lastModified: t => float = "lastModified" -@get external name: t => string = "name" +@get external name: t => string = "name" \ No newline at end of file