【发布时间】:2016-04-07 20:45:57
【问题描述】:
旧版 lib.js:
function Foo () {...}
Foo.a = function() {...}
module.exports = Foo
键入 lib.d.ts:
declare module "foo" {
type Type = "a"|"b"|"c"
interface Foo {
(a: Type): string
...
}
export = Foo
// how do i export Type??
}
消费者 app.ts:
import Foo = require('foo')
// how do i get Type from lib.d.ts??
【问题讨论】:
标签: javascript typescript ecmascript-6