Yeah, actions should have more documentation.
How about something like:
getActions: function() {
return [
{
name: 'openAll',
description: 'Open all the subfolders of the ....',
},
{
name: 'selectItem',
description: 'Select an item, creates a visual change and
triggers the openaction',
arguments: [{name: 'itemId', type:
Appcelerator.Types.identifier}]
}
/* ... other actions */
];
}
Is that overkill?
What other info would a widget writer want to provide?
A person might also have a look at the "getChildNodes" abomination
that I started (in app:http, app:if, app:folder, app:statemachine). It
would obviously be nice to know what sort of subtags a widget expects,
but I'd rather not reinvent a broken version of xml schema. If the
app:folder widget was extended to allow nested folders to any depth,
my getChildNodes wouldn't be able to express that anymore, and we'd
have to add another hack to handle it.
--Mark