feat(react-native): add global URLSearchParams (#37615)

This commit is contained in:
C Lentfort
2019-08-19 21:59:40 +01:00
committed by Sheetal Nandi
parent 55458bae44
commit af99f6ea12
2 changed files with 23 additions and 0 deletions

View File

@@ -251,3 +251,24 @@ declare var XMLHttpRequestUpload: {
};
declare type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
/**
* Based on definitions of lib.dom and lib.dom.iteralbe
*/
declare class URLSearchParams {
constructor(init?: string[][] | Record<string, string> | string | URLSearchParams);
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string | null;
getAll(name: string): string[];
has(name: string): boolean;
set(name: string, value: string): void;
sort(): void;
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
[Symbol.iterator](): IterableIterator<[string, string]>;
entries(): IterableIterator<[string, string]>;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
}

View File

@@ -34,3 +34,5 @@ xmlRequest.addEventListener("load", (ev) => {
console.log(ev.loaded)
console.log(ev.total)
});
const test = new URLSearchParams();