Skip to content

Commit 2ba24b0

Browse files
committed
Added record keys to FormData.t, should be compatible (and the externals are kept for compatibility)
1 parent 352a0ce commit 2ba24b0

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/Webapi/Fetch/Webapi__Fetch__AbortController.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ type t = {signal: signal}
44
@new external make: unit => t = "AbortController"
55
@send external abort: t => unit = "abort"
66

7-
/** For compatibility. Prefer the record field. */
7+
@ocaml.doc("For compatibility. Prefer the record field.")
88
@get external signal: t => signal = "signal"

src/Webapi/Webapi__FormData.res

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ module EntryValue = {
99
}
1010
}
1111

12-
type t
12+
type t = private {
13+
keys: Webapi__Iterator.t<string>,
14+
values: Webapi__Iterator.t<EntryValue.t>,
15+
entries: Webapi__Iterator.t<(string, EntryValue.t)>,
16+
}
1317

1418
@new external make: unit => t = "FormData"
1519
@send external append: (t, string, string) => unit = "append"
@@ -18,8 +22,6 @@ type t
1822
@send external getAll: (t, string) => array<EntryValue.t> = "getAll"
1923
@send external set: (t, string, string) => unit = "set"
2024
@send external has: (t, string) => bool = "has"
21-
@send external keys: t => Webapi__Iterator.t<string> = "keys"
22-
@send external values: t => Webapi__Iterator.t<EntryValue.t> = "values"
2325

2426
@send external appendObject: (t, string, {..}, ~filename: string=?, unit) => unit = "append"
2527

@@ -33,4 +35,9 @@ type t
3335

3436
@send external setFile: (t, string, Webapi__File.t, ~filename: string=?, unit) => unit = "set"
3537

38+
@ocaml.doc("For compatibility. Prefer the record field.")
39+
@send external keys: t => Webapi__Iterator.t<string> = "keys"
40+
@ocaml.doc("For compatibility. Prefer the record field.")
41+
@send external values: t => Webapi__Iterator.t<EntryValue.t> = "values"
42+
@ocaml.doc("For compatibility. Prefer the record field.")
3643
@send external entries: t => Webapi__Iterator.t<(string, EntryValue.t)> = "entries"

src/Webapi/Webapi__FormData.resi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ module EntryValue: {
88
let classify: t => [> #String(string) | #File(Webapi__File.t)]
99
}
1010

11-
type t
11+
type t = private {
12+
keys: Webapi__Iterator.t<string>,
13+
values: Webapi__Iterator.t<EntryValue.t>,
14+
entries: Webapi__Iterator.t<(string, EntryValue.t)>,
15+
}
1216

1317
@new external make: unit => t = "FormData"
1418
@send external append: (t, string, string) => unit = "append"

0 commit comments

Comments
 (0)