bbc / VideoContext

An experimental HTML5 & WebGL video composition and rendering API.
http://bbc.github.io/VideoContext/
Apache License 2.0
1.33k stars 157 forks source link

Typings? #84

Closed gossi closed 6 years ago

gossi commented 6 years ago

Would you provide typings (or even rewrite? 😈), so us typescript users get auto-complete support from our IDE?

PTaylour commented 6 years ago

If you'd like to rewrite in typescript we'd welcome the PR :P

We use flow internally, so we have some unpublished partial typings of videocontext.

Perhaps if we add those to the repo, it would provide a good starting point for typescript type definitions.

For typescript, is it pretty safe to target the latest version and provide a type definition file in the repo? Or is it more standard practice to host defs in a third party registry?

gossi commented 6 years ago

Having a index.d.ts with all typing should be sufficient enough and handle most to all cases. I don't know how to deal with it from a library perspective, so maybe there is some config entry required to package.json other than that it should be straight forward I think.

PTaylour commented 6 years ago

We may be able to generate typescript defs from the JSDocs annotations.

I just gave this a very quick go https://github.com/jumpinjackie/jsdoc-typescript-plugin

(it didn't work)

gossi commented 6 years ago

I think TS also has some options to auto-generate typings, at least to some level.

PS. In the long run, you'll heavily benefit writing this lib in TS, especially since it favors OOP, where TS shines. These are my experiences as well.

PTaylour commented 6 years ago

PS. In the long run, you'll heavily benefit writing this lib in TS, especially since it favors OOP, where TS shines. These are my experiences as well.

Honest take: totally agree with you here, however, given there quite a lot of movement in the code base at the moment (new features, performance enhancements, bug fixes) I think it's best for us to focus our resources on integrating these and adding more tests.

A short term view, I know, but the best we can manage at the moment.

P.S.

Hijacking my own comment to share an internal projects that is using videocontext https://www.bbc.co.uk/rd/blog/2018-06-great-exhibition-of-the-north-video-streaming-event

geopic commented 4 years ago

Greetings, I'd like to resurrect this old issue as I write TS type declaration files for other libraries and would like to know if the codebase is more stable or if it's still being changed in a big way. Let me know if you're interested

legraphista commented 3 years ago

hey @geopic, would you like to share your typings?