我有一个外部模块的自定义 .d.ts
文件,其格式如下:
declare module 'vertices-bounding-box' {
export default function boundingBox(positions: [number,number,number][]): [number, number]
}
我想使用另一个模块中的类型,而不是 [number,number,number]
:
import { vec3 } from 'gl-matrix';
declare module 'vertices-bounding-box' {
export default function boundingBox(positions: vec3[]): [number, number]
}
当我加入vec3
的导入语句时,TSC会抱怨:
Invalid module name in augmentation. Module 'vertices-bounding-box' resolves to an untyped
module at '/Users/kevzettler/code/hypeworks/node_modules/vertices-bounding-box/index.js', which cannot be augmented. [2665]