Skip to content

Commit

Permalink
feat(worker): add testOnProcessKilled
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Jan 15, 2024
1 parent 135acaa commit 547e091
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/global/types/lib.worker.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
export interface MiniProgramWorker {
onMessage<T = Record<string, unknown>>(cb: (message: T) => void): void;
postMessage<T = Record<string, unknown>>(message: T): void;
/**
* 用于模拟 iOS ExperimentalWorker 线程被系统回收事件,主线程中通过 Worker.onProcessKilled 监听, 以便于调试。
* 仅限 iOS 系统, 仅支持在 worker 线程内可用。
*/
testOnProcessKilled(): void;
}

declare var worker: MiniProgramWorker;

0 comments on commit 547e091

Please sign in to comment.