I’m developing a library with my utilities functions, one of them is this:
/**
* Open spreadsheet by passing its link instead of its key
* @return {Spreadsheet} the spreadsheet object
* @param {string} link the link to the spreadsheet
*/
function openByLink(link) {
return SpreadsheetApp.openById(link.match(/key=([^&]*)/)[1]);
}
My question is: How do I document this function return type so that the Script Editor auto-completes for my function’s return value as the Spreadsheet object. Just like if the openById call were not wrapped in my method?
Unfortunately completions won’t work on a function’s return value, whether it be in a library or the same script. I can see how this would be useful, and I suggest opening a feature request for it on the issue tracker.