Skip to content

Commit 2939d4f

Browse files
petamorikensaschanaz
andauthoredJul 3, 2024
Update the URL.canParse and URL.parse types (microsoft#1755)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 86b6edc commit 2939d4f

6 files changed

+38
-10
lines changed
 

Diff for: ‎baselines/audioworklet.generated.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1016,9 +1016,9 @@ declare var URL: {
10161016
prototype: URL;
10171017
new(url: string | URL, base?: string | URL): URL;
10181018
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
1019-
canParse(url: string | URL, base?: string): boolean;
1019+
canParse(url: string | URL, base?: string | URL): boolean;
10201020
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
1021-
parse(url: string | URL, base?: string): URL | null;
1021+
parse(url: string | URL, base?: string | URL): URL | null;
10221022
};
10231023

10241024
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */

Diff for: ‎baselines/dom.generated.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22356,11 +22356,11 @@ declare var URL: {
2235622356
prototype: URL;
2235722357
new(url: string | URL, base?: string | URL): URL;
2235822358
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
22359-
canParse(url: string | URL, base?: string): boolean;
22359+
canParse(url: string | URL, base?: string | URL): boolean;
2236022360
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
2236122361
createObjectURL(obj: Blob | MediaSource): string;
2236222362
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
22363-
parse(url: string | URL, base?: string): URL | null;
22363+
parse(url: string | URL, base?: string | URL): URL | null;
2236422364
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
2236522365
revokeObjectURL(url: string): void;
2236622366
};

Diff for: ‎baselines/serviceworker.generated.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5265,9 +5265,9 @@ declare var URL: {
52655265
prototype: URL;
52665266
new(url: string | URL, base?: string | URL): URL;
52675267
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
5268-
canParse(url: string | URL, base?: string): boolean;
5268+
canParse(url: string | URL, base?: string | URL): boolean;
52695269
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
5270-
parse(url: string | URL, base?: string): URL | null;
5270+
parse(url: string | URL, base?: string | URL): URL | null;
52715271
};
52725272

52735273
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */

Diff for: ‎baselines/sharedworker.generated.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5074,11 +5074,11 @@ declare var URL: {
50745074
prototype: URL;
50755075
new(url: string | URL, base?: string | URL): URL;
50765076
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
5077-
canParse(url: string | URL, base?: string): boolean;
5077+
canParse(url: string | URL, base?: string | URL): boolean;
50785078
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
50795079
createObjectURL(obj: Blob): string;
50805080
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
5081-
parse(url: string | URL, base?: string): URL | null;
5081+
parse(url: string | URL, base?: string | URL): URL | null;
50825082
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
50835083
revokeObjectURL(url: string): void;
50845084
};

Diff for: ‎baselines/webworker.generated.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5644,11 +5644,11 @@ declare var URL: {
56445644
prototype: URL;
56455645
new(url: string | URL, base?: string | URL): URL;
56465646
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
5647-
canParse(url: string | URL, base?: string): boolean;
5647+
canParse(url: string | URL, base?: string | URL): boolean;
56485648
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
56495649
createObjectURL(obj: Blob): string;
56505650
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
5651-
parse(url: string | URL, base?: string): URL | null;
5651+
parse(url: string | URL, base?: string | URL): URL | null;
56525652
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
56535653
revokeObjectURL(url: string): void;
56545654
};

Diff for: ‎inputfiles/overridingTypes.jsonc

+28
Original file line numberDiff line numberDiff line change
@@ -2061,6 +2061,34 @@
20612061
]
20622062
}
20632063
}
2064+
},
2065+
"methods": {
2066+
"method": {
2067+
"canParse": {
2068+
"signature": {
2069+
"0": {
2070+
"param": [
2071+
{
2072+
"name": "base",
2073+
"additionalTypes": ["URL"]
2074+
}
2075+
]
2076+
}
2077+
}
2078+
},
2079+
"parse": {
2080+
"signature": {
2081+
"0": {
2082+
"param": [
2083+
{
2084+
"name": "base",
2085+
"additionalTypes": ["URL"]
2086+
}
2087+
]
2088+
}
2089+
}
2090+
}
2091+
}
20642092
}
20652093
},
20662094
"Client": {

0 commit comments

Comments
 (0)