fix(article-export): improve type safety for global scope in withWordExportScheduler
Frontend CI / Frontend (push) Successful in 4m0s
Frontend CI / Frontend (push) Successful in 4m0s
This commit is contained in:
@@ -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')
|
||||||
|
|||||||
Reference in New Issue
Block a user