0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -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; CustomEvent: typeof __customEvent.CustomEvent;
Event: typeof __event.Event; Event: typeof __event.Event;
EventTarget: typeof __eventTarget.EventTarget; EventTarget: typeof __eventTarget.EventTarget;
URL: typeof __url.URL;
URLSearchParams: typeof __urlSearchParams.URLSearchParams;
Headers: __domTypes.HeadersConstructor; Headers: __domTypes.HeadersConstructor;
FormData: __domTypes.FormDataConstructor; FormData: __domTypes.FormDataConstructor;
ReadableStream: __domTypes.ReadableStreamConstructor; ReadableStream: __domTypes.ReadableStreamConstructor;
@ -242,8 +240,6 @@ declare const EventInit: typeof __event.EventInit;
declare const Event: typeof __event.Event; declare const Event: typeof __event.Event;
declare const EventListener: __domTypes.EventListener; declare const EventListener: __domTypes.EventListener;
declare const EventTarget: typeof __eventTarget.EventTarget; 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 Headers: __domTypes.HeadersConstructor;
declare const location: __domTypes.Location; declare const location: __domTypes.Location;
declare const FormData: __domTypes.FormDataConstructor; declare const FormData: __domTypes.FormDataConstructor;
@ -272,8 +268,6 @@ declare type EventInit = __domTypes.EventInit;
declare type Event = __domTypes.Event; declare type Event = __domTypes.Event;
declare type EventListener = __domTypes.EventListener; declare type EventListener = __domTypes.EventListener;
declare type EventTarget = __domTypes.EventTarget; declare type EventTarget = __domTypes.EventTarget;
declare type URL = __url.URL;
declare type URLSearchParams = __domTypes.URLSearchParams;
declare type Headers = __domTypes.Headers; declare type Headers = __domTypes.Headers;
declare type FormData = __domTypes.FormData; declare type FormData = __domTypes.FormData;
declare type ReadableStream<R = any> = __domTypes.ReadableStream<R>; declare type ReadableStream<R = any> = __domTypes.ReadableStream<R>;
@ -1346,7 +1340,7 @@ declare namespace __fetch {
} }
/** Fetch a resource from the network. */ /** Fetch a resource from the network. */
export function fetch( export function fetch(
input: __domTypes.Request | __url.URL | string, input: __domTypes.Request | URL | string,
init?: __domTypes.RequestInit init?: __domTypes.RequestInit
): Promise<Response>; ): Promise<Response>;
} }
@ -1384,132 +1378,136 @@ declare class TextEncoder {
readonly [Symbol.toStringTag]: string; readonly [Symbol.toStringTag]: string;
} }
declare namespace __urlSearchParams { interface URLSearchParams {
export class URLSearchParams { /** Appends a specified key/value pair as a new search parameter.
constructor(init?: string | string[][] | Record<string, string>); *
/** Appends a specified key/value pair as a new search parameter. * searchParams.append('name', 'first');
* * searchParams.append('name', 'second');
* searchParams.append('name', 'first'); */
* searchParams.append('name', 'second'); append(name: string, value: string): void;
*/ /** Deletes the given search parameter and its associated value,
append(name: string, value: string): void; * from the list of all search parameters.
/** Deletes the given search parameter and its associated value, *
* from the list of all search parameters. * searchParams.delete('name');
* */
* searchParams.delete('name'); delete(name: string): void;
*/ /** Returns all the values associated with a given search parameter
delete(name: string): void; * as an array.
/** Returns all the values associated with a given search parameter *
* as an array. * searchParams.getAll('name');
* */
* searchParams.getAll('name'); getAll(name: string): string[];
*/ /** Returns the first value associated to the given search parameter.
getAll(name: string): string[]; *
/** Returns the first value associated to the given search parameter. * searchParams.get('name');
* */
* searchParams.get('name'); get(name: string): string | null;
*/ /** Returns a Boolean that indicates whether a parameter with the
get(name: string): string | null; * specified name exists.
/** Returns a Boolean that indicates whether a parameter with the *
* specified name exists. * searchParams.has('name');
* */
* searchParams.has('name'); has(name: string): boolean;
*/ /** Sets the value associated with a given search parameter to the
has(name: string): boolean; * given value. If there were several matching values, this method
/** Sets the value associated with a given search parameter to the * deletes the others. If the search parameter doesn't exist, this
* given value. If there were several matching values, this method * method creates it.
* deletes the others. If the search parameter doesn't exist, this *
* method creates it. * searchParams.set('name', 'value');
* */
* searchParams.set('name', 'value'); set(name: string, value: string): void;
*/ /** Sort all key/value pairs contained in this object in place and
set(name: string, value: string): void; * return undefined. The sort order is according to Unicode code
/** Sort all key/value pairs contained in this object in place and * points of the keys.
* return undefined. The sort order is according to Unicode code *
* points of the keys. * searchParams.sort();
* */
* searchParams.sort(); sort(): void;
*/ /** Calls a function for each element contained in this object in
sort(): void; * place and return undefined. Optionally accepts an object to use
/** Calls a function for each element contained in this object in * as this when executing callback as second argument.
* place and return undefined. Optionally accepts an object to use *
* as this when executing callback as second argument. * searchParams.forEach((value, key, parent) => {
* * console.log(value, key, parent);
* searchParams.forEach((value, key, parent) => { * });
* console.log(value, key, parent); *
* }); */
* forEach(
*/ callbackfn: (value: string, key: string, parent: this) => void,
forEach( thisArg?: any
callbackfn: (value: string, key: string, parent: this) => void, ): void;
thisArg?: any /** Returns an iterator allowing to go through all keys contained
): void; * in this object.
/** Returns an iterator allowing to go through all keys contained *
* in this object. * for (const key of searchParams.keys()) {
* * console.log(key);
* for (const key of searchParams.keys()) { * }
* console.log(key); */
* } keys(): IterableIterator<string>;
*/ /** Returns an iterator allowing to go through all values contained
keys(): IterableIterator<string>; * in this object.
/** Returns an iterator allowing to go through all values contained *
* in this object. * for (const value of searchParams.values()) {
* * console.log(value);
* for (const value of searchParams.values()) { * }
* console.log(value); */
* } values(): IterableIterator<string>;
*/ /** Returns an iterator allowing to go through all key/value
values(): IterableIterator<string>; * pairs contained in this object.
/** Returns an iterator allowing to go through all key/value *
* pairs contained in this object. * for (const [key, value] of searchParams.entries()) {
* * console.log(key, value);
* for (const [key, value] of searchParams.entries()) { * }
* console.log(key, value); */
* } entries(): IterableIterator<[string, string]>;
*/ /** Returns an iterator allowing to go through all key/value
entries(): IterableIterator<[string, string]>; * pairs contained in this object.
/** Returns an iterator allowing to go through all key/value *
* pairs contained in this object. * for (const [key, value] of searchParams[Symbol.iterator]()) {
* * console.log(key, value);
* for (const [key, value] of searchParams[Symbol.iterator]()) { * }
* console.log(key, value); */
* } [Symbol.iterator](): IterableIterator<[string, string]>;
*/ /** Returns a query string suitable for use in a URL.
[Symbol.iterator](): IterableIterator<[string, string]>; *
/** Returns a query string suitable for use in a URL. * searchParams.toString();
* */
* searchParams.toString(); toString(): string;
*/
toString(): string;
}
} }
declare namespace __url { declare const URLSearchParams: {
export interface URL { prototype: URLSearchParams;
hash: string; new (
host: string; init?: string[][] | Record<string, string> | string | URLSearchParams
hostname: string; ): URLSearchParams;
href: string; toString(): string;
readonly origin: string; };
password: string;
pathname: string;
port: string;
protocol: string;
search: string;
readonly searchParams: __urlSearchParams.URLSearchParams;
username: string;
toString(): string;
toJSON(): string;
}
export const URL: { /** The URL interface represents an object providing static methods used for creating object URLs. */
prototype: URL; interface URL {
new (url: string, base?: string | URL): URL; hash: string;
createObjectURL(object: __domTypes.Blob): string; host: string;
revokeObjectURL(url: string): void; hostname: string;
}; href: string;
toString(): string;
readonly origin: string;
password: string;
pathname: string;
port: string;
protocol: string;
search: string;
readonly searchParams: URLSearchParams;
username: string;
toJSON(): string;
} }
declare const URL: {
prototype: URL;
new (url: string, base?: string | URL): URL;
createObjectURL(object: any): string;
revokeObjectURL(url: string): void;
};
declare class Worker { declare class Worker {
onerror?: (e: Event) => void; onerror?: (e: Event) => void;
onmessage?: (data: any) => void; onmessage?: (data: any) => void;