diff --git a/index.d.ts b/index.d.ts index 865098a..01883a4 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,33 +1,7 @@ -import type { - BodyInit, - Headers as BaseHeaders, - HeadersInit, - Request, - RequestInfo, - RequestInit, - Response, - ResponseInit, -} from "./lib.fetch" -import type { Headers as IterHeaders } from "./lib.fetch.iterable"; -type Headers = BaseHeaders & IterHeaders; - -export const fetch: (input: RequestInfo, init?: RequestInit) => Promise; - -export const Request: { - prototype: Request; - new(input: RequestInfo, init?: RequestInit): Request; -}; - -export const Response: { - prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; - error(): Response; - redirect(url: string, status?: number): Response; -}; - -export const Headers: { - prototype: Headers; - new(init?: HeadersInit): Headers; -}; +import * as libFetch from "./lib.fetch"; +export const fetch: typeof libFetch.fetch; +export const Request: typeof libFetch.Request; +export const Response: typeof libFetch.Response; +export const Headers: typeof libFetch.Headers; export default fetch; diff --git a/lib.fetch.d.ts b/lib.fetch.d.ts index b3d8325..6278e10 100644 --- a/lib.fetch.d.ts +++ b/lib.fetch.d.ts @@ -1,59 +1,75 @@ -// Generated by resolving typescript/lib/lib.dom.d.ts from typescript@4.2.3 -export interface RequestInit { +export declare function fetch(input: RequestInfo, init?: RequestInit): Promise; + +/** This Fetch API interface represents a resource request. */ +export interface Request extends Body { /** - * A BodyInit object or null to set request's body. + * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */ - body?: BodyInit | null; + readonly cache: RequestCache; /** - * A string indicating how the request will interact with the browser's cache to set request's cache. + * Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. */ - cache?: RequestCache; + readonly credentials: RequestCredentials; /** - * A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. + * Returns the kind of resource requested by request, e.g., "document" or "script". */ - credentials?: RequestCredentials; + readonly destination: RequestDestination; /** - * A Headers object, an object literal, or an array of two-item arrays to set request's headers. + * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header. */ - headers?: HeadersInit; + readonly headers: Headers; /** - * A cryptographic hash of the resource to be fetched by request. Sets request's integrity. + * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */ - integrity?: string; + readonly integrity: string; /** - * A boolean to set request's keepalive. + * Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation). */ - keepalive?: boolean; + readonly isHistoryNavigation: boolean; /** - * A string to set request's method. + * Returns a boolean indicating whether or not request is for a reload navigation. */ - method?: string; + readonly isReloadNavigation: boolean; /** - * A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. + * Returns a boolean indicating whether or not request can outlive the global in which it was created. */ - mode?: RequestMode; + readonly keepalive: boolean; /** - * A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. + * Returns request's HTTP method, which is "GET" by default. */ - redirect?: RequestRedirect; + readonly method: string; /** - * A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. + * Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. */ - referrer?: string; + readonly mode: RequestMode; /** - * A referrer policy to set request's referrerPolicy. + * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. */ - referrerPolicy?: ReferrerPolicy; + readonly redirect: RequestRedirect; /** - * An AbortSignal to set request's signal. + * Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made. */ - signal?: AbortSignal | null; + readonly referrer: string; /** - * Can only be null. Used to disassociate request from any Window. + * Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */ - window?: any; + readonly referrerPolicy: ReferrerPolicy; + /** + * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. + */ + readonly signal: AbortSignal; + /** + * Returns the URL of request as a string. + */ + readonly url: string; + clone(): Request; } +export declare var Request: { + prototype: Request; + new(input: RequestInfo, init?: RequestInit): Request; + }; + /** This Fetch API interface represents the response to a request. */ export interface Response extends Body { readonly headers: Headers; @@ -67,75 +83,12 @@ export interface Response extends Body { clone(): Response; } -export interface ResponseInit { - headers?: HeadersInit; - status?: number; - statusText?: string; -} - -/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */ -export interface Blob { - readonly size: number; - readonly type: string; - arrayBuffer(): Promise; - slice(start?: number, end?: number, contentType?: string): Blob; - stream(): ReadableStream; - text(): Promise; -} - -/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */ -export interface FormData { - append(name: string, value: string | Blob, fileName?: string): void; - delete(name: string): void; - get(name: string): FormDataEntryValue | null; - getAll(name: string): FormDataEntryValue[]; - has(name: string): boolean; - set(name: string, value: string | Blob, fileName?: string): void; - forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; -} - -export interface URLSearchParams { - /** - * Appends a specified key/value pair as a new search parameter. - */ - append(name: string, value: string): void; - /** - * Deletes the given search parameter, and its associated value, from the list of all search parameters. - */ - delete(name: string): void; - /** - * Returns the first value associated to the given search parameter. - */ - get(name: string): string | null; - /** - * Returns all the values association with a given search parameter. - */ - getAll(name: string): string[]; - /** - * Returns a Boolean indicating if such a search parameter exists. - */ - has(name: string): boolean; - /** - * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. - */ - set(name: string, value: string): void; - sort(): void; - /** - * Returns a string containing a query string suitable for use in a URL. Does not include the question mark. - */ - toString(): string; - forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; -} - -/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ -export interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(): ReadableStreamDefaultReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(dest: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; -} +export declare var Response: { + prototype: Response; + new(body?: BodyInit | null, init?: ResponseInit): Response; + error(): Response; + redirect(url: string, status?: number): Response; + }; /** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */ export interface Headers { @@ -147,71 +100,101 @@ export interface Headers { forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void; } -/** This Fetch API interface represents a resource request. */ -export interface Request extends Body { +export declare var Headers: { + prototype: Headers; + new(init?: HeadersInit): Headers; + }; + +export interface Headers { + [Symbol.iterator](): IterableIterator<[string, string]>; /** - * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. + * Returns an iterator allowing to go through all key/value pairs contained in this object. */ - readonly cache: RequestCache; + entries(): IterableIterator<[string, string]>; /** - * Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. + * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */ - readonly credentials: RequestCredentials; + keys(): IterableIterator; /** - * Returns the kind of resource requested by request, e.g., "document" or "script". + * Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */ - readonly destination: RequestDestination; + values(): IterableIterator; +} + +export type RequestInfo = Request | string; + +export interface RequestInit { /** - * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header. + * A BodyInit object or null to set request's body. */ - readonly headers: Headers; + body?: BodyInit | null; /** - * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] + * A string indicating how the request will interact with the browser's cache to set request's cache. */ - readonly integrity: string; + cache?: RequestCache; /** - * Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation). + * A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */ - readonly isHistoryNavigation: boolean; + credentials?: RequestCredentials; /** - * Returns a boolean indicating whether or not request is for a reload navigation. + * A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ - readonly isReloadNavigation: boolean; + headers?: HeadersInit; /** - * Returns a boolean indicating whether or not request can outlive the global in which it was created. + * A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ - readonly keepalive: boolean; + integrity?: string; /** - * Returns request's HTTP method, which is "GET" by default. + * A boolean to set request's keepalive. */ - readonly method: string; + keepalive?: boolean; /** - * Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. + * A string to set request's method. */ - readonly mode: RequestMode; + method?: string; /** - * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. + * A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */ - readonly redirect: RequestRedirect; + mode?: RequestMode; /** - * Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made. + * A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ - readonly referrer: string; + redirect?: RequestRedirect; /** - * Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. + * A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. */ - readonly referrerPolicy: ReferrerPolicy; + referrer?: string; /** - * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. + * A referrer policy to set request's referrerPolicy. */ - readonly signal: AbortSignal; + referrerPolicy?: ReferrerPolicy; /** - * Returns the URL of request as a string. + * An AbortSignal to set request's signal. */ - readonly url: string; - clone(): Request; + signal?: AbortSignal | null; + /** + * Can only be null. Used to disassociate request from any Window. + */ + window?: any; } +export interface Body { + readonly body: ReadableStream | null; + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + formData(): Promise; + json(): Promise; + text(): Promise; +} + +export type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload"; +export type RequestCredentials = "include" | "omit" | "same-origin"; +export type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt"; +export type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin"; +export type RequestRedirect = "error" | "follow" | "manual"; +export type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"; + /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ export interface AbortSignal extends EventTarget { /** @@ -225,60 +208,62 @@ export interface AbortSignal extends EventTarget { removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } -export interface Body { - readonly body: ReadableStream | null; - readonly bodyUsed: boolean; +export type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; +export type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string; + +export interface ResponseInit { + headers?: HeadersInit; + status?: number; + statusText?: string; +} + +export type HeadersInit = Headers | string[][] | Record; + +/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ +export interface ReadableStream { + readonly locked: boolean; + cancel(reason?: any): Promise; + getReader(): ReadableStreamDefaultReader; + pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + pipeTo(dest: WritableStream, options?: StreamPipeOptions): Promise; + tee(): [ReadableStream, ReadableStream]; +} + +/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */ +export interface Blob { + readonly size: number; + readonly type: string; arrayBuffer(): Promise; - blob(): Promise; - formData(): Promise; - json(): Promise; + slice(start?: number, end?: number, contentType?: string): Blob; + stream(): ReadableStream; text(): Promise; } -export interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; +/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */ +export interface FormData { + append(name: string, value: string | Blob, fileName?: string): void; + delete(name: string): void; + get(name: string): FormDataEntryValue | null; + getAll(name: string): FormDataEntryValue[]; + has(name: string): boolean; + set(name: string, value: string | Blob, fileName?: string): void; + forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; } -export interface ReadableWritablePair { - readable: ReadableStream; +export interface FormData { + [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>; /** - * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + * Returns an array of key, value pairs for every entry in the list. */ - writable: WritableStream; -} - -export interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; + entries(): IterableIterator<[string, FormDataEntryValue]>; /** - * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate as follows: - * - * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. - * - * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. - * - * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - * - * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - * - * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. + * Returns a list of keys in the list. */ - preventClose?: boolean; - signal?: AbortSignal; -} - -/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */ -export interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - getWriter(): WritableStreamDefaultWriter; + keys(): IterableIterator; + /** + * Returns a list of values in the list. + */ + values(): IterableIterator; } /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ @@ -385,14 +370,117 @@ export interface AddEventListenerOptions extends EventListenerOptions { passive?: boolean; } +export declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + export interface EventListenerOptions { capture?: boolean; } -/** Provides information about files and allows JavaScript in a web page to access their content. */ -export interface File extends Blob { - readonly lastModified: number; - readonly name: string; +export type BufferSource = ArrayBufferView | ArrayBuffer; + +export interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; + sort(): void; + /** + * Returns a string containing a query string suitable for use in a URL. Does not include the question mark. + */ + toString(): string; + forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; +} + +export interface URLSearchParams { + [Symbol.iterator](): IterableIterator<[string, string]>; + /** + * Returns an array of key, value pairs for every entry in the search params. + */ + entries(): IterableIterator<[string, string]>; + /** + * Returns a list of keys in the search params. + */ + keys(): IterableIterator; + /** + * Returns a list of values in the search params. + */ + values(): IterableIterator; +} + +export interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; +} + +export interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + */ + writable: WritableStream; +} + +export interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate as follows: + * + * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. + * + * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. + * + * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. + * + * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. + * + * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. + */ + preventClose?: boolean; + signal?: AbortSignal; +} + +/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */ +export interface WritableStream { + readonly locked: boolean; + abort(reason?: any): Promise; + getWriter(): WritableStreamDefaultWriter; +} + +export type FormDataEntryValue = File | string; + +export interface EventListener { + (evt: Event): void; +} + +export interface EventListenerObject { + handleEvent(evt: Event): void; } export interface ReadableStreamGenericReader { @@ -400,6 +488,8 @@ export interface ReadableStreamGenericReader { cancel(reason?: any): Promise; } +export type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; + /** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */ export interface WritableStreamDefaultWriter { readonly closed: Promise; @@ -411,12 +501,10 @@ export interface WritableStreamDefaultWriter { write(chunk: W): Promise; } -export interface EventListener { - (evt: Event): void; -} - -export interface EventListenerObject { - handleEvent(evt: Event): void; +/** Provides information about files and allows JavaScript in a web page to access their content. */ +export interface File extends Blob { + readonly lastModified: number; + readonly name: string; } export interface ReadableStreamDefaultReadValueResult { @@ -428,18 +516,3 @@ export interface ReadableStreamDefaultReadDoneResult { done: true; value?: undefined; } - -export type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string; -export type HeadersInit = Headers | string[][] | Record; -export type RequestInfo = Request | string; -export type BufferSource = ArrayBufferView | ArrayBuffer; -export type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload"; -export type RequestCredentials = "include" | "omit" | "same-origin"; -export type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin"; -export type RequestRedirect = "error" | "follow" | "manual"; -export type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"; -export type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; -export type FormDataEntryValue = File | string; -export type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt"; -export declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; -export type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; diff --git a/lib.fetch.iterable.d.ts b/lib.fetch.iterable.d.ts deleted file mode 100644 index 66639a0..0000000 --- a/lib.fetch.iterable.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by resolving typescript/lib/lib.dom.iterable.d.ts from typescript@4.2.3 -export interface Headers { - [Symbol.iterator](): IterableIterator<[string, string]>; - /** - * Returns an iterator allowing to go through all key/value pairs contained in this object. - */ - entries(): IterableIterator<[string, string]>; - /** - * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. - */ - keys(): IterableIterator; - /** - * Returns an iterator allowing to go through all values of the key/value pairs contained in this object. - */ - values(): IterableIterator; -} diff --git a/package.json b/package.json index d915777..0cf867b 100644 --- a/package.json +++ b/package.json @@ -100,8 +100,7 @@ "dist", "polyfill", "index.d.ts", - "lib.fetch.d.ts", - "lib.fetch.iterable.d.ts" + "lib.fetch.d.ts" ], "keywords": [ "fetch",