2020-01-29 12:54:23 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
2020-04-10 14:24:42 -04:00
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
|
2020-01-29 12:54:23 -05:00
|
|
|
|
|
|
|
/// <reference no-default-lib="true" />
|
2020-04-16 17:40:29 -04:00
|
|
|
/// <reference lib="deno.ns" />
|
2020-02-19 00:34:11 -05:00
|
|
|
/// <reference lib="deno.shared_globals" />
|
2020-01-29 12:54:23 -05:00
|
|
|
/// <reference lib="esnext" />
|
|
|
|
|
2020-04-10 14:24:42 -04:00
|
|
|
declare interface DedicatedWorkerGlobalScope {
|
|
|
|
self: DedicatedWorkerGlobalScope & typeof globalThis;
|
2020-04-13 16:18:31 -04:00
|
|
|
onmessage: (e: MessageEvent) => void;
|
|
|
|
onmessageerror: (e: MessageEvent) => void;
|
2020-01-29 12:54:23 -05:00
|
|
|
onerror: undefined | typeof onerror;
|
|
|
|
name: typeof __workerMain.name;
|
|
|
|
close: typeof __workerMain.close;
|
|
|
|
postMessage: typeof __workerMain.postMessage;
|
2020-04-16 17:40:29 -04:00
|
|
|
Deno: typeof Deno;
|
2020-01-29 12:54:23 -05:00
|
|
|
}
|
|
|
|
|
2020-09-25 17:23:35 -04:00
|
|
|
declare var self: DedicatedWorkerGlobalScope & typeof globalThis;
|
|
|
|
declare var onmessage: ((e: { data: any }) => Promise<void> | void) | undefined;
|
|
|
|
declare var onerror:
|
2020-01-29 12:54:23 -05:00
|
|
|
| ((
|
2020-07-14 15:24:17 -04:00
|
|
|
msg: string,
|
|
|
|
source: string,
|
|
|
|
lineno: number,
|
|
|
|
colno: number,
|
|
|
|
e: Event,
|
|
|
|
) => boolean | void)
|
2020-01-29 12:54:23 -05:00
|
|
|
| undefined;
|
2020-09-25 17:23:35 -04:00
|
|
|
declare var close: typeof __workerMain.close;
|
|
|
|
declare var name: typeof __workerMain.name;
|
|
|
|
declare var postMessage: typeof __workerMain.postMessage;
|
2020-01-29 12:54:23 -05:00
|
|
|
|
|
|
|
declare namespace __workerMain {
|
|
|
|
export let onmessage: (e: { data: any }) => void;
|
|
|
|
export function postMessage(data: any): void;
|
|
|
|
export function close(): void;
|
|
|
|
export const name: string;
|
|
|
|
}
|
|
|
|
|
2020-04-10 14:24:42 -04:00
|
|
|
/* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
|