-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
What's the correct way to get URLSearchParams into my project? #12517
Comments
As indicated in the template, this is not a support forum. Please ask questions on Stack Overflow or similar sites. |
This is not a question or support request. I'm looking for an implementation of |
I don't understand what about that isn't a question. Are you saying there's a bug in TypeScript? |
declare class URLSearchParams {
/** Constructor returning a URLSearchParams object. */
constructor(init?: string| 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 an iterator allowing to go through all key/value pairs contained in this object. */
entries(): IterableIterator<[string, string]>;
/** Returns the first value associated to the given search parameter. */
get(name: string): string;
/** 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;
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
keys(): IterableIterator<string>;
/** 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;
/** Returns a string containg a query string suitable for use in a URL. */
toString(): string;
/** Returns an iterator allowing to go through all values of the key/ value pairs contained in this object. */
values(): IterableIterator<string>;
/** Iterator */
[Symbol.iterator](): IterableIterator<number>;
} |
Should be fixed by microsoft/TypeScript-DOM-lib-generator#167 |
@mhegazy This doesn't seem to be fixed in 2.1.4. I see it has the 2.2 milestone now. Is it available in nightly? |
The fix is checked in the lib repo and needs to be ported in. We do them in patches; once it is in the nightly we will close the issue. |
Thanks for the explanation. |
Yay! |
I have some code where I'd like to be able to build query strings. Unfortunately I can't seem to find a polyfill similar to what I'm currently doing with fetch.
Is there any correct way to get these newer standards into my typescript projects, along with any actual polyfill code to accompany my build?
The text was updated successfully, but these errors were encountered: