Is there any "processable" version of the API documentation (XML or something similar) ?
I'd like to have a go at getting some typescript definitions generated - if thats not already being worked on...
Printable View
Is there any "processable" version of the API documentation (XML or something similar) ?
I'd like to have a go at getting some typescript definitions generated - if thats not already being worked on...
The docs are generated directly from the source code. I believe JSDuck can do a raw data dump of all the information it extracts, you might want to look into that.
Cool - using that I can get something out like :
interface Ext_container_AbstractContainer : Ext_Component {
// Cfg
activeItem : object;
autoDestroy : Boolean;
baseCls : String;
bubbleEvents : String[];
defaultType : String;
defaults : object;
detachOnRemove : Boolean;
items : object;
layout : object;
renderTpl : String;
suspendLayout : Boolean;
// Properties
items : Ext.util.AbstractMixedCollection;
// Events
add(_this:Ext.container.Container,component:Ext.Component,index:Number,eOpts:Object) : void;
afterlayout(_this:Ext.container.Container,layout:Ext.layout.container.Container,eOpts:Object) : void;
beforeadd(_this:Ext.container.Container,component:Ext.Component,index:Number,eOpts:Object) : void;
beforeremove(_this:Ext.container.Container,component:Ext.Component,eOpts:Object) : void;
remove(_this:Ext.container.Container,component:Ext.Component,eOpts:Object) : void;
// Methods
add(component:object) : object;
afterLayout(layout:Ext.layout.container.Container) : void;
beforeLayout() : void;
cascade(fn:Function,scope:Object,args:Array) : Ext.Container;
child(selector:String) : void;
disable(silent:Boolean) : Ext.container.AbstractContainer;
doLayout() : Ext.container.Container;
down(selector:String) : void;
getComponent(comp:object) : Ext.Component;
getLayout() : Ext.layout.container.Container;
insert(index:Number,component:Ext.Component) : Ext.Component;
isAncestor(possibleDescendant:Ext.Component) : void;
move(fromIdx:Number,toIdx:Number) : Ext.Component;
onAdd(component:Ext.Component,position:Number) : void;
onBeforeAdd(item:Ext.Component) : void;
onRemove(component:Ext.Component,autoDestroy:Boolean) : void;
query(selector:String) : Ext.Component[];
queryBy(fn:Function,scope:Object) : Ext.Component[];
queryById(id:String) : Ext.Component;
remove(component:object,autoDestroy:Boolean) : Ext.Component;
removeAll(autoDestroy:Boolean) : Ext.Component[];
}
interface Ext_container_Container : Ext_container_AbstractContainer {
// Cfg
anchorSize : Number/Object;
// Properties
// Events
// Methods
afterHide(callback:Function,scope:Object) : void;
afterShow(animateTarget:object,callback:Function,scope:Object) : void;
getChildByElement(el:object,deep:Boolean) : Ext.Component;
onAdded(container:Ext.container.Container,pos:Number) : void;
}
interface Ext_toolbar_Toolbar : Ext_container_Container {
// Cfg
baseCls : String;
defaultType : String;
enableOverflow : Boolean;
layout : String/Object;
menuTriggerCls : String;
vertical : Boolean;
// Properties
isToolbar : Boolean;
// Events
overflowchange(c:Object,lastOverflow:Boolean,eOpts:Object) : void;
// Methods
constructor(config:object) : Ext.toolbar.Toolbar;
add(args:Object...) : void;
initComponent() : void;
onAdd(component:Ext.Component,position:Number) : void;
onBeforeAdd(item:Ext.Component) : void;
onRemove(component:Ext.Component,autoDestroy:Boolean) : void;
}
interface Ext_toolbar_Paging : Ext_toolbar_Toolbar {
// Cfg
afterPageText : String;
beforePageText : String;
displayInfo : Boolean;
displayMsg : String;
emptyMsg : String;
firstText : String;
inputItemWidth : Number;
lastText : String;
nextText : String;
prependButtons : Boolean;
prevText : String;
refreshText : String;
store : Ext.data.Store;
// Properties
// Events
beforechange(this:Ext.toolbar.Paging,page:Number,eOpts:Object) : void;
change(this:Ext.toolbar.Paging,pageData:Object,eOpts:Object) : void;
// Methods
bind(store:Ext.data.Store) : void;
doRefresh() : void;
getStoreListeners() : Object;
initComponent() : void;
moveFirst() : void;
moveLast() : void;
moveNext() : void;
movePrevious() : void;
onDestroy() : void;
unbind(store:Ext.data.Store) : void;
}
Not entirely sure how the output should look - but at least its a start!
I recall reading somewhere that there's a way to get it to output JSON, which may be easier to work with.
Thats what I did...
jsduck-4.1.1.exe extjs-4.1.1/src \
--builtin-classes \
--images ext-4.1.1/docs/images \
--warnings=-no_doc,-dup_member,-link_ambiguous \
--external XMLHttpRequest \
--ignore-global \
--pretty-json \
--export=full \
--output docs
(mostly C&P)
generated a whole bunch of .json files - then imported them into C# for processing (and I'm more familiar with that)
Thanks for your project on github!
FYI: I made some modifictions to it (by forking) to it can process the whole directory, added some runtime fixes for some type+name errors, etc: https://github.com/andremussche/extjsTypescript/
Maybe you can review it and merge it back? (this is my first github project...)
Happy to - if you tell me how !
Done...
(I think)