1

My company recently updated to latest typescript definitions related to lodash library from DefinitelyTyped using tsd and suddenly ran into these typing error. If anyone could point out or help in this regard, we would be very thankful...

We are using AngularJS with Typescript [Disclaimer]

Error

error TS4063: Parameter 'lodash' of constructor from exported class has or is using private name '_'.

typings/lodash/lodash.d.ts(6497,19): error TS1005: '=' expected.
typings/lodash/lodash.d.ts(6497,23): error TS1005: '(' expected.
typings/lodash/lodash.d.ts(6498,19): error TS1005: '=' expected.
typings/lodash/lodash.d.ts(6498,27): error TS1005: '(' expected.
typings/lodash/lodash.d.ts(6499,19): error TS1005: '=' expected.
typings/lodash/lodash.d.ts(6499,31): error TS1005: '(' expected.
typings/lodash/lodash.d.ts(6500,19): error TS1005: '=' expected.
typings/lodash/lodash.d.ts(6500,35): error TS1005: '(' expected.
typings/lodash/lodash.d.ts(6501,19): error TS1005: '=' expected.
typings/lodash/lodash.d.ts(6501,39): error TS1005: '(' expected.

Here is the screenshot.

Lodash typings error

Piyush Chauhan
  • 1,523
  • 2
  • 24
  • 37

1 Answers1

1

The line 6497 of lodash.d.ts contains the following type alias:

type Function0<R> = () => R;

The problem, most likely, is that you don't use TypeScript 1.6 that adds generic type aliases. Unfortunately DefinitelyTyped is not versioned, so your best solution is to use TypeScript 1.6 (the latest stable version as of now).

MartyIX
  • 27,828
  • 29
  • 136
  • 207