From 707d043a76590f928b29e6985f9b175c87e6dd81 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 5 Feb 2023 14:46:46 +0800 Subject: [PATCH] avoid global pollution --- globals.d.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/globals.d.ts b/globals.d.ts index bafd627..8771c84 100644 --- a/globals.d.ts +++ b/globals.d.ts @@ -35,10 +35,14 @@ declare class Toast { error(message: string): void } -// `var` is required here, -// otherwise the `blessing` property won't appear in `globalThis` type -declare var blessing: BlessingGlobals +export {} -interface Window { - blessing: BlessingGlobals +declare global { + // `var` is required here, + // otherwise the `blessing` property won't appear in `globalThis` type + declare var blessing: BlessingGlobals + + interface Window { + blessing: BlessingGlobals + } }