noahlam / Miment

a fast,light weight,simple and non-dependencies datetime library for javascript ( mini moment )

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript 支持

momtboy opened this issue · comments

commented

对TS仅限于入门水平,不过据我了解,TS不是JS的超集吗?不能直接使用?
如果确实有这个需求,可以考虑做一个TS版的。

@momtboy 目前的源码很少且魔改了原型链,个人认为并不是很适合用 TS 重写。

但对 d.ts 的支持是很有意义的,不妨加入 Roadmap 😄

import 方式引入 在 typescript 中使用报错

import miment from 'miment'
Uncaught (in promise) TypeError: miment_1.default is not a function

改为 require 方式引入就好了

const miment =require('miment')