• 请不要在回答技术问题时复制粘贴 AI 生成的内容
WhyAreYouSoSad
V2EX  ›  程序员

typescript 好像类库很少?

  •  
  •   WhyAreYouSoSad · Apr 18, 2018 · 2427 views
    This topic created in 3038 days ago, the information mentioned may be changed or developed.

    在找一个集合操作类库,可以在指定位置插入和删除的。有大佬推荐下吗

    4 replies    2018-04-18 18:09:26 +08:00
    sjn9588
        1
    sjn9588  
       Apr 18, 2018
    lodash 吧。TS 好处之一就是只要有对应的 d.ts 文件能使用 JS 库。
    banxi1988
        2
    banxi1988  
       Apr 18, 2018
    1. JS 库即 TS 库
    2. JS 库要让 TS 的编译系统识别需要 声明文件(.d.ts), 参考 : https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html
    比如安装 lodash 可以使用 `npm install --save @types/lodash`
    3. 如上一般的库都有 `@types/库名称` 对应的声明库。 你可以直接在 npm 上按此规则搜索。也可以在这里搜索:
    http://microsoft.github.io/TypeSearch/

    4. 你可以把 `.d.ts` 文件当作于 C/C++ 中的头文件。
    Pastsong
        3
    Pastsong  
       Apr 18, 2018
    momocraft
        4
    momocraft  
       Apr 18, 2018
    你想要的东西和 Array 的区别在哪
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 02:14 · PVG 10:14 · LAX 19:14 · JFK 22:14
    ♥ Do have faith in what you're doing.