Skip to main content
InterviewHubPRO
Section Overview
Q41

Question 41 of 50

Part 3: Enterprise Architecture, Compiler Internals & Performance (Senior / Staff)

82%
TypeScript Master (50 Qs)•Part 3: Enterprise Architecture, Compiler Internals & Performance (Senior / Staff)

What is the difference between `declare module` and `declare global`?

senior LevelFormsPerformanceSystem Design

In Simple Words:

  • declare module "some-package": Augments or provides types for an external npm package.
  • declare global: Augments the top-level global environment (adding properties to window, globalThis, or document) from within a module file.