Furthermore, TypeScript also has the notion of global augmentations of the form declare global { }.This allows modules to augment global types such as Array if necessary.

    Neither module augmentations nor global augmentations can add new items to the top level scope - they can only “patch” existing declarations.

    Example

    Similarly, the global scope can be augmented from modules using a declarations:

    Example