Re: [Jsdoc-user] public properties?
Status: Inactive
Brought to you by:
mmathews
From: Anthony E. <an...@ch...> - 2007-03-27 23:33:35
|
On 3/27/07, Michael Mathews <mi...@gm...> wrote: > Hi Anthony, > > I'm afraid I don't understand your example. Perhaps you trimmed too > much, because the Foo.bar code you gave isn't valid JS. Did you mean: > > Foo = { > bar: { > some_public_property: 2, > a_func: function(p) { > } > } > }; > > Foo.bar.some_public_property = 3; > > I can't be certain of JSDoc 1.x (perhaps Gabriel will follow up) but > in JSDoc-2 one way to document the above would be like so: > > /** > * Container object. > * @namespace > */ > Foo = { > /** > * Just an example. > * @namespace > * @property {number} some_public_property > */ > bar: { > some_public_property: 2, > /** > * Here's an example method. > * @method > * @param p > */ > a_func: function(p) { > } > } > }; > > This would add all your objects to the output. I can post an example > of this on the web if you like and you can try it yourself. > > Regards, > Michael > > On 27 Mar 2007, at 22:58, Anthony Ettinger wrote: > > > Is it bad form to have a public property? > > I'm not seeing any way to note this in JSDoc. > > > > ie: > > > > Foo.bar: { > > some_public_property: 2, > > a_func: function(p) { > > > > } > > } > > > > > > Such that I can set it with: > > > > Foo.bar.some_public_property = 3; > > > > Seems we need a JSDoc "@public" notation. I don't see @property anywhere in the #tagref page. -- Anthony Ettinger Ph: 408-656-2473 http://chovy.dyndns.org/resume.html http://utuxia.com/consulting |