If I have a function signature defined either in JSDoc with @callback or in a .t.ds library using type, can I somehow use JSDoc to "attach" that signature to multiple function definitions?
/**
* @callback ruleDefiner
* @param {RuleDefinitionBuilder} builder
*/
Then:
/** @thisFunctionIsA {ruleDefiner} */
function spellfix(builder) {
// The IDE should know that builder is a RuleDefinitionBuilder
const {depends, produces, cmd, T} = builder;
const input = depends("foo.txt");
const output = produces("foo.spellfixed.txt");
cmd(T`spellfix ${input} > ${output}`);
}
/** @thisFunctionIsA {ruleDefiner} */
function sign(builder) {
// The IDE should know that builder is a RuleDefinitionBuilder
const {depends, produces, cmd, T} = builder;
const input = depends("foo.spellfixed.txt");
const output = produces("foo.signed.txt");
cmd(T`sign ${input} > ${output}`);
}
What should I use instead of pseudo-JSDoc @thisFunctionIsA?