Definitelytyped: Semantic error in JQuery definition

Created on 22 Mar 2016  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

I tried using the latest jquery/jquery.d.ts file in this repo and had problems.
When I launched TSC this error is shown:

.../typings/browser/ambient/jquery/index.d.ts(3212,13): error TS2403: Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.

Most helpful comment

Seems to be a conflict with protractor definitions.

All 4 comments

From Stack Overflow @werenskjold suggest to replace:

declare module "jquery" {
    export = $;
}
declare var jQuery: JQueryStatic;
declare var $: JQueryStatic;

with

declare module "jquery" {
    export = jQuery;
}
declare var jQuery: JQueryStatic;

@johnnyreilly

I think this is probably a problem with your setup. jquery being aliased as $ is expected

Seems to be a conflict with protractor definitions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

demisx picture demisx  路  3Comments

variousauthors picture variousauthors  路  3Comments

victor-guoyu picture victor-guoyu  路  3Comments

lilling picture lilling  路  3Comments

ArtemZag picture ArtemZag  路  3Comments