I'm working in an Electron project with checkjs: true
set in my jsconfig.json
and have created a file with custom typings in ProjectRoot/typings/index.d.ts
.
I'd like to have those typings available in all JS files. Unfortunately I have to reference them manually:
Without the manual reference, it won't recognize the type:
My Project structure looks like this:
Here's the content of typings/index.d.ts:
interface LauncherItem {
name: string,
icon: string,
cmd: string,
args: string,
}
interface AppConfig {
items: LauncherItem[],
appIconSize: number,
}
And jsconfig.json:
{
"compilerOptions": {
"target": "es6",
"checkJs": true
},
"typeAcquisition": {
"include": [
"./typings/index.d.ts"
]
},
"include": [
"**/*.js",
"*.d.ts"
]
}
Not sure if the explicit typeAcquisition
and include of *.d.ts
is usually necessary. They're just a result of my tests but obviously didn't work...