mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
feat(react-native): add global URLSearchParams (#37615)
This commit is contained in:
committed by
Sheetal Nandi
parent
55458bae44
commit
af99f6ea12
21
types/react-native/globals.d.ts
vendored
21
types/react-native/globals.d.ts
vendored
@@ -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>;
|
||||
}
|
||||
|
||||
@@ -34,3 +34,5 @@ xmlRequest.addEventListener("load", (ev) => {
|
||||
console.log(ev.loaded)
|
||||
console.log(ev.total)
|
||||
});
|
||||
|
||||
const test = new URLSearchParams();
|
||||
|
||||
Reference in New Issue
Block a user