The recursion can be defined with @typedef tag.
/** @type {<T>(v: T)=>T} */
const h = (v) => v;
/** @typedef {{bar: number, foo: recursive}} recursive */
const a = h(
/** @returns {recursive} */
() => {
return {
bar: 2,
foo: a()
};
}
);