Fix postMessage type error in Web Worker files by adding triple-slash directives (#16761)

* Initial plan

* Add triple-slash directives to worker files to fix postMessage type error

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
Copilot 2025-11-07 20:18:33 +09:00 committed by GitHub
parent b300b5b94a
commit 46d30f454b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
/// <reference lib="esnext" />
/// <reference lib="webworker" />
import { render } from 'buraha';
const canvas = new OffscreenCanvas(64, 64);

View File

@ -3,6 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
/// <reference lib="esnext" />
/// <reference lib="webworker" />
const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1);
// 環境によってはOffscreenCanvasが存在しないため
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition

View File

@ -3,6 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
/// <reference lib="esnext" />
/// <reference lib="webworker" />
import { render } from 'buraha';
const canvas = new OffscreenCanvas(64, 64);

View File

@ -3,6 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
/// <reference lib="esnext" />
/// <reference lib="webworker" />
const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1);
// 環境によってはOffscreenCanvasが存在しないため
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition