1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00

fix(urlpattern): correct typings for added APIs (#24881)

This commit is contained in:
Leo Kettmeir 2024-08-05 07:21:57 -07:00 committed by GitHub
parent 27ea23ea69
commit e97764e7ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -249,6 +249,20 @@ declare interface URLPatternResult {
hash: URLPatternComponentResult;
}
/**
* Options for the {@linkcode URLPattern} constructor.
*
* @category URL
*/
declare interface URLPatternOptions {
/**
* Enables case-insensitive matching.
*
* @default {false}
*/
ignoreCase: boolean;
}
/**
* The URLPattern API provides a web platform primitive for matching URLs based
* on a convenient pattern syntax.
@ -343,6 +357,9 @@ declare interface URLPattern {
readonly search: string;
/** The pattern string for the `hash`. */
readonly hash: string;
/** Whether or not any of the specified groups use regexp groups. */
readonly hasRegExpGroups: boolean;
}
/**
@ -377,5 +394,10 @@ declare interface URLPattern {
*/
declare var URLPattern: {
readonly prototype: URLPattern;
new (input: URLPatternInput, baseURL?: string): URLPattern;
new (
input: URLPatternInput,
baseURL: string,
options?: URLPatternOptions,
): URLPattern;
new (input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
};