summaryrefslogtreecommitdiff
path: root/js/dom_types.ts
diff options
context:
space:
mode:
authorztplz <mysticzt@gmail.com>2018-10-20 00:12:36 +0800
committerRyan Dahl <ry@tinyclouds.org>2018-10-19 12:12:36 -0400
commit7210e7b33b84382d4f418ab1be37fea85c2e1422 (patch)
treef7dcb6d486d3b451fc12c3357ff2e48e4dde3ab0 /js/dom_types.ts
parent198fa31ec150b069dca39b94b2049d3ff65213e9 (diff)
Make fetch header compliant with the current spec (#1019)
Diffstat (limited to 'js/dom_types.ts')
-rw-r--r--js/dom_types.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/dom_types.ts b/js/dom_types.ts
index 47af2b17c..71881773d 100644
--- a/js/dom_types.ts
+++ b/js/dom_types.ts
@@ -296,6 +296,11 @@ export interface Headers {
append(name: string, value: string): void;
/** Deletes a header from a `Headers` object. */
delete(name: string): void;
+ /** Returns an iterator allowing to go through all key/value pairs
+ * contained in this Headers object. The both the key and value of each pairs
+ * are ByteString objects.
+ */
+ entries(): IterableIterator<[string, string]>;
/** Returns a `ByteString` sequence of all the values of a header within a
* `Headers` object with a given name.
*/
@@ -304,15 +309,27 @@ export interface Headers {
* header.
*/
has(name: string): boolean;
+ /** Returns an iterator allowing to go through all keys contained in
+ * this Headers object. The keys are ByteString objects.
+ */
+ keys(): IterableIterator<string>;
/** Sets a new value for an existing header inside a Headers object, or adds
* the header if it does not already exist.
*/
set(name: string, value: string): void;
+ /** Returns an iterator allowing to go through all values contained in
+ * this Headers object. The values are ByteString objects.
+ */
+ values(): IterableIterator<string>;
forEach(
callbackfn: (value: string, key: string, parent: Headers) => void,
// tslint:disable-next-line:no-any
thisArg?: any
): void;
+ /** The Symbol.iterator well-known symbol specifies the default
+ * iterator for this Headers object
+ */
+ [Symbol.iterator](): IterableIterator<[string, string]>;
}
type RequestCache =