summaryrefslogtreecommitdiff
path: root/cli/js/web/fetch.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-04-14 09:23:07 -0400
committerGitHub <noreply@github.com>2020-04-14 09:23:07 -0400
commitff60b311299e11d1cf761b29e38ea54ad1744bff (patch)
tree5605e043c1769991ad0f6d6b9113c56f23c0ddba /cli/js/web/fetch.ts
parent360c05ffe7fc91058a6c8acd5ea9b4e2ed120946 (diff)
dedup various type definitions (#4741)
FormData FilePropertyBag DomFile BlobPropertyBag RequestCache RequestCredentials RequestDestination RequestMode RequestRedirect ResponseType
Diffstat (limited to 'cli/js/web/fetch.ts')
-rw-r--r--cli/js/web/fetch.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/js/web/fetch.ts b/cli/js/web/fetch.ts
index 10ce821c1..364c05a6b 100644
--- a/cli/js/web/fetch.ts
+++ b/cli/js/web/fetch.ts
@@ -8,7 +8,6 @@ import * as io from "../io.ts";
import { read } from "../ops/io.ts";
import { close } from "../ops/resources.ts";
import { Buffer } from "../buffer.ts";
-import { FormData } from "./form_data.ts";
import { fetch as opFetch, FetchResponse } from "../ops/fetch.ts";
import { DomFileImpl } from "./dom_file.ts";
@@ -85,7 +84,7 @@ class Body
}
// ref: https://fetch.spec.whatwg.org/#body-mixin
- async formData(): Promise<domTypes.FormData> {
+ async formData(): Promise<FormData> {
const formData = new FormData();
const enc = new TextEncoder();
if (hasHeaderValueOf(this.contentType, "multipart/form-data")) {
@@ -274,7 +273,7 @@ class Body
}
export class Response implements domTypes.Response {
- readonly type: domTypes.ResponseType;
+ readonly type: ResponseType;
readonly redirected: boolean;
headers: Headers;
readonly trailer: Promise<Headers>;
@@ -287,7 +286,7 @@ export class Response implements domTypes.Response {
headersList: Array<[string, string]>,
rid: number,
redirected_: boolean,
- readonly type_: null | domTypes.ResponseType = "default",
+ readonly type_: null | ResponseType = "default",
body_: null | Body = null
) {
this.trailer = createResolvable();
@@ -388,7 +387,7 @@ export class Response implements domTypes.Response {
return this.body.blob();
}
- formData(): Promise<domTypes.FormData> {
+ formData(): Promise<FormData> {
if (this.#bodyViewable() || this.body == null) {
return Promise.reject(new Error("Response body is null"));
}