lolipop99 / Notes

笔记
MIT License
2 stars 0 forks source link

Typescript资料 #5

Open lolipop99 opened 6 years ago

lolipop99 commented 6 years ago

介绍

http://morning.work/page/2017-04/how-to-write-a-port-scanner-in-nodejs-and-typescript.html

lolipop99 commented 6 years ago

构造函数定义

interface ClockStatic {
  new (hour: number, minute: number);
}

class Clock {
  currentTime: Date;
  constructor(h: number, m: number) { }
}

var cs: ClockStatic = Clock;
var newClock = new cs(7, 30);
lolipop99 commented 6 years ago

Json 对象 → TypeScript Interface 在线转换器

https://static.jixun.moe/json2tsinterface.html http://json2ts.com/

lolipop99 commented 6 years ago

Typescript编译规范相关

commonjs规范没module.exports