JSdocs from backend files in public files

If I have a function in a backend jsw file annotated with a return type:

/** 
* @returns {Promise<SomeType>}
*/
export async function myFunction() {
  // ...
}

When I use that function in public pages, the return type of that function is not preserved.

import { myFunction } from 'backend/code.jsw';

// 'const investments: any'
const result = await myFunction();

Is there a way to resolve this besides just annotating the ‘result’ variable with its type?