Jump to content

How to CreateJS + TypeScript ?


Midnight
 Share

Recommended Posts

Hello, guys.

I'm trying to set up a workplace using CreateJS and Typescript. So far I tried only to use VisualStudio for this.

I see everyone using the "createjs." namespace, can't find it in .d files from here: https://github.com/borisyankov/DefinitelyTyped

Or is there another way of using Typescript with all the typing, intellisense and debugging?

Link to comment
Share on other sites

That repository contains all createjs definitions. (CreateJS, EaselJS, SoundJS,TweenJS and PreloadJS).

 

Edit: Apparently the namespace was declared in easeljs.d.ts, now I don't know how to make VS see .js files as implementation files and stop getting errors like this:

 

Error 1 Class ColorMatrix declares interface number[] but does not implement it:

Types of property 'concat' of types 'ColorMatrix' and 'number[]' are incompatible:
Call signatures of types '{ (...matrix: number[]): ColorMatrix; <ColorMatrix extends number[]>(...items: ColorMatrix[]): number[]; }' and '{ <U extends T[]>(...items: U[]): number[]; (...items: number[]): number[]; }' are incompatible:
Types of property 'reduceRight' of types 'ColorMatrix' and 'number[]' are incompatible:
Call signatures of types '{ (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; <U>(callbackfn: (previousValue: ColorMatrix, currentValue: number, currentIndex: number, array: number[]) => ColorMatrix, initialValue: ColorMatrix): ColorMatrix; }' and '{ (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; <U>(callbackfn: (previousValue: U, currentValue ... D:\My html5 developments\DemoVisualiserfr\DemoVisualiserfr\GettingStarted\easeljs\easeljs.d.ts 123 18 DemoVisualiserfr
 
Edit 2: I suppose it's something with "/// <reference path=", but no success yet.
Edit 3: Not the "reference path". In easeljs.d.ts line 123 throws this error, but since i'm new to typescript I can't really understand why.
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...