[go: nahoru, domu]

Skip to content

Commit

Permalink
Removed end of 13
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Apr 3, 2024
1 parent 1484c68 commit 40c3aea
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions book-content/chapters/13-modules-scripts-declaration-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,6 @@ const state: any;

Your task is to specify that `DEBUG` is available in this module without needing to provide its implementation. This will help TypeScript understand the type of `state` and provide the expected type checking.

### Exercise 4: Global Declarations

Picking up where the previous exercise left off, `DEBUG` is only available in the file it was declared in. How would the definition need to change in order to make it available across multiple files in the project?

### Exercise 5: Modularizing a Declaration File

### Solution 1: Typing a JavaScript Module

The solution is to create a declaration file with a name that matches the JavaScript file. In this case, the declaration file should be named `example.d.ts`. Inside of the declaration file, we declare the `myFunc` function with its type signature:
Expand Down

0 comments on commit 40c3aea

Please sign in to comment.