From 6660fb25c9f0cb8539bf0151d52d980e72d469fa Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 7 Apr 2020 15:03:14 -0400 Subject: [PATCH] Remove __workers namespace (#4665) --- cli/js/lib.deno.shared_globals.d.ts | 36 +++++++++++------------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/cli/js/lib.deno.shared_globals.d.ts b/cli/js/lib.deno.shared_globals.d.ts index b04d9b431a..d6302f8bed 100644 --- a/cli/js/lib.deno.shared_globals.d.ts +++ b/cli/js/lib.deno.shared_globals.d.ts @@ -28,7 +28,6 @@ declare interface WindowOrWorkerGlobalScope { ReadableStream: __domTypes.ReadableStreamConstructor; Request: __domTypes.RequestConstructor; Response: typeof __fetch.Response; - Worker: typeof __workers.WorkerImpl; location: __domTypes.Location; addEventListener: ( @@ -251,7 +250,6 @@ declare const FormData: __domTypes.FormDataConstructor; declare const ReadableStream: __domTypes.ReadableStreamConstructor; declare const Request: __domTypes.RequestConstructor; declare const Response: typeof __fetch.Response; -declare const Worker: typeof __workers.WorkerImpl; declare const addEventListener: ( type: string, @@ -281,7 +279,6 @@ declare type FormData = __domTypes.FormData; declare type ReadableStream = __domTypes.ReadableStream; declare type Request = __domTypes.Request; declare type Response = __domTypes.Response; -declare type Worker = __workers.Worker; declare interface ImportMeta { url: string; @@ -1513,26 +1510,19 @@ declare namespace __url { }; } -declare namespace __workers { - export interface Worker { - onerror?: (e: Event) => void; - onmessage?: (e: { data: any }) => void; - onmessageerror?: () => void; - postMessage(data: any): void; - terminate(): void; - } - export interface WorkerOptions { - type?: "classic" | "module"; - name?: string; - } - export class WorkerImpl implements Worker { - onerror?: (e: Event) => void; - onmessage?: (data: any) => void; - onmessageerror?: () => void; - constructor(specifier: string, options?: WorkerOptions); - postMessage(data: any): void; - terminate(): void; - } +declare class Worker { + onerror?: (e: Event) => void; + onmessage?: (data: any) => void; + onmessageerror?: () => void; + constructor( + specifier: string, + options?: { + type?: "classic" | "module"; + name?: string; + } + ); + postMessage(data: any): void; + terminate(): void; } declare namespace performance {