excalibur-tiled typings

10 views
Skip to first unread message

Alessandro Lioi

unread,
Jun 28, 2018, 5:44:11 PM6/28/18
to excaliburjs


Hello!
I have a project set up with webpack and TypeScript and I need to have the typings to import the library.

Are there any typings for @excaliburjs/excalibur-tiled or is there any alternative?

I've been using this workaround:
declare var require:(moduleId: string) => any
const TiledResource = require('@excaliburjs/excalibur-tiled').default

const Test = new TiledResource('/Maps/Map.tmx')
but I'm having an error:
this.data is null
 excalibur-tiled.js:797

How can I resolve this?

Kamran Ayub

unread,
Jun 28, 2018, 7:26:45 PM6/28/18
to Alessandro Lioi, excaliburjs
Dang, it's written in TS but it looks like I may have missed generating a declaration file or accidentally excluded it from the package when I published. Can you check the node_modules/excalibur-tiled and see if there's a lib/excalibur-tiled.d.ts file? If it was packaged correctly, there should be. Otherwise I will need to fix it.

In the meantime, you can use es2015 import syntax and then make your own declaration file (or build the source and copy it over manually).

Check out the docs, tmx isn't supported, only base64 encoded json.

-Kamran

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/cb4f701c-4363-4aff-9144-fe5455f7f72e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages