@@ -92,4 +92,54 @@ class URL(url: String, base: String = js.native) extends js.Object {
92
92
* MDN
93
93
*/
94
94
var hash : String = js.native
95
+
96
+ var searchParams : URLSearchParams = js.native
97
+ }
98
+
99
+ /**
100
+ * The URLSearchParams defines utility methods to work with the query string of a URL.
101
+ *
102
+ * An object implementing URLSearchParams can directly be used in a for...of structure, for example the following two lines are equivalent:
103
+ *
104
+ * MDN
105
+ */
106
+ @ js.native
107
+ @ JSGlobal
108
+ class URLSearchParams
109
+ extends js.Iterable [js.Tuple2 [String , String ]] {
110
+
111
+ /**
112
+ * Leading '?' characters are ignored.
113
+ *
114
+ * MDN
115
+ */
116
+ def this (init : String ) = this ()
117
+ def this (init : js.Array [String ]) = this ()
118
+ def this (init : js.Dictionary [String ]) = this ()
119
+
120
+ def append (name : String , value : String ): Unit = js.native
121
+
122
+ def delete (name : String ): Unit = js.native
123
+
124
+ def get (name : String ): js.UndefOr [String ] = js.native
125
+
126
+ def getAll (name : String ): Sequence [String ] = js.native
127
+
128
+ def has (name : String ): Boolean = js.native
129
+
130
+ def set (name : String , value : String ): Unit = js.native
131
+
132
+ def sort (): Unit = js.native
133
+
134
+ @ JSName (js.Symbol .iterator)
135
+ override def jsIterator (): js.Iterator [js.Tuple2 [String , String ]] = js.native
136
+
137
+ def entries (): js.Iterator [js.Tuple2 [String , String ]] = js.native
138
+
139
+ def keys (): js.Iterator [String ] = js.native
140
+
141
+ def values (): js.Iterator [String ] = js.native
142
+
143
+ def forEach (callback : js.Function2 [String , String , Unit ]): Unit = js.native
144
+
95
145
}
0 commit comments