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:
parent
2a83327a21
commit
0b757f3737
3 changed files with 5 additions and 2 deletions
|
@ -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 = [
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
1
js/lib.deno_runtime.d.ts
vendored
1
js/lib.deno_runtime.d.ts
vendored
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue