VSCode NativeScript 的 IntelliSense 找不到模块 'ui/frame'

VSCode IntelliSense for NativeScript Cannot Find Module 'ui/frame'

我是 NativeScript 的新手,VSCode 的新手和 TypeScript 定义的新手,我在设置 VSCode 以通过 IntelliSense 对 tns-core-modules 所需的模块执行自动完成时遇到困难。

来自我的 package.json 的依赖项:

"dependencies": {
    "lodash": "^4.17.4",
    "nativescript-theme-core": "1.0.4",
    "tns-core-modules": "3.2.0"
}

lodash 的 IntelliSense 按预期完美运行。但是,来自 tns-core-modules 的任何内容的 IntelliSense 都不起作用。

我在 NativeScript 的 Sidekick 中从空白模板创建了一个项目。谷歌搜索后,我添加了一个 jsconfig.json 如下:

{
    "compilerOptions": {
        "checkJs": true,
        "target": "ES6",
        "allowSyntheticDefaultImports": true
    },
    "include": [
        "app/**/*"
    ]
}

CheckJS 在主页中向我显示此错误-page.js

将鼠标悬停在它显示的错误上:

[js] Cannot find module 'ui/frame'.

老实说,我尝试做各种我不明白的事情,例如:

/// <reference path="../../node_modules/tns-core-modules/tns-core-modules.d.ts" />
/// <reference path="../../node_modules/tns-core-modules/ui/frame/frame.d.ts"/>

我的理解是,因为 "ui/frame" 不在 package.json 中,但 nativeScript 会根据其构建的平台智能地从 tns-core-modules 中提取适当的模块...

最大的问题是:如何让 VSCode 了解正确的映射并在 ui/frame 和适当的 "frame.d.ts" 之间建立联系。

提前致谢!

编辑: 我想更新任何读者并让他们知道我不是也不想编写 TypeScript 代码,但我确实希望 VSCode 正确解释 TypeScript 定义。

答案是使用 TypeScript。没有它我无法让它工作。