[TypeScript] Type Definitions and Modules

匿名 (未验证) 提交于 2019-12-02 23:05:13

For example you are building your own module, the same as Lodash:

my-lodash.d.ts

declare module "lodash" {     declare interface FirstFunction {         (data: any[]) :any;     }      declare interface Lodash {           first: FirstFunction;     }      export const _: Lodash: }

Normally you can install @types for popluar 3rd-party libs, if you have to build your own, you need to remember export type defination aas well for Typescript.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!