cyclejs: @cycle/dom 10.0.0-rc17 typing problems

I’ve come across a number of problems when building a new cycle / xstream based app using typescript.

  1. Cannot find module '@cycle/dom': the typings are not found at all by the typescript compiler. Solution: add the following line to @cycle/dom’s package.json:
    "typings": "lib/index.d.ts"
  1. makeDOMDriver returns incorrect type Function. It should instead, return DriverFunction

  2. Too few interfaces are exported from index.d.ts. For example, I would like to use the interface DOMSource, so that I can define main as follows:

    interface Sources {
        DOM: DOMSource
    }

    function main(sources: Sources) {...}

This way, I would have edit-time intellisense in VSCode (or Atom with atom-typescript) However, DOMSource is not exported from index.d.ts.

  1. DOMSource.events() returns any, which means the subsequent xstream methods and operators are not type checked. DOMSource.events() should have return type Stream<Event>

Having this issues fixed for the next RC would be very helpful.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 24 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I’m working on it…

Ok, good news! I’ll close this issue, but we can still comment here, of course. If we have more TS issues, we can open other issues.

@staltz Yep! I confirm that with tsc or ts-loader fixes all the problems!

Yes, correct, thanks for the feedback, and I think your last paragraph is the right course of action.

Regarding 7 I’ve generally used typings install -SA es6-shim