//#region js/URL.d.ts /** * A self-contained implementation of the WHATWG URL Standard * (https://url.spec.whatwg.org/) for `URL` and `URLSearchParams`. * * This implementation intentionally omits Unicode/IDNA host processing * (punycode encoding, hostname mapping and normalization such as fullwidth * characters) to keep the bundle size small. Non-ASCII hostnames are passed * through as-is instead of being converted with IDNA's domain-to-ASCII. * Everything else follows the specification, including the basic URL parser * state machine, IPv4/IPv6 parsing, percent-encoding sets, and the * application/x-www-form-urlencoded format. * * The source is TypeScript restricted to erasable syntax (type annotations * only, no enums or namespaces), so it can be executed directly by Node.js * via type stripping. The published package ships the compiled JavaScript. */ type URLSearchParamsInit = string | URLSearchParams | Iterable | ReadonlyArray | Record; declare class URLSearchParams { constructor(init?: URLSearchParamsInit | null); get size(): number; append(name: string, value: string): void; delete(name: string, value?: string): void; get(name: string): string | null; getAll(name: string): string[]; has(name: string, value?: string): boolean; set(name: string, value: string): void; sort(): void; forEach(callback: (value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: unknown): void; keys(): IterableIterator; values(): IterableIterator; entries(): IterableIterator<[string, string]>; [Symbol.iterator](): IterableIterator<[string, string]>; toString(): string; } interface URLSearchParams { readonly [Symbol.toStringTag]: 'URLSearchParams'; } /** * The shape of React Native's `Blob`, which carries a reference to * natively-stored data rather than the bytes themselves. */ interface BlobLike { data: { blobId: string; offset: number; }; size: number; } declare class URL { constructor(url: string | URL, base?: string | URL); static parse(url: string | URL, base?: string | URL): URL | null; static canParse(url: string | URL, base?: string | URL): boolean; static createObjectURL(blob: BlobLike): string; static revokeObjectURL(url: string): void; get href(): string; set href(value: string); get origin(): string; get protocol(): string; set protocol(value: string); get username(): string; set username(value: string); get password(): string; set password(value: string); get host(): string; set host(value: string); get hostname(): string; set hostname(value: string); get port(): string; set port(value: string); get pathname(): string; set pathname(value: string); get search(): string; set search(value: string); get searchParams(): URLSearchParams; get hash(): string; set hash(value: string); toString(): string; toJSON(): string; } interface URL { readonly [Symbol.toStringTag]: 'URL'; } //#endregion export { URL, URLSearchParams };