diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/body_test.ts | 4 | ||||
-rw-r--r-- | js/globals.ts | 2 | ||||
-rw-r--r-- | js/lib.deno_runtime.d.ts | 1 |
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; |