为了账号安全,请及时绑定邮箱和手机立即绑定

exports = struct, struct 是一个方法, 这种怎么定义 typescript

exports = struct, struct 是一个方法, 这种怎么定义 typescript

至尊宝的传说 2018-08-27 16:23:09
像这种 怎么定义 d.ts 文件。module.exports = Struct/**  * The Struct "type" meta-constructor.  */function Struct () {  debug('defining new struct "type"')   ... }我这样定义不行declare module 'ref-struct' {  function Struct(options?: any): any;  export = Struct; }
查看完整描述

1 回答

?
开心每一天1111

TA贡献1836条经验 获得超13个赞

调用方式不正确哦
请使用import Struct = require('ref-struct');
因为你这边使用的是export = Foo的方式来导出的

查看完整回答
反对 回复 2018-10-23
  • 1 回答
  • 0 关注
  • 899 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信