我有一个纯粹的打字本地包。像这样的导入很顺利
import { NavigationItem } from 'nx-ui'
我想像这样导入,这不起作用(找不到模块)
import { NavigationItem } from 'nx-ui/components/nav'
我有以下结构:
root/index.ts
> root/components
>> root/components/nav
>>> root/components/nav/index.ts
如何修复我的类型定义?
这是我的global.d.ts
:
declare module 'nx-ui/components/column' {
const value
export default value
}
declare module 'nx-ui/components/nav' {}
declare module 'nx-ui/components/misc' {}
declare module 'nx-ui/components/row' {}
declare module 'nx-ui' {
export * from 'nx-ui/components/column'
export * from 'nx-ui/components/nav'
export * from 'nx-ui/components/row'
export * from 'nx-ui/components/misc'
}