【发布时间】:2021-09-26 05:41:06
【问题描述】:
我正在使用 TypeScript 编写一个 Babel 插件,并且一直在努力寻找很多这样做的示例或文档。例如,我正在编写一个带有以下签名的访问者插件:
export default function myPlugin({ types: t }: typeof babel): PluginObj {
我从以下渠道获得了几种类型:
import type { PluginObj, PluginPass } from '@babel/core';
困扰我的部分是来自
的{ types: t }: typeof babel
import type * as babel from '@babel/core';
我在网上找到的几个例子都在使用这个,但它真的应该是这样输入的吗?
【问题讨论】:
标签: typescript babeljs typescript-typings babel-plugin