1. #1
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    91
    Vote Rating
    8
    zz9pa is on a distinguished road

      0  

    Default API documentation

    API documentation


    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...

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,605
    Vote Rating
    326
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    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.

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    91
    Vote Rating
    8
    zz9pa is on a distinguished road

      0  

    Default


    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!

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,605
    Vote Rating
    326
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I recall reading somewhere that there's a way to get it to output JSON, which may be easier to work with.

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    91
    Vote Rating
    8
    zz9pa is on a distinguished road

      0  

    Default


    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)

  6. #6
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    André Mussche is on a distinguished road

      0  

    Default


    Quote Originally Posted by zz9pa View Post
    Thats what I did...
    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...)

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    91
    Vote Rating
    8
    zz9pa is on a distinguished road

      0  

    Default


    Happy to - if you tell me how !

  8. #8
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    André Mussche is on a distinguished road

      0  

    Default


    Quote Originally Posted by zz9pa View Post
    Happy to - if you tell me how !
    I send a "pull request" to you, that seems the way to do it?

  9. #9
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    91
    Vote Rating
    8
    zz9pa is on a distinguished road

      0  

    Default


    Done...

    (I think)

  10. #10
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    André Mussche is on a distinguished road

      0  

    Default


    Quote Originally Posted by zz9pa View Post
    Done...
    (I think)

    yes it seems to work

    Can you do some tests? I am new to Sencha (and typescript with compile time checks was needed to continue)