jQuery UI Widgets Forums Getting Started Typescript supported or not?

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Crisium 6 months, 3 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Typescript supported or not? #114770

    Crisium
    Participant

    I am a little confused. On the website it shows a Typescript Logo and I assume typescript is supported, but as I can see it is only angular that is supported (since the newest angular is typescript)…. but I do not see typescript only?

    I need the d.ts files or the compiler complains.

    what do I do?

    Typescript supported or not? #114771

    Crisium
    Participant

    I should probably add that I am using npm and I cannot see how to import or require modules?

    Typescript supported or not? #114774

    admin
    Keymaster

    Hi Crisium,

    Of course Typescript is supported. We use it a lot for Angular & React development. To use it with Javascript, refer to https://www.jqwidgets.com/jquery-widgets-demo/demos/typescript/index.htm

    Best regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

    Typescript supported or not? #114787

    Crisium
    Participant

    Then I am doing something wrong, because I did follow those instructions even before you showed me the link.

    >D:\Projects\testme5\app.ts(54,25): error TS2339: Build:Property ‘jqxDockingLayout’ does not exist on type ‘JQuery<HTMLElement>’.

    and I do have the d.ts file reference on the top of the file:

    /// <reference path=”node_modules/jqwidgets-scripts/jqwidgets-ts/jqwidgets.d.ts” />

    so what do I do? I can force an <any> for the jquery part and it will compile and run perfectly, but then I have no typing.

    peter

    Typescript supported or not? #114788

    Crisium
    Participant

    btw.. it would be cleaner if typing was done with the tsconfig instead of the brute force reference in the code.

    peter

    Typescript supported or not? #114803

    Crisium
    Participant

    seems like this thread went dead.

    I tried all combinations of jquery with jqwidgets and I cannot get past this error without having to resort to using <any>

    >D:\Projects\testme5\app.ts(54,25): error TS2339: Build:Property ‘jqxDockingLayout’ does not exist on type ‘JQuery<HTMLElement>’.

    I am compiling the typescript using develoeper studio set for a typescript project (meaning I am not using a commandline to compile the typescript nor do I wish to do that).

    any suggestions how to move on?

    Typescript supported or not? #114804

    Crisium
    Participant

    SOLVED: finally I got it. I can see that the docs has a different way of creating the widgets then the examples.

    I was doing:

    (<any>$(‘#jqxDockingLayout’)).jqxDockingLayout({ width: “100%”, height: “100%”, layout: layout });

    which does work, but didn’t want the <any>

    The docs states to do this instead:

    jqwidgets.createInstance(‘#jqxDockingLayout’, ‘jqxDockingLayout’, { width: “100%”, height: “100%”, layout: layout });

    which also works and now I have the correct types.

    doing this: /// <reference path=”node_modules/jqwidgets-scripts/jqwidgets-ts/jqwidgets.d.ts” />
    is terrible!

    we should be using the tsconfig.json and add to the “types”: [“jqwidgets-scripts”] or something in that line.

    anyone after two days of headaches this problem is now resolved.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.