-
-
Notifications
You must be signed in to change notification settings - Fork 739
Description
Search terms
anchor, hyperlink, property, member
Expected Behavior
Per the release notes for v0.27.0, it indicates that "TypeDoc can now link to type alias properties, #2524." Unless I'm misunderstanding what was fixed and what scenarios the fix covers, when using {@link type#property}
, the generated HTML should contain a hyperlink to the corresponding anchor tag on the type declaration page.
import { z } from 'zod';
export const foo = {
/** foo a property */
a: '',
/** foo b property */
b: '',
};
export type FooType = typeof foo;
/** @useDeclaredType */
export type FooTypeDT = typeof foo;
export type FooExplicit = {
/** FooExplicit a property */
a: string;
/** FooExplicit b property */
b: string;
};
export const zfoo = z.object({
/** ZodFoo a property */
a: z.string(),
/** ZodFoo b property */
b: z.string(),
});
export type ZodFoo = z.infer<typeof zfoo>;
/** @useDeclaredType */
export type ZodFooDT = z.infer<typeof zfoo>;
/**
* Link Tests
*
* {@link foo} | {@link foo.a}
*
* {@link FooType} | {@link FooType.a}
*
* {@link FooTypeDT} | {@link FooTypeDT.a}
*
* {@link FooExplicit} | {@link FooExplicit.a}
*
* {@link ZodFoo} | {@link ZodFoo#a}
*
* {@link ZodFooDT} | {@link ZodFooDT#a}
*/
export const doSomething = () => {};
Actual Behavior
- The property is hyperlinked but it links to
foo.a
instead ofFooTypeDT.a
. I'm not 100% sure if it should link toFooTypeDT.a
but mentioning this as a potential bug/issue since I would think it should link toFooTypeDT.a
sinceFooTypeDT
is decorated with@useDeclaredType
. - Not hyperlinked
- Not hyperlinked
For 2 & 3, I was unable to narrow this down any further except for when zod
is used, apologies for that. Although I could be mistaken, I do not think this is a zod
and/or typedoc-plugin-zod
issue because the anchor tag is emitted on the ZodFoo
& ZodFooDT
declaration pages, the {@link}
reference does not error meaning it finds the corresponding type/property, it's only that the hyperlink is not emitted.
Steps to reproduce the bug
Repro: https://stackblitz.com/edit/vitejs-vite-gbh2bhqb
- Open repro
npm run docs
- View
docs/functions/doSomething.html
Environment
- Typedoc version: 0.27.4
- TypeScript version: 5.7.2
- Node.js version: 18.20.3 & 20.18.0
- OS: linux & windows