This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,19 @@
import { DOMParser } from '@xmldom/xmldom';
"use strict";
const WebWorkerAdapter = {
createCanvas: (width, height) => new OffscreenCanvas(width ?? 0, height ?? 0),
getCanvasRenderingContext2D: () => OffscreenCanvasRenderingContext2D,
getWebGLRenderingContext: () => WebGLRenderingContext,
getNavigator: () => navigator,
getBaseUrl: () => globalThis.location.href,
getFontFaceSet: () => globalThis.fonts,
fetch: (url, options) => fetch(url, options),
parseXML: (xml) => {
const parser = new DOMParser();
return parser.parseFromString(xml, "text/xml");
}
};
export { WebWorkerAdapter };
//# sourceMappingURL=WebWorkerAdapter.mjs.map