chris_b za bardzo mi pomogło, próbka, jak również link. Musiałem jednak usunąć adnotację @class
lub wygenerować dwa wpisy dla klasy. Co więcej, dodam tę odpowiedź, aby pokazać sposób adnotacji statycznych członków klasy (stałe na poziomie klasy).
(Używamy require.js.)
define([
'jquery', 'lodash', 'backbone'
], function($, _, Backbone) {
"use strict";
/**
* Enumeration of constants that represent the different types of Hedgehogs.
* @memberof models/Hedgehog
* @enum {string}
* @readonly
*/
var types = { 'type1': 'Type 1', 'type2': 'Type 2' };
var Hedgehog = Backbone.Model.extend(
/** @lends models/Hedgehog.prototype */
{
/**
* This is the model for Hedgehogs.
*
* @augments external:Backbone.Model
* @constructs
*/
initialize: function() {
// your code
},
// some more methods
}, {
// static class members
"types": types
});
return Hedgehog;
});
Ponieważ JSDoc jest port JavaDoc. Więc nie jest przeznaczony dla JavaScript. Użyj ['docco'] (http://jashkenas.github.com/docco/) – Raynos
portu lub części? – XMen
@Raynos Ogólnie masz rację, ale JSDoc nadal ma jedną ogromną zaletę: może dać Ci autouzupełnianie w IDE. –