【问题标题】:bootbox compilation error in typescript打字稿中的引导箱编译错误
【发布时间】:2013-05-25 22:17:32
【问题描述】:

当我导入 bootbox.d.ts (https://github.com/borisyankov/DefinitelyTyped/blob/master/bootbox/bootbox.d.ts) 作为打字稿参考时,我收到以下错误:

提供的参数与调用目标的任何签名都不匹配: 输入'{标签:字符串; }' 缺少“BootboxHandler”类型的属性“类”

这是 bootbox.d.ts 文件中引发错误的代码

interface BootboxHandler {
    label: string;
    class: string;
    callback: (result?: any) => void;
}

【问题讨论】:

    标签: typescript bootbox


    【解决方案1】:

    问题是属性未设置为可选。 bootbox.d.ts 应该有问号。

    interface BootboxHandler {
        label: string;
        class?: string;
        callback?: (result?: any) => void;
     }
    

    【讨论】:

      猜你喜欢
      • 2017-06-26
      • 2020-01-30
      • 2016-09-09
      • 1970-01-01
      • 2013-02-21
      • 1970-01-01
      • 2018-07-03
      • 2022-01-08
      • 1970-01-01
      相关资源
      最近更新 更多