roddy
March 17, 2025, 10:40pm
1
When providing annotation to the parameters of a function, can the parameters be provided to the Function in the same way the type can be allocated to an Array?
For example, something similar to:
@param {Function<String, Number>} [errorHandlingCallback]
seain
March 19, 2025, 2:09am
2
Yes, here’s an example used by Servoy:
// reset confirmSeleciton to init state false
confirmSelection = false;
confirmSelectEmptyValue = false;
}
/**
* Shows this form as pop-up, returns selection in callback
*
* @public
* @param {function(Array<String|Date|Number>,String,scopes.svyPopupFilter.AbstractPopupFilter)} callback The function that is called when selection happens
* @param {RuntimeComponent} target The component which will be shown
* @param {Number} [width] The width of the pop-up. Optional. Default is component width
* @param {Number} [height] The height of the pop-up. Optional. Default is form height.
*
* @properties={typeid:24,uuid:"23332477-AC70-49F7-B9E9-8218A974CF23"}
*/
function showPopUp(callback, target, width, height) {
selectHandler = callback;
var w = !width ? defaultWidth() : width;
// if (initialValue) {
1 Like
roddy
March 19, 2025, 3:47am
3
Thanks so much ; really appreciate the response.