1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 16:49:18 -05:00

fix(types): align global deno worker type with deno.worker/webworker one (#21936)

Transpiler doing type checking such as the ones used in dnt or bundler
fail because of incompatible Worker types if env like browser are
targeted.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
This commit is contained in:
Jérôme Benoit 2024-01-18 23:42:04 +01:00 committed by GitHub
parent 88bc57d764
commit 99f9fa5556
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -522,9 +522,9 @@ declare interface WorkerOptions {
/** @category Web Workers */
declare interface Worker extends EventTarget {
onerror?: (e: ErrorEvent) => void;
onmessage?: (e: MessageEvent) => void;
onmessageerror?: (e: MessageEvent) => void;
onerror: (this: Worker, e: ErrorEvent) => any | null;
onmessage: (this: Worker, e: MessageEvent) => any | null;
onmessageerror: (this: Worker, e: MessageEvent) => any | null;
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: StructuredSerializeOptions): void;
addEventListener<K extends keyof WorkerEventMap>(