I know that I can use jsdoc to declare that a function returns an Object.
/**
* Builds a body that returns published products
* @param {string} rangeType
* @param {string} retailUnit
* @param {string[]} ids
* @returns {Object}
*/
function fetchPublishedProducts(rangeType, retailUnit, ids) {
return {
size: 250,
query: {
ids: {
values: ids.map(id => `${id}-${retailUnit}${rangeType ? `_${rangeType}` : ''}`),
},
},
};
}
But what is the syntax if I want to declare that the return object has a size
and a query
property?