Skip to content

Commit

Permalink
avoid global pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Feb 5, 2023
1 parent b86469d commit 707d043
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 707d043

Please sign in to comment.