2016-04-07 14 views
3

İstemciye bakan SDK'mızı belgelemek için JSDOC kullanıyoruz ve 'enum'larımızı (yani sabitler) tanımak için zorlanıyoruz. JSDOC’u belgelere almak için hangi etiketleri kullanmalıyız? İşte bir örnek:Belge Enum Sabitlerine JSDOC3 Nasıl Kullanılır

/** 
* @module Enum 
*/ 
export namespace { 

    /** 
    * @enum WidgetType {string} 
    */ 
    Enum.WidgetType = { 
     /** Dashboard */ 
     Dashboard: 'dashboard', 
     /** Form */ 
     Form: 'entityeditform', 
     /** Report */ 
     Report: 'report' 
    }; 
} 

İşte çeteleler 'kod kullanılan olduğu anlatılmaktadır:

app.widget({ id: 'account_entityform', type: Enum.WidgetType.Form }).add(); 

nasıl JSDOC ile bu belge olabilir?

cevap

1

this article on StackOverflow inceledikten sonra kullanıyorum bu çalışma almak başardı aşağıdadır: Cevabınız orijinal söz konusu kod parçalarında karşılık gelmez olarak

/** 
    * @typedef FieldType 
    * @property {string} Text "text" 
    * @property {string} Date "date" 
    * @property {string} DateTime "datetime" 
    * @property {string} Number "number" 
    * @property {string} Currency "currency" 
    * @property {string} CheckBox "checkbox" 
    * @property {string} ComboBox "combobox" 
    * @property {string} Dropdownlist "dropdownlist" 
    * @property {string} Label "label" 
    * @property {string} TextArea "textarea" 
    * @property {string} JsonEditor "jsoneditor" 
    * @property {string} NoteEditor "noteeditor" 
    * @property {string} ScriptEditor "scripteditor" 
    * @property {string} SqlEditor "sqleditor" 
    */ 
+0

Bu biraz belirsizdir –