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.
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"
-
makeDOMDriverreturns 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 definemainas 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 subsequentxstreammethods 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.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 24 (15 by maintainers)
Commits related to this issue
- fix(package): specify typings field in package.json Fixes one issue of https://github.com/cyclejs/core/issues/307 — committed to cyclejs/dom by staltz 8 years ago
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