Skip to content

Add comments to URLSearchParams #168

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

Closed
wants to merge 2 commits into from
Closed
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
38 changes: 37 additions & 1 deletion baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10814,6 +10814,7 @@ interface URL {
protocol: string;
search: string;
username: string;
readonly searchparams: URLSearchParams;
toString(): string;
}

Expand Down Expand Up @@ -12722,6 +12723,41 @@ interface Canvas2DContextAttributes {
[attribute: string]: boolean | string | undefined;
}

interface URLSearchParams {
/**
* Appends a specified key/value pair as a new search parameter.
*/
append(name: string, value: string): void;
/**
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
*/
delete(name: string): void;
/**
* Returns the first value associated to the given search parameter.
*/
get(name: string): string | null;
/**
* Returns all the values association with a given search parameter.
*/
getAll(name: string): string[];
/**
* Returns a Boolean indicating if such a search parameter exists.
*/
has(name: string): boolean;
/**
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
*/
set(name: string, value: string): void;
}

declare var URLSearchParams: {
prototype: URLSearchParams;
/**
* Constructor returning a URLSearchParams object.
*/
new (init?: string | URLSearchParams): URLSearchParams;
}

interface NodeListOf<TNode extends Node> extends NodeList {
length: number;
item(index: number): TNode;
Expand Down Expand Up @@ -13727,4 +13763,4 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type MouseWheelEvent = WheelEvent;
type ScrollRestoration = "auto" | "manual";
type ScrollRestoration = "auto" | "manual";
41 changes: 41 additions & 0 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,47 @@
"name": "multiEntry",
"type": "boolean"
},
{
"kind": "interface",
"name": "URLSearchParams",
"flavor": "Web",
"constructorSignatures": [
"/**\r\n * Constructor returning a URLSearchParams object.\r\n */\r\n new (init?: string | URLSearchParams): URLSearchParams"
],
"methods": [
{
"name": "append",
"signatures": ["/**\r\n * Appends a specified key/value pair as a new search parameter.\r\n */\r\n append(name: string, value: string): void"]
},
{
"name": "delete",
"signatures": ["/**\r\n * Deletes the given search parameter, and its associated value, from the list of all search parameters.\r\n */\r\n delete(name: string): void"]
},
{
"name": "get",
"signatures": ["/**\r\n * Returns the first value associated to the given search parameter.\r\n */\r\n get(name: string): string | null"]
},
{
"name": "getAll",
"signatures": ["/**\r\n * Returns all the values association with a given search parameter.\r\n */\r\n getAll(name: string): string[]"]
},
{
"name": "has",
"signatures": ["/**\r\n * Returns a Boolean indicating if such a search parameter exists.\r\n */\r\n has(name: string): boolean"]
},
{
"name": "set",
"signatures": ["/**\r\n * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\r\n */\r\n set(name: string, value: string): void"]
}
]
},
{
"kind": "property",
"interface": "URL",
"name": "searchparams",
"readonly": true,
"type": "URLSearchParams"
},
{
"kind": "property",
"interface": "Window",
Expand Down