New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(docgen): new generator for TypeScript declaration #8
Conversation
I know, that you already have Also generated file revealed some mistakes in the documentation (you can find them by |
ca6a0ee
to
aa41c61
Compare
- Dictionary<T> (typed factory methods) - Types for "addEventListner" and "removeEventListener" methods - Types for Events
aa41c61
to
b38bc2f
Compare
So from a first quick look I really like these changes and would love to get them in for our existing TypeScript generator. The cons are negligible i guess. If you absolutely need custom properties you can still cast the created proxy to @drauggres do you think you can easily adopt these new features to our existing TypeScript generator? |
I have an idea of changing Alloy in a way that it will generate TS classes, and everything (including code generated from xml-views, tss-styles, models and collections) could be checked for types.
I just found some flaws in my generator (that's why I changed title to |
eb25cf2
to
f6b2e75
Compare
This will allow to describe event for some special namespace-classes like Ti.Geolocation, Ti.Media, Ti.Network etc. https://www.typescriptlang.org/docs/handbook/declaration-merging.html
f6b2e75
to
0547015
Compare
OK. Now I'm satisfied with the generated result. This is how I would like to see
I will look into it and if I succeed then I'll open a new PR. |
@janvennemann Sorry for disturbing you, but do you know where documentation for Windows platform is coming from? UPD: nevermind, found it here. BTW current version in DefinitelyTyped is missing "Windows" too. |
e118e1c
to
8a21456
Compare
in case a "namespace" is empty we can skip its generation, but then we must define constants from it as static properties on the related class
previously events without additional properties were mapped to "baseEvent"
skip duplicates, mark them as error
add missing "static" for removed static methods
a0078c7
to
01a76c6
Compare
closed in favor of #25 |
Output for current master (9.0.0) branch: titanium.d.ts
Pros:
namespace
andclass
(with static methods). This allows to define types for specific events for Modules likeTi.Geolocation
,Ti.Media
,Ti.Network
etc.:Cons:
evenid
Ti.UI.View
now haveid
property):