Lost function definition #2885
Unanswered
tugcekucukoglu
asked this question in
Q&A
Replies: 1 comment
-
TypeDoc's type model used to return "Function" or "Object" when toString was called on types which are more complicated and didn't have an implemented method to stringify. It now returns a more accurate string which actually describes the type. With a little TS file that just contains your linked type, and the following code: import { Application, DeclarationReflection } from "typedoc";
const app = await Application.bootstrap({
entryPoints: ["src/gh2885.ts"],
});
const project = await app.convert();
if (!project) throw new Error("Failed to convert");
const alias = project.getChildByName(["VirtualScrollerPassThroughOptionType"]);
if (alias instanceof DeclarationReflection) {
console.log(alias.type?.toString());
} This prints:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We just upgareded to v0.27.9 and encountered this issue. For example;
https://github.com/primefaces/primevue/blob/master/packages/primevue/src/virtualscroller/VirtualScroller.d.ts#L15
includes('Function')
always returnsfalse
.Reference code: https://github.com/primefaces/primevue/blob/master/apps/showcase/scripts/build-apidoc.js#L567-L584
How can we display the code as defined?
Beta Was this translation helpful? Give feedback.
All reactions