TypeScript not finding definitions -
i have following file structure:
+ src | test.ts | z_module.d.ts tsconfig.json test.ts
// nothing? /// <reference path="./z_module.d.ts" /> // can't write: var a: zzrm.zzrmobject; // have use: import * zzrm 'zzrm'; var a: zzrm.zzrmobject; z_module.d.ts
declare module "zzrm" { export interface zzrmobject {id: string} } i have tried reduce problem may have reduced incorrectly. problem came trying use sequelize-auto-ts. downloading repo, upgrading sequelize.d.ts , opening in visual studio code (version 0.10.6) highlights this line error "cannot find namespace 'sequelize'."
var sequelize:sequelize.sequelizestatic = require('sequelize'); ^^^^^^^^^ even though sequelize.d.ts reference @ top of file with: /// <reference path="../../typings/sequelize/sequelize.d.ts" />
the above "reduced" example works if zzrm module declared without quotation marks:
declare module zzrm { export interface zzrmobject {id: string} } when updated sequelize.d.ts failed note module declaration had changed
declare module sequelize { ... } to
declare module "sequelize" { ... } this referred in typescript docs under "ambient external modules" haven't quite yet figured out how these parts fit , why require add import * zzrm 'z_module';
Comments
Post a Comment