fix(article-export): improve type safety for global scope in withWordExportScheduler
Frontend CI / Frontend (push) Successful in 4m0s

This commit is contained in:
2026-05-24 02:09:08 +08:00
parent 520cde5637
commit f02be451a5
+3 -3
View File
@@ -426,9 +426,9 @@ async function buildWordDocumentBlob(
} }
async function withWordExportScheduler<T>(work: () => Promise<T>): Promise<T> { async function withWordExportScheduler<T>(work: () => Promise<T>): Promise<T> {
const scope = globalThis as typeof globalThis & { const scope = globalThis as unknown as {
setImmediate?: BrowserSetImmediate setImmediate?: BrowserSetImmediate | unknown
clearImmediate?: BrowserClearImmediate clearImmediate?: BrowserClearImmediate | unknown
} }
const hadSetImmediate = Object.prototype.hasOwnProperty.call(scope, 'setImmediate') const hadSetImmediate = Object.prototype.hasOwnProperty.call(scope, 'setImmediate')
const hadClearImmediate = Object.prototype.hasOwnProperty.call(scope, 'clearImmediate') const hadClearImmediate = Object.prototype.hasOwnProperty.call(scope, 'clearImmediate')