2

I am trying to reference an object I export, currently I achieved this successfully by importing it and prefixing with "_" so that it does not show up as unused, is there another way to do this?

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { BusinessTime as _BusinessTime } from "@/lib/types/business-time"

/**
 * @returns Open hours for business, see: {@link _BusinessTime BusinessTime}
 */
export function getBusinessTimes() {}
  • See: [jsDoc - set type without importing file](https://stackoverflow.com/questions/44749703/jsdoc-set-type-without-importing-file), or better: [How to make jsDoc “import” work with vscode?](https://stackoverflow.com/questions/60523475/how-to-make-jsdoc-import-work-with-vscode) – Mr. Polywhirl Aug 31 '21 at 18:06
  • Apparently TS 2.9 support this already: [Refer to type in different file in JSDoc without importing](https://stackoverflow.com/a/50255744/1762224) – Mr. Polywhirl Aug 31 '21 at 18:09
  • So I tried to add a `/** @typedef {import("@/lib/types/business-time").BusinessTime} BusinessTime */` at the top of my file but `@returns Open hours for business, see: {@link BusinessTime}` inside my function's JSDoc, does not link to the actual symbol –  Aug 31 '21 at 18:21

0 Answers0