Definitelytyped: @types/jquery legacy.d.js Subsequent property declarations must have the same type

Created on 3 Feb 2019  路  2Comments  路  Source: DefinitelyTyped/DefinitelyTyped

With Dec 25, 2018 export, @types/jquery 3.3.39 using TypeScript 3.3.1 I hit an issue with an any type being extended as a string type.

This is because JQueryInputEventObject is conflicting between @types/angular/jqlite.d.ts and @types/jquery/legacy.d.ts with the jqlite version setting up a type of any instead of string or a union.

../node_modules/@types/jquery/legacy.d.ts:174:5 - error TS2717: Subsequent property declarations must have the same type. Property 'key' must be of type 'any', but here has type 'string'.
171 char: string;
174 key: string;

Most helpful comment

@Downchuck can you elaborate on the versions used in the fix? I am using jquery version 3.3.1 and @types/jquery version 3.3.29 with typescript version being 3.5.2. Currently I don't find a combination of the former two that would work and I have the same error as you had.

All 2 comments

Already fixed upstream - I just need to update my package versions. Yay!

@Downchuck can you elaborate on the versions used in the fix? I am using jquery version 3.3.1 and @types/jquery version 3.3.29 with typescript version being 3.5.2. Currently I don't find a combination of the former two that would work and I have the same error as you had.

Was this page helpful?
0 / 5 - 0 ratings