0
我有以下文件結構:打字稿沒有找到定義
+ src
| test.ts
| z_module.d.ts
tsconfig.json
test.ts
// does nothing?
/// <reference path="./z_module.d.ts" />
// can't now write:
var a: zzrm.zzrmObject;
// have to use:
import * as zzrm from 'zzrm';
var a: zzrm.zzrmObject;
z_module.d.ts
declare module "zzrm" {
export interface zzrmObject {id: string}
}
我試圖減少的問題,但很可能降低它不正確。這個問題最初來自嘗試使用sequelize-auto-ts。 Downloading the repo,升級sequelize.d.ts並打開Visual Studio代碼(版本0.10.6)立即突出顯示this line,並顯示錯誤「Can not find namespace sequelize'」。
var Sequelize:sequelize.SequelizeStatic = require('sequelize');
^^^^^^^^^
即使sequelize.d.ts成功引用在與文件的頂部:/// <reference path="../../typings/sequelize/sequelize.d.ts" />