0

When trying to include the downloaded https://www.npmjs.com/package/vss-web-extension-sdk or more precisely the /typings/index.d.ts from the package I get the following typescript error after running tsc:

sdk/node_modules/vss-web-extension-sdk/node_modules/@types/jquery/index.d.ts(2957,63): error TS2304: Cannot find name 'Iterable'.
sdk/node_modules/vss-web-extension-sdk/typings/vss.d.ts(3441,18): error TS2559: Type 'TemplateViewModel' has no properties in common with type 'EnhancementOptions'.
sdk/node_modules/vss-web-extension-sdk/typings/vss.d.ts(10334,18): error TS2415: Class 'ComboDateBehavior' incorrectly extends base class 'BaseComboBehavior'.
  Types of property 'getValue' are incompatible.
  Type '() => Date' is not assignable to type '<TValue>() => TValue'.
  Type 'Date' is not assignable to type 'TValue'.
sdk/node_modules/vss-web-extension-sdk/typings/vss.d.ts(10419,18): error TS2415: Class 'ComboMultiValueBehavior' incorrectly extends base class 'ComboListBehavior'.
  Types of property 'getValue' are incompatible.
  Type '() => string[]' is not assignable to type '<TValue>() => TValue'.
  Type 'string[]' is not assignable to type 'TValue'.
sdk/node_modules/vss-web-extension-sdk/typings/vss.d.ts(10593,18): error TS2417: Class static side 'typeof DialogO' incorrectly extends base class static side 'typeof AjaxPanelO'.
  Types of property 'create' are incompatible.
  Type '<T extends Dialog>(dialogType: new (options: any) => T, options?: any) => T' is not assignable to type '<TControl extends Control<any>, TOptions>(controlType: new (options: TOptions) => TControl, conta...'.
  Types of parameters 'dialogType' and 'controlType' are incompatible.
  Type 'new (options: TOptions) => TControl' is not assignable to type 'new (options: any) => Dialog'.
  Type 'TControl' is not assignable to type 'Dialog'.
  Type 'Control<any>' is not assignable to type 'Dialog'.
  Property '_specifiedMaxWidth' is missing in type 'Control<any>'.

tsc version is 2.5.3

vss-web-extension-sdk is on version 3.121.0

Am I missing something? Or something I need to configure?

Boden_Units
  • 83
  • 2
  • 7
  • What if you add `"lib": ["es6", "dom", "es2015.iterable"]` for `compilerOptions` in `tsconfig.json` file as this post mentioned https://stackoverflow.com/questions/42347142/angular4-what-definition-of-iterable-should-i-use? – Marina Liu Sep 29 '17 at 08:40
  • use 2.3.* for typescript. since 2.4 something is broken https://github.com/Microsoft/vss-web-extension-sdk/issues/50 – Dave Smits Sep 30 '17 at 15:00
  • Thank you both, using the answers together fixed the typescript error outputs completely – Boden_Units Oct 05 '17 at 10:05

0 Answers0