【问题标题】:Installing the right typings from DefinitelyTyped从 DefinitiveTyped 安装正确的类型
【发布时间】:2016-11-26 06:32:59
【问题描述】:

我正在尝试为 malihu-custom-scrollbar-plugin(typings) 安装类型(版本 1.3.2 atm)。 我正在使用以下命令:

typings install dt~mcustomscrollbar --save --global

这会安装稍后被识别为错误的类型(错误 TS1110:预期类型。)因为使用了字符串文字类型语法,例如:axis?:“x”|“y”|“xy”。

我检查了 DT 存储库,发现在 types-2.0 分支中,类型没有使用这种语法,我想知道并试图找到一种方法来安装它们,而不是默认安装的那些。

有什么方法可以实现吗? 至少比在 index.d.ts 文件中手动修复问题要好。

附:我用typings install <location> 选项愚弄了arround,但我无法正确使用它,也找不到任何好的文档应该如何使用它。

【问题讨论】:

    标签: typescript definitelytyped typescript-typings mcustomscrollbar


    【解决方案1】:

    您可以直接从 github 安装类型,也可以指定所需的提交:

    typings install github:DefinitelyTyped/DefinitelyTyped/mCustomScrollbar/mCustomScrollbar.d.ts#41f8573534b0fff88707d0a4cb870456b50cd43b --save --global
    

    其中 41f8573534b0fff88707d0a4cb870456b50cd43b 是提交。

    【讨论】:

    • 谢谢!!!这是我正在寻找的命令语法。将其更改为 typings install mCustomScrollbar=github:DefinitelyTyped/DefinitelyTyped/mCustomScrollbar/index.d.ts#50387d40462301d54cda62e24d3b2ee46540f24a --save --global 因为我需要另一个分支和自定义名称。
    猜你喜欢
    • 2018-08-14
    • 2022-01-24
    • 2017-12-24
    • 1970-01-01
    • 1970-01-01
    • 2014-04-24
    • 1970-01-01
    • 1970-01-01
    • 2017-09-21
    相关资源
    最近更新 更多