If you check your typing file, you will see the main LoDashStatic interface, which you can expand:
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)
This should be enough for simple cases. You might want to place the above declarations in a module and simply export the new _ value.
source
share