Skip to content

Restore URLPattern from BCD 6.0.24 #2065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,39 @@ interface ULongRange {
min?: number;
}

interface URLPatternComponentResult {
groups?: Record<string, string | undefined>;
input?: string;
}

interface URLPatternInit {
baseURL?: string;
hash?: string;
hostname?: string;
password?: string;
pathname?: string;
port?: string;
protocol?: string;
search?: string;
username?: string;
}

interface URLPatternOptions {
ignoreCase?: boolean;
}

interface URLPatternResult {
hash?: URLPatternComponentResult;
hostname?: URLPatternComponentResult;
inputs?: URLPatternInput[];
password?: URLPatternComponentResult;
pathname?: URLPatternComponentResult;
port?: URLPatternComponentResult;
protocol?: URLPatternComponentResult;
search?: URLPatternComponentResult;
username?: URLPatternComponentResult;
}

interface UnderlyingByteSource {
autoAllocateChunkSize?: number;
cancel?: UnderlyingSourceCancelCallback;
Expand Down Expand Up @@ -32994,6 +33027,81 @@ declare var URL: {
type webkitURL = URL;
declare var webkitURL: typeof URL;

/**
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
*/
interface URLPattern {
readonly hasRegExpGroups: boolean;
/**
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
*/
readonly hash: string;
/**
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
*/
readonly hostname: string;
/**
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
*/
readonly password: string;
/**
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
*/
readonly pathname: string;
/**
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
*/
readonly port: string;
/**
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
*/
readonly protocol: string;
/**
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
*/
readonly search: string;
/**
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
*/
readonly username: string;
/**
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or `null` if the URL does not match the pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
*/
exec(input?: URLPatternInput, baseURL?: string | URL): URLPatternResult | null;
/**
* The **`test()`** method of the URLPattern interface takes a URL or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
*/
test(input?: URLPatternInput, baseURL?: string | URL): boolean;
}

declare var URLPattern: {
prototype: URLPattern;
new(input: URLPatternInput, baseURL: string | URL, options?: URLPatternOptions): URLPattern;
new(input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
};

/**
* The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL.
*
Expand Down Expand Up @@ -39472,6 +39580,7 @@ type RequestInfo = Request | string;
type TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas | VideoFrame;
type TimerHandler = string | Function;
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | MediaSourceHandle | ReadableStream | WritableStream | TransformStream | AudioData | VideoFrame | RTCDataChannel | ArrayBuffer;
type URLPatternInput = string | URLPatternInit;
type Uint32List = Uint32Array<ArrayBufferLike> | GLuint[];
type VibratePattern = number | number[];
type WindowProxy = Window;
Expand Down
109 changes: 109 additions & 0 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,39 @@ interface Transformer<I = any, O = any> {
writableType?: undefined;
}

interface URLPatternComponentResult {
groups?: Record<string, string | undefined>;
input?: string;
}

interface URLPatternInit {
baseURL?: string;
hash?: string;
hostname?: string;
password?: string;
pathname?: string;
port?: string;
protocol?: string;
search?: string;
username?: string;
}

interface URLPatternOptions {
ignoreCase?: boolean;
}

interface URLPatternResult {
hash?: URLPatternComponentResult;
hostname?: URLPatternComponentResult;
inputs?: URLPatternInput[];
password?: URLPatternComponentResult;
pathname?: URLPatternComponentResult;
port?: URLPatternComponentResult;
protocol?: URLPatternComponentResult;
search?: URLPatternComponentResult;
username?: URLPatternComponentResult;
}

interface UnderlyingByteSource {
autoAllocateChunkSize?: number;
cancel?: UnderlyingSourceCancelCallback;
Expand Down Expand Up @@ -7663,6 +7696,81 @@ declare var URL: {
parse(url: string | URL, base?: string | URL): URL | null;
};

/**
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
*/
interface URLPattern {
readonly hasRegExpGroups: boolean;
/**
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
*/
readonly hash: string;
/**
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
*/
readonly hostname: string;
/**
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
*/
readonly password: string;
/**
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
*/
readonly pathname: string;
/**
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
*/
readonly port: string;
/**
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
*/
readonly protocol: string;
/**
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
*/
readonly search: string;
/**
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
*/
readonly username: string;
/**
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or `null` if the URL does not match the pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
*/
exec(input?: URLPatternInput, baseURL?: string | URL): URLPatternResult | null;
/**
* The **`test()`** method of the URLPattern interface takes a URL or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
*/
test(input?: URLPatternInput, baseURL?: string | URL): boolean;
}

declare var URLPattern: {
prototype: URLPattern;
new(input: URLPatternInput, baseURL: string | URL, options?: URLPatternOptions): URLPattern;
new(input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
};

/**
* The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL.
*
Expand Down Expand Up @@ -11378,6 +11486,7 @@ type RequestInfo = Request | string;
type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;
type TimerHandler = string | Function;
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer;
type URLPatternInput = string | URLPatternInit;
type Uint32List = Uint32Array<ArrayBufferLike> | GLuint[];
type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string;
type BinaryType = "arraybuffer" | "blob";
Expand Down
109 changes: 109 additions & 0 deletions baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,39 @@ interface Transformer<I = any, O = any> {
writableType?: undefined;
}

interface URLPatternComponentResult {
groups?: Record<string, string | undefined>;
input?: string;
}

interface URLPatternInit {
baseURL?: string;
hash?: string;
hostname?: string;
password?: string;
pathname?: string;
port?: string;
protocol?: string;
search?: string;
username?: string;
}

interface URLPatternOptions {
ignoreCase?: boolean;
}

interface URLPatternResult {
hash?: URLPatternComponentResult;
hostname?: URLPatternComponentResult;
inputs?: URLPatternInput[];
password?: URLPatternComponentResult;
pathname?: URLPatternComponentResult;
port?: URLPatternComponentResult;
protocol?: URLPatternComponentResult;
search?: URLPatternComponentResult;
username?: URLPatternComponentResult;
}

interface UnderlyingByteSource {
autoAllocateChunkSize?: number;
cancel?: UnderlyingSourceCancelCallback;
Expand Down Expand Up @@ -7206,6 +7239,81 @@ declare var URL: {
revokeObjectURL(url: string): void;
};

/**
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
*/
interface URLPattern {
readonly hasRegExpGroups: boolean;
/**
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
*/
readonly hash: string;
/**
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
*/
readonly hostname: string;
/**
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
*/
readonly password: string;
/**
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
*/
readonly pathname: string;
/**
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
*/
readonly port: string;
/**
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
*/
readonly protocol: string;
/**
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
*/
readonly search: string;
/**
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
*/
readonly username: string;
/**
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or `null` if the URL does not match the pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
*/
exec(input?: URLPatternInput, baseURL?: string | URL): URLPatternResult | null;
/**
* The **`test()`** method of the URLPattern interface takes a URL or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
*/
test(input?: URLPatternInput, baseURL?: string | URL): boolean;
}

declare var URLPattern: {
prototype: URLPattern;
new(input: URLPatternInput, baseURL: string | URL, options?: URLPatternOptions): URLPattern;
new(input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
};

/**
* The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL.
*
Expand Down Expand Up @@ -11066,6 +11174,7 @@ type RequestInfo = Request | string;
type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;
type TimerHandler = string | Function;
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer;
type URLPatternInput = string | URLPatternInit;
type Uint32List = Uint32Array<ArrayBufferLike> | GLuint[];
type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string;
type BinaryType = "arraybuffer" | "blob";
Expand Down
Loading