Skip to content

Commit

Permalink
2023-08-23T14:38:31.321Z
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Aug 23, 2023
1 parent e3f6bf4 commit 567ae00
Show file tree
Hide file tree
Showing 42 changed files with 16 additions and 5 deletions.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions src/062-the-global-namespace/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Title

Title here!

## Exercises

- `declare` keyword
- _Used for declaring functions in the module scope that don’t actually exist (useful for third-party packages etc)_
- `declare global`
- Can be used inside a module declaration file to modify the global scope
- `declare global { interface String { startsWithHello(): boolean; } }` adds a new method to the String interface in the global scope
- Namespaces can be used in `declare global` to group related declarations or avoid name conflicts
- `declare module '*'`
- Syntax used inside a module declaration to declare a module that matches any string
- `declare module '*' { export var x: number; }` declares a module that exports a variable `x` for any import path
- Differences inside `.d.ts` files and `.ts` files
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
5 changes: 0 additions & 5 deletions src/070-modifying-the-global-namespace/plan.md

This file was deleted.

0 comments on commit 567ae00

Please sign in to comment.