首页 > 其他 > 详细

[TypeScript] Type Definitions and Modules

时间:2019-02-06 10:02:43      阅读:189      评论:0      收藏:0      [点我收藏+]

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.

[TypeScript] Type Definitions and Modules

原文:https://www.cnblogs.com/Answer1215/p/10353435.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!