【发布时间】:2015-11-22 06:18:49
【问题描述】:
我正在使用 tsd 从“绝对类型化”下载定义并编译成 tsd.d.ts 文件。我还不能构建,但是当我使用这样的导入时:
import * as THREE from "three"
Visual Studio 智能感知很高兴。但是,这不适用于 Detector.js(用于检测 webgl 支持的 three.js 库),带有 this .d.ts 文件。我不确定问题是什么,但我确实注意到了 three.d.ts 文件导出 一个模块(三个)和detector.d.ts 文件只导出一个对象:
三个.d.ts
...
declare module 'three' {
export=THREE;
}
检测器.d.ts
interface DetectorStatic {
canvas: boolean;
webgl: boolean;
workers: boolean;
fileapi: boolean;
getWebGLErrorMessage(): HTMLElement;
addGetWebGLMessage(parameters?: {id?: string; parent?: HTMLElement}): void;
}
declare var Detector: DetectorStatic;
这会改变我应该如何导入检测器吗?
【问题讨论】:
-
你的问题很不清楚。请提供一个具体的场景和尽可能多的细节。代码也不错。
标签: three.js typescript definitelytyped tsd