-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathURLSearchParams.res
More file actions
68 lines (58 loc) · 2.16 KB
/
Copy pathURLSearchParams.res
File metadata and controls
68 lines (58 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
open FetchAPI
open Prelude
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
*/
@new
external make: (~init: array<array<string>>=?) => urlSearchParams = "URLSearchParams"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
*/
@new
external make2: (~init: any=?) => urlSearchParams = "URLSearchParams"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
*/
@new
external make3: (~init: string=?) => urlSearchParams = "URLSearchParams"
/**
Appends a specified key/value pair as a new search parameter.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
*/
@send
external append: (urlSearchParams, ~name: string, ~value: string) => unit = "append"
/**
Deletes the given search parameter, and its associated value, from the list of all search parameters.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
*/
@send
external delete: (urlSearchParams, ~name: string, ~value: string=?) => unit = "delete"
/**
Returns the first value associated to the given search parameter.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
*/
@send
external get: (urlSearchParams, string) => string = "get"
/**
Returns all the values association with a given search parameter.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
*/
@send
external getAll: (urlSearchParams, string) => array<string> = "getAll"
/**
Returns a Boolean indicating if such a search parameter exists.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
*/
@send
external has: (urlSearchParams, ~name: string, ~value: string=?) => bool = "has"
/**
Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
*/
@send
external set: (urlSearchParams, ~name: string, ~value: string) => unit = "set"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
*/
@send
external sort: urlSearchParams => unit = "sort"