@cycle/dom 10.0.0-rc17 typing problems
See original GitHub issueI’ve come across a number of problems when building a new cycle / xstream based app using typescript.
Cannot find module '@cycle/dom'
: the typings are not found at all by the typescript compiler. Solution: add the following line to@cycle/dom
’spackage.json
:
"typings": "lib/index.d.ts"
-
makeDOMDriver
returns incorrect typeFunction
. It should instead, returnDriverFunction
-
Too few interfaces are exported from
index.d.ts
. For example, I would like to use the interfaceDOMSource
, so that I can definemain
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
.
DOMSource.events()
returnsany
, which means the subsequentxstream
methods and operators are not type checked.DOMSource.events()
should have return typeStream<Event>
Having this issues fixed for the next RC would be very helpful.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:24 (15 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.