mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 13:44:47 +00:00
chore: split web op crate (#9635)
This commit starts splitting out the deno_web op crate into multiple smaller crates. This commit splits out WebIDL and URL API, but in the future I want to split out each spec into its own crate. That means we will have (in rough order of loading): `webidl`, `dom`, `streams`, `console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and `webgpu` crates.
This commit is contained in:
parent
2f9d7c02dc
commit
e83ff62ccb
37 changed files with 785 additions and 1256 deletions
169
op_crates/web/lib.deno_web.d.ts
vendored
169
op_crates/web/lib.deno_web.d.ts
vendored
|
@ -313,172 +313,3 @@ declare var FileReader: {
|
|||
readonly EMPTY: number;
|
||||
readonly LOADING: number;
|
||||
};
|
||||
|
||||
declare class URLSearchParams {
|
||||
constructor(
|
||||
init?: string[][] | Record<string, string> | string | URLSearchParams,
|
||||
);
|
||||
static toString(): string;
|
||||
|
||||
/** Appends a specified key/value pair as a new search parameter.
|
||||
*
|
||||
* ```ts
|
||||
* let searchParams = new URLSearchParams();
|
||||
* searchParams.append('name', 'first');
|
||||
* searchParams.append('name', 'second');
|
||||
* ```
|
||||
*/
|
||||
append(name: string, value: string): void;
|
||||
|
||||
/** Deletes the given search parameter and its associated value,
|
||||
* from the list of all search parameters.
|
||||
*
|
||||
* ```ts
|
||||
* let searchParams = new URLSearchParams([['name', 'value']]);
|
||||
* searchParams.delete('name');
|
||||
* ```
|
||||
*/
|
||||
delete(name: string): void;
|
||||
|
||||
/** Returns all the values associated with a given search parameter
|
||||
* as an array.
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.getAll('name');
|
||||
* ```
|
||||
*/
|
||||
getAll(name: string): string[];
|
||||
|
||||
/** Returns the first value associated to the given search parameter.
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.get('name');
|
||||
* ```
|
||||
*/
|
||||
get(name: string): string | null;
|
||||
|
||||
/** Returns a Boolean that indicates whether a parameter with the
|
||||
* specified name exists.
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.has('name');
|
||||
* ```
|
||||
*/
|
||||
has(name: string): boolean;
|
||||
|
||||
/** Sets the value associated with a given search parameter to the
|
||||
* given value. If there were several matching values, this method
|
||||
* deletes the others. If the search parameter doesn't exist, this
|
||||
* method creates it.
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.set('name', 'value');
|
||||
* ```
|
||||
*/
|
||||
set(name: string, value: string): void;
|
||||
|
||||
/** Sort all key/value pairs contained in this object in place and
|
||||
* return undefined. The sort order is according to Unicode code
|
||||
* points of the keys.
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.sort();
|
||||
* ```
|
||||
*/
|
||||
sort(): void;
|
||||
|
||||
/** Calls a function for each element contained in this object in
|
||||
* place and return undefined. Optionally accepts an object to use
|
||||
* as this when executing callback as second argument.
|
||||
*
|
||||
* ```ts
|
||||
* const params = new URLSearchParams([["a", "b"], ["c", "d"]]);
|
||||
* params.forEach((value, key, parent) => {
|
||||
* console.log(value, key, parent);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
forEach(
|
||||
callbackfn: (value: string, key: string, parent: this) => void,
|
||||
thisArg?: any,
|
||||
): void;
|
||||
|
||||
/** Returns an iterator allowing to go through all keys contained
|
||||
* in this object.
|
||||
*
|
||||
* ```ts
|
||||
* const params = new URLSearchParams([["a", "b"], ["c", "d"]]);
|
||||
* for (const key of params.keys()) {
|
||||
* console.log(key);
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
keys(): IterableIterator<string>;
|
||||
|
||||
/** Returns an iterator allowing to go through all values contained
|
||||
* in this object.
|
||||
*
|
||||
* ```ts
|
||||
* const params = new URLSearchParams([["a", "b"], ["c", "d"]]);
|
||||
* for (const value of params.values()) {
|
||||
* console.log(value);
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
values(): IterableIterator<string>;
|
||||
|
||||
/** Returns an iterator allowing to go through all key/value
|
||||
* pairs contained in this object.
|
||||
*
|
||||
* ```ts
|
||||
* const params = new URLSearchParams([["a", "b"], ["c", "d"]]);
|
||||
* for (const [key, value] of params.entries()) {
|
||||
* console.log(key, value);
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
|
||||
/** Returns an iterator allowing to go through all key/value
|
||||
* pairs contained in this object.
|
||||
*
|
||||
* ```ts
|
||||
* const params = new URLSearchParams([["a", "b"], ["c", "d"]]);
|
||||
* for (const [key, value] of params) {
|
||||
* console.log(key, value);
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
|
||||
/** Returns a query string suitable for use in a URL.
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.toString();
|
||||
* ```
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/** The URL interface represents an object providing static methods used for creating object URLs. */
|
||||
declare class URL {
|
||||
constructor(url: string, base?: string | URL);
|
||||
createObjectURL(object: any): string;
|
||||
revokeObjectURL(url: string): void;
|
||||
|
||||
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;
|
||||
username: string;
|
||||
toJSON(): string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue