JSDocs Typedef problem

 
I am trying to document a type, so I start with a type defintion as below:
  
/**
* @typedef PluralDef
* @type {Object}
* @property {string} many the template for a plural
* @property {string} one the template for a singular
* @property {string} none the template for no value
* @property {boolean} localize does the output need to be localized
*/



WS hightlights 'PluralDef' as having a warning and when I mouse over it says:

Unresolved variable or type 'PluralDef'

How should this be specified.


Rob

FYI - I intend to the use it as follows:

 
/**
* The plurals support table
* @type {Object.<string, PluralDef>}
*/
var plurals = {}
2 comments
Comment actions Permalink

WebStorm treates 'PluralDef'  as typedef type. Try changing your code as follows:

/**
* @typedef {Object} PluralDef
* @type {Object}
* @property {string} many the template for a plural
* @property {string} one the template for a singular
* @property {string} none the template for no value
* @property {boolean} localize does the output need to be localized
*/

/**
* The plurals support table
* @type {Object.<string, PluralDef>}
*/
var plurals = {}
0
Comment actions Permalink

Thanks for that!

Rob

0

Please sign in to leave a comment.