Skip to content

Commit 8f3317a

Browse files
committed
use @as directive for _type in @obj
1 parent 4e31850 commit 8f3317a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/Webapi/Webapi__Blob.res

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module Impl = (
77

88
@get external size: T.t => float = "size"
99

10-
@send external slice: (T.t, ~start: int=?, ~end_: int=?, ~contentType: string=?, unit) => T.t = "slice"
10+
@send
11+
external slice: (T.t, ~start: int=?, ~end_: int=?, ~contentType: string=?, unit) => T.t = "slice"
1112

1213
@send external stream: T.t => Webapi__ReadableStream.t = "stream"
1314

@@ -27,7 +28,11 @@ type endingType = [#transparent | #native]
2728
type blobPropertyBag
2829

2930
@obj
30-
external makeBlobPropertyBag: (~_type: string=?, ~endings: endingType=?, unit) => blobPropertyBag = ""
31+
external makeBlobPropertyBag: (
32+
@as("type") ~_type: string=?,
33+
~endings: endingType=?,
34+
unit,
35+
) => blobPropertyBag = ""
3136

3237
type blobPart
3338

@@ -45,4 +50,4 @@ external int32ArrayToBlobPart: Js.Typed_array.Int32Array.t => blobPart = "%ident
4550
external uint32ArrayToBlobPart: Js.Typed_array.Uint32Array.t => blobPart = "%identity"
4651
external float32ToBlobPart: Js.Typed_array.Float32Array.t => blobPart = "%identity"
4752
external float64ArrayToBlobPart: Js.Typed_array.Float64Array.t => blobPart = "%identity"
48-
external dataViewToBlobPart: Js.Typed_array.DataView.t => blobPart = "%identity"
53+
external dataViewToBlobPart: Js.Typed_array.DataView.t => blobPart = "%identity"

src/Webapi/Webapi__File.res

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@ include Webapi__Blob.Impl({
66
type t = t
77
})
88

9-
109
type filePropertyBag
1110

1211
@obj
1312
external makeFilePropertyBag: (
1413
~endings: Webapi__Blob.endingType=?,
15-
~_type: string=?,
14+
@as("type") ~_type: string=?,
1615
~lastModified: float=?,
1716
unit,
1817
) => filePropertyBag = ""
1918

2019
@@text("{1 File class}")
2120

2221
@new external make: (array<Webapi__Blob.blobPart>, string) => t = "File"
23-
@new external makeWithOptions: (array<Webapi__Blob.blobPart>, string, filePropertyBag) => t = "File";
22+
@new external makeWithOptions: (array<Webapi__Blob.blobPart>, string, filePropertyBag) => t = "File"
2423

2524
@get external lastModified: t => float = "lastModified"
2625

27-
@get external name: t => string = "name"
26+
@get external name: t => string = "name"

0 commit comments

Comments
 (0)