TS1039
error TS1039: Initializers are not allowed in ambient contexts.
Broken Code ❌
1 |
|
Fixed Code ✔️
Within a declaration file (ambient context), you should define types instead of implementing code. Consequently, you’ll need to replace the initialization with a type annotation:
1 |
|