From e97764e7ecfea960987b63a550fb45bc3d2171da Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Mon, 5 Aug 2024 07:21:57 -0700 Subject: [PATCH] fix(urlpattern): correct typings for added APIs (#24881) --- ext/url/lib.deno_url.d.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ext/url/lib.deno_url.d.ts b/ext/url/lib.deno_url.d.ts index ca5b00e607..71a781636a 100644 --- a/ext/url/lib.deno_url.d.ts +++ b/ext/url/lib.deno_url.d.ts @@ -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; };