-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3f6bf4
commit 567ae00
Showing
42 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Empty file.
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.