如何在js文件中d.ts类型定义作为doctype使用?

How to use type definition from d.ts file as doctype in js file?

提问人:grabantot 提问时间:7/13/2022 更新时间:7/13/2022 访问量:73

问:

我想在我的webpack.config.js文件中使用webpack配置对象的定义来获取IDE提示。可能吗?

打字稿 webpack 文档类型

评论


答:

0赞 grabantot 7/13/2022 #1

它的语法如下:

/**
 * @param {import('webpack').Configuration} config
 */
module.exports = function override(config) {
  ...