summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNayeem Rahman <muhammed.9939@gmail.com>2019-09-10 15:57:17 +0100
committerRyan Dahl <ry@tinyclouds.org>2019-09-10 10:57:17 -0400
commit0b757f37371474da63db341b831d83539df28df6 (patch)
treed5783942d847762f0cde7d387f8e81f1af924b28 /js
parent2a83327a21e83180a21afd428b11aa03e3080346 (diff)
Expose the DOM Body interface globally (#2903)
Diffstat (limited to 'js')
-rw-r--r--js/body_test.ts4
-rw-r--r--js/globals.ts2
-rw-r--r--js/lib.deno_runtime.d.ts1
3 files changed, 5 insertions, 2 deletions
diff --git a/js/body_test.ts b/js/body_test.ts
index f2daf725e..ec76e9072 100644
--- a/js/body_test.ts
+++ b/js/body_test.ts
@@ -3,11 +3,11 @@ import { test, testPerm, assertEquals, assert } from "./test_util.ts";
// just a hack to get a body object
// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function buildBody(body: any): domTypes.Body {
+function buildBody(body: any): Body {
const stub = new Request("", {
body: body
});
- return stub as domTypes.Body;
+ return stub as Body;
}
const intArrays = [
diff --git a/js/globals.ts b/js/globals.ts
index 6de8a5d89..e9479b4a5 100644
--- a/js/globals.ts
+++ b/js/globals.ts
@@ -99,6 +99,8 @@ window.crypto = (csprng as unknown) as Crypto;
window.Blob = blob.DenoBlob;
export type Blob = blob.DenoBlob;
+export type Body = domTypes.Body;
+
window.File = domFile.DenoFile as domTypes.DomFileConstructor;
export type File = domTypes.DomFile;
diff --git a/js/lib.deno_runtime.d.ts b/js/lib.deno_runtime.d.ts
index 6027f39b8..6ddf29c6c 100644
--- a/js/lib.deno_runtime.d.ts
+++ b/js/lib.deno_runtime.d.ts
@@ -1313,6 +1313,7 @@ declare const removeEventListener: (
) => void;
declare type Blob = blob.DenoBlob;
+declare type Body = domTypes.Body;
declare type File = domTypes.DomFile;
declare type CustomEventInit = customEvent.CustomEventInit;
declare type CustomEvent = customEvent.CustomEvent;