Skip to content

Commit 0d7a8ff

Browse files
authored
🤖 Merge PR DefinitelyTyped#71089 [whatwg-url] Update types to v13.0.0 by @downace
Co-authored-by: Sergey Malchits <downace@users.noreply.github.com>
1 parent 0f16b43 commit 0d7a8ff

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

types/whatwg-url/index.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export type IPv6Address = [number, number, number, number, number, number, numbe
1818
export class URL {
1919
constructor(url: string, base?: string | URL);
2020

21+
static canParse(url: string, base?: string): boolean;
22+
2123
get href(): string;
2224
set href(V: string);
2325

@@ -67,11 +69,12 @@ export class URLSearchParams {
6769
| string,
6870
);
6971

72+
get size(): number;
7073
append(name: string, value: string): void;
71-
delete(name: string): void;
74+
delete(name: string, value?: string): void;
7275
get(name: string): string | null;
7376
getAll(name: string): string[];
74-
has(name: string): boolean;
77+
has(name: string, value?: string): boolean;
7578
set(name: string, value: string): void;
7679
sort(): void;
7780

types/whatwg-url/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/whatwg-url",
4-
"version": "11.0.9999",
4+
"version": "13.0.9999",
55
"projects": [
66
"https://github.com/jsdom/whatwg-url#readme"
77
],

types/whatwg-url/test/whatwg-url.index.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ new whatwgUrl.URL("http://example.com");
1616
// $ExpectType URL
1717
new whatwgUrl.URL("foo", "http://example.com");
1818

19+
// $ExpectType boolean
20+
whatwgUrl.URL.canParse("http://example.com");
21+
22+
// $ExpectType boolean
23+
whatwgUrl.URL.canParse("foo", "http://example.com");
24+
1925
// $ExpectType URLRecord | null
2026
const urlRecord = whatwgUrl.parseURL("http://example.com");
2127

@@ -119,6 +125,7 @@ searchParams.forEach(function(value, name, self) {
119125
self; // $ExpectType URLSearchParams
120126
}, null);
121127

128+
searchParams.size; // $ExpectType number
122129
searchParams.keys(); // $ExpectType IterableIterator<string>
123130
searchParams.values(); // $ExpectType IterableIterator<string>
124131
searchParams.entries(); // $ExpectType IterableIterator<[name: string, value: string]>

0 commit comments

Comments
 (0)