Home forums Using CanvasJS Using CanvasJS with Typescript

This topic contains 2 replies, has 3 voices, and was last updated by  Rishabh Rajgarhia 11 months, 4 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7198

    mover5
    Participant

    For those who don’t know, Typescript is a web language written on top of javascript. Any valid javascript is also valid typescript, and in fact, typescript compiles down to straight javascript. (Learn more here: http://typescriptlang.org)

    I was working on a personal project where I wanted some charts. I came across this library 🙂 However, I have only been working in Typescript. To facilitate this, many libraries have added typescript “definitions”. This allows for compile time type checking as well as intelligence when using Visual Studio.

    A community project called DefinitelyTyped was started a while back to facilitate these requests. Since I needed the typings, I went ahead and used the public documentation on this site and wrote the definition file. This morning, the pull request and validated and merged in.

    So, if you want typescript typings for CanvasJS 1.5 GA, look no further than DefinitelyTyped. If you are using nuget, you can also download the nuget package with these typings: https://www.nuget.org/packages/canvasjs.TypeScript.DefinitelyTyped/

    P.S. If the CanvasJS creators have any issues with this, we can always remove the typings from Definitely Typed…but hopefully you view it like I do as just another way to get CanvasJS to be used by typescript 🙂

    • This topic was modified 2 years, 2 months ago by  mover5.
    #9690

    fancidev
    Member

    I came across canvasjs lately and found its TypeScript definition on the DefinitelyTyped repository of great use.

    https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/canvasjs/canvasjs.d.ts

    However since it’s maintained by the community it’s only up-to-date as of v1.5.1.

    Is it possible for the maintainers to also maintain this TypeScript declarations and keep them up to date? Fortunately it’s not a lot work (probably one day’s work for one release).

    Thanks!

    #9694

    Thanks for the suggestion, we will take this into consideration.

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

You must be logged in to reply to this topic.