TS1039

error TS1039: Initializers are not allowed in ambient contexts.

Broken Code ❌

index.d.ts
1
2
3
4
5
declare module hexo {
var config = {

}
}

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:

index.d.ts
1
2
3
declare module hexo {
var config: {};
}