Skip to content
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

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

Merged
merged 5 commits into from
Aug 5, 2024
Merged
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
24 changes: 23 additions & 1 deletion ext/url/lib.deno_url.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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;
};