avoid global pollution

This commit is contained in:
Pig Fang 2023-02-05 14:46:46 +08:00
parent b86469df7f
commit 707d043a76
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2

4
globals.d.ts vendored
View File

@ -35,6 +35,9 @@ declare class Toast {
error(message: string): void
}
export {}
declare global {
// `var` is required here,
// otherwise the `blessing` property won't appear in `globalThis` type
declare var blessing: BlessingGlobals
@ -42,3 +45,4 @@ declare var blessing: BlessingGlobals
interface Window {
blessing: BlessingGlobals
}
}