I started to use more often the jsdocs and I searched around how to use the enum type and still a doubt about it.
Here are the usage definition at JSDocs: Enum definition at JSDocs The example showed is about a single enum object, how it would work if I have an Object which one specific field is an Enum type ?
Consider that Im using the sequelize orm and the definition it is about a Model.
For example.
/**
* @name Car
* @typedef {Object} Car - This is a car Model.
* @property {string} type - Enum type.
* @property {string} color - This is an attribute for car's color
*/
const Car = {
// This should be considered as an enum type of strings.
type: {
type: ENUM,
values: ['0', '1'],
defaultValue: '0',
},
color: {
type: STRING,
defaultValue: 'color',
}
}
So, that way that I think that should work it would be like (which is not so fancy):
{
...
/**
* @enum
*/
type: {
type: ENUM,
values: ['0', '1'],
defaultValue: '0',
},
...
}
I was wondering if have some option which works like:
/**
* @name Car
* @typedef {Object} Car - This is a car Model.
* @property {string} type - Enum type.
* @enum
* @default 'Car1'
* @property {string} color - This is an attribute for car's color
*/
Someone have some suggestion about it ?