2016-05-23 79 views

回答

0

如果您检查分型文件,您可以看到基本LoDashStatic界面,你可以扩展:

import old = require('lodash') 

interface LodashExt extends old.LoDashStatic { 
    nth(n: Array<any>, i: number) : LodashExt 
    // . . . 
} 

var _ = <LodashExt>old 

_.add(1, 2) 

_.nth(['a', 'b', 'c', 'd'], 2) 

这应该是足够简单的案件。你可能想把上面的声明放到一个模块中,然后导出新的_值。

+0

现在我正在这样做。但我希望没有新变量。 – wishmaster35