diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-10-11 23:04:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 09:04:43 +1100 |
commit | 5f3028af13c25fb3af8f36d3d5913ef0688e5ce7 (patch) | |
tree | d997dc40bb558345fa490eaa04730c629c5275f8 /cli/dts | |
parent | 265a9fb9323a11067b4b826acc7624f2e62f1102 (diff) |
fix(cli/rt/main): Add global interface objects (#7875)
Diffstat (limited to 'cli/dts')
-rw-r--r-- | cli/dts/lib.deno.window.d.ts | 3 | ||||
-rw-r--r-- | cli/dts/lib.deno.worker.d.ts | 25 |
2 files changed, 17 insertions, 11 deletions
diff --git a/cli/dts/lib.deno.window.d.ts b/cli/dts/lib.deno.window.d.ts index 5c113cd0d..03341636f 100644 --- a/cli/dts/lib.deno.window.d.ts +++ b/cli/dts/lib.deno.window.d.ts @@ -7,7 +7,8 @@ /// <reference lib="deno.shared_globals" /> /// <reference lib="esnext" /> -declare interface Window extends EventTarget { +declare class Window extends EventTarget { + new(): Window; readonly window: Window & typeof globalThis; readonly self: Window & typeof globalThis; onload: ((this: Window, ev: Event) => any) | null; diff --git a/cli/dts/lib.deno.worker.d.ts b/cli/dts/lib.deno.worker.d.ts index 3fc95a97e..a10b1a276 100644 --- a/cli/dts/lib.deno.worker.d.ts +++ b/cli/dts/lib.deno.worker.d.ts @@ -7,48 +7,53 @@ /// <reference lib="deno.shared_globals" /> /// <reference lib="esnext" /> -declare interface DedicatedWorkerGlobalScope { - self: DedicatedWorkerGlobalScope & typeof globalThis; +declare class WorkerGlobalScope { + new(): WorkerGlobalScope; + self: WorkerGlobalScope & typeof globalThis; onmessage: | (( - this: DedicatedWorkerGlobalScope & typeof globalThis, + this: WorkerGlobalScope & typeof globalThis, ev: MessageEvent, ) => any) | null; onmessageerror: | (( - this: DedicatedWorkerGlobalScope & typeof globalThis, + this: WorkerGlobalScope & typeof globalThis, ev: MessageEvent, ) => any) | null; onerror: | (( - this: DedicatedWorkerGlobalScope & typeof globalThis, + this: WorkerGlobalScope & typeof globalThis, ev: ErrorEvent, ) => any) | null; - name: string; close: () => void; postMessage: (message: any) => void; Deno: typeof Deno; } -declare var self: DedicatedWorkerGlobalScope & typeof globalThis; +declare class DedicatedWorkerGlobalScope extends WorkerGlobalScope { + new(): DedicatedWorkerGlobalScope; + name: string; +} + +declare var self: WorkerGlobalScope & typeof globalThis; declare var onmessage: | (( - this: DedicatedWorkerGlobalScope & typeof globalThis, + this: WorkerGlobalScope & typeof globalThis, ev: MessageEvent, ) => any) | null; declare var onmessageerror: | (( - this: DedicatedWorkerGlobalScope & typeof globalThis, + this: WorkerGlobalScope & typeof globalThis, ev: MessageEvent, ) => any) | null; declare var onerror: | (( - this: DedicatedWorkerGlobalScope & typeof globalThis, + this: WorkerGlobalScope & typeof globalThis, ev: ErrorEvent, ) => any) | null; |