question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing Createjs for use with Typescript

See original GitHub issue

The @types for createjs seem to be formatted as a namespace instead of a module. If you import as below:

import 'createjs'

You can then access for example:

createjs.Stage

Since the @types (the Typescript typings) are exporting a namespace it then becomes sticky when trying to load the module via a module loader such as SystemJs.

Any comments on how createjs should be imported and loaded would be appreciated.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
lshiffercommented, Jan 25, 2018

Any update on this?

Only way I was able to get createjs to work with typescript using the “import … as …” as noted in most ts documentation was to use the npm package ‘createjs-module’. However, that module package seems to be behind createjs itself so don’t want to use that…

As for this current work around… Not a fan of adding the reference path.

2reactions
gigi-budriocommented, Mar 20, 2017

any update in It?! i continue to have a lot offline troubles trying to import easeljs @types in angular2 app 😦(( many thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to use EaselJS (CreateJS) with TypeScript using ...
I found a workaround. Use the createjs-module package instead, and use this as your import statement: import * as createjs from ...
Read more >
How to use CreateJS on Typescript – Kaplof - Kopf
The below example is for importing easelJS. The problem of using createJS in TypeScript is that it doesn't export modules but just the ......
Read more >
@types/createjs - npm
TypeScript definitions for CreateJS. Latest version: 0.0.29, ... Start using @types/createjs in your project by running `npm i @types/createjs`.
Read more >
Tools - CreateJS
An AIR application for exporting SWF animations as EaselJS spritesheets for use in ... You can find the typescript definitions of CreateJS's libraries...
Read more >
Master Chief, CreateJS & TypeScript - CodeProject
Remember that "Every JavaScript program is also a TypeScript program" and while this is the case the CreateJS libraries are unusable with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found