1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 21:50:00 -05:00

Expose the DOM Body interface globally (#2903)

This commit is contained in:
Nayeem Rahman 2019-09-10 15:57:17 +01:00 committed by Ryan Dahl
parent 2a83327a21
commit 0b757f3737
3 changed files with 5 additions and 2 deletions

View file

@ -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 = [

View file

@ -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;

View file

@ -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;