Skip to content

Commit

Permalink
fix(types): align global deno worker type with deno.worker/webworker …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Jérôme Benoit authored Jan 18, 2024
1 parent 88bc57d commit 99f9fa5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/tsc/dts/lib.deno.shared_globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down

0 comments on commit 99f9fa5

Please sign in to comment.