Skip to content

Commit f92dacd

Browse files
committed
Fix URL type in Deno
1 parent 9606674 commit f92dacd

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

ext/url/lib.deno_url.d.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
/// <reference no-default-lib="true" />
66
/// <reference lib="esnext" />
77

8+
interface URLSearchParamsIterator<T>
9+
extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
10+
[Symbol.iterator](): URLSearchParamsIterator<T>;
11+
}
12+
813
/** @category URL */
914
interface URLSearchParams {
1015
/** Appends a specified key/value pair as a new search parameter.
@@ -102,7 +107,7 @@ interface URLSearchParams {
102107
* }
103108
* ```
104109
*/
105-
keys(): IterableIterator<string>;
110+
keys(): URLSearchParamsIterator<string>;
106111

107112
/** Returns an iterator allowing to go through all values contained
108113
* in this object.
@@ -114,7 +119,7 @@ interface URLSearchParams {
114119
* }
115120
* ```
116121
*/
117-
values(): IterableIterator<string>;
122+
values(): URLSearchParamsIterator<string>;
118123

119124
/** Returns an iterator allowing to go through all key/value
120125
* pairs contained in this object.
@@ -126,7 +131,7 @@ interface URLSearchParams {
126131
* }
127132
* ```
128133
*/
129-
entries(): IterableIterator<[string, string]>;
134+
entries(): URLSearchParamsIterator<[string, string]>;
130135

131136
/** Returns an iterator allowing to go through all key/value
132137
* pairs contained in this object.
@@ -138,7 +143,7 @@ interface URLSearchParams {
138143
* }
139144
* ```
140145
*/
141-
[Symbol.iterator](): IterableIterator<[string, string]>;
146+
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
142147

143148
/** Returns a query string suitable for use in a URL.
144149
*
@@ -154,14 +159,14 @@ interface URLSearchParams {
154159
* searchParams.size
155160
* ```
156161
*/
157-
size: number;
162+
readonly size: number;
158163
}
159164

160165
/** @category URL */
161166
declare var URLSearchParams: {
162167
readonly prototype: URLSearchParams;
163168
new (
164-
init?: Iterable<string[]> | Record<string, string> | string,
169+
init?: Iterable<string[]> | Record<string, string> | string | URLSearchParams,
165170
): URLSearchParams;
166171
};
167172

0 commit comments

Comments
 (0)