- Code: Select all
/**
* Adds the given item to the Menu
*
* @param {CustomType<mycomponents-appbar.MenuItem>|CustomType<mycomponents-appbar.SubMenuItem>} item
* @param {String} [menuId] optional - Add the item to the submenu of the given menuId
* @param {Number} [index] optional - Index where the item will be inserted
*
* @return {Boolean}
*
* @SuppressWarnings(nls)
*/
function addItem(item, menuId, index) {
.
.
.
}
I don't seem to be able to find the correct syntax for specifying this in the .spec file. My "api" section has the method defined as:
- Code: Select all
"addItem": {
"returns": "boolean",
"parameters": [
{
"name": "item",
"type": "MenuItem|SubMenuItem"
},
{
"name": "menuId",
"type":"string",
"optional":true
},
{
"name": "index",
"type": "int",
"optional": true
}
]
},
However, this causes an error in the developer console:
- Code: Select all
WARN org.sablo.specification.WebObjectSpecification - Unknown type name 'MenuItem|SubMenuItem' encountered while parsing spec mycomponents-appbar
How should I specify that the argument can be of type MenuItem or SubMenuItem?