1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

Remove __url namespace (#4668)

This commit is contained in:
Ryan Dahl 2020-04-07 17:11:38 -04:00 committed by GitHub
parent 6660fb25c9
commit f07fcfcc80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,8 +21,6 @@ declare interface WindowOrWorkerGlobalScope {
CustomEvent: typeof __customEvent.CustomEvent;
Event: typeof __event.Event;
EventTarget: typeof __eventTarget.EventTarget;
URL: typeof __url.URL;
URLSearchParams: typeof __urlSearchParams.URLSearchParams;
Headers: __domTypes.HeadersConstructor;
FormData: __domTypes.FormDataConstructor;
ReadableStream: __domTypes.ReadableStreamConstructor;
@ -242,8 +240,6 @@ declare const EventInit: typeof __event.EventInit;
declare const Event: typeof __event.Event;
declare const EventListener: __domTypes.EventListener;
declare const EventTarget: typeof __eventTarget.EventTarget;
declare const URL: typeof __url.URL;
declare const URLSearchParams: typeof __urlSearchParams.URLSearchParams;
declare const Headers: __domTypes.HeadersConstructor;
declare const location: __domTypes.Location;
declare const FormData: __domTypes.FormDataConstructor;
@ -272,8 +268,6 @@ declare type EventInit = __domTypes.EventInit;
declare type Event = __domTypes.Event;
declare type EventListener = __domTypes.EventListener;
declare type EventTarget = __domTypes.EventTarget;
declare type URL = __url.URL;
declare type URLSearchParams = __domTypes.URLSearchParams;
declare type Headers = __domTypes.Headers;
declare type FormData = __domTypes.FormData;
declare type ReadableStream<R = any> = __domTypes.ReadableStream<R>;
@ -1346,7 +1340,7 @@ declare namespace __fetch {
}
/** Fetch a resource from the network. */
export function fetch(
input: __domTypes.Request | __url.URL | string,
input: __domTypes.Request | URL | string,
init?: __domTypes.RequestInit
): Promise<Response>;
}
@ -1384,9 +1378,7 @@ declare class TextEncoder {
readonly [Symbol.toStringTag]: string;
}
declare namespace __urlSearchParams {
export class URLSearchParams {
constructor(init?: string | string[][] | Record<string, string>);
interface URLSearchParams {
/** Appends a specified key/value pair as a new search parameter.
*
* searchParams.append('name', 'first');
@ -1482,33 +1474,39 @@ declare namespace __urlSearchParams {
*/
toString(): string;
}
}
declare namespace __url {
export interface URL {
declare const URLSearchParams: {
prototype: URLSearchParams;
new (
init?: string[][] | Record<string, string> | string | URLSearchParams
): URLSearchParams;
toString(): string;
};
/** The URL interface represents an object providing static methods used for creating object URLs. */
interface URL {
hash: string;
host: string;
hostname: string;
href: string;
toString(): string;
readonly origin: string;
password: string;
pathname: string;
port: string;
protocol: string;
search: string;
readonly searchParams: __urlSearchParams.URLSearchParams;
readonly searchParams: URLSearchParams;
username: string;
toString(): string;
toJSON(): string;
}
export const URL: {
declare const URL: {
prototype: URL;
new (url: string, base?: string | URL): URL;
createObjectURL(object: __domTypes.Blob): string;
createObjectURL(object: any): string;
revokeObjectURL(url: string): void;
};
}
declare class Worker {
onerror?: (e: Event) => void;