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.

@cycle/dom 10.0.0-rc17 typing problems

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
staltzcommented, May 30, 2016

I’m working on it…

1reaction
staltzcommented, Jun 2, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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