-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traversing and generating documentation from TypeDoc #2570
Comments
this seems similar to something that would make my life way easier here:
I'd love for a typedoc-provided runtime that takes the JSON output, maybe something like (psuedocode): const typedoc = new TypeDoc(theJsonObject);
const fooModule = typedoc.modules.find(x => x.path === 'declarations/foo.js');
const properties = fooModule.types.find(x => x.propertyName === 'properties' && x.returnType);
// renders the ReturnType from the properties getter
properties |
TypeDoc's reflection structure fairly closely resembles what's available on a TS AST... if that helps In this case, since "properties" is a getter, it has a Because it is a ReflectionType, what you want is actually on the declaration property, which is another As you might have started to suspect, since the type of const activeType = getSignature.type.declaration.children[0].type
const reflectType = activeType.declaration.children[0].type
// reflectType.toString() == "boolean" The non-object
TypeDoc can revive the JSON output into a project with This still won't give you exactly that API, but ProjectReflection.getChildByName is at least helpful for finding reflections (note: It does not recurse into types) |
Search terms
Traversal, Visitors
Question
Are there any docs on how to traverse types and other signatures from TypeDoc?
My basic use-case is I have a type that looks like this:
Basically, what I want to do is the the final
properties
type fromRoleTooltip.properties
, but I can't quite figured out how the TypeDoc documentation is rendering the type.Here's how TypeDoc generates it:
This is as far as I've gotten:
But can't quite seem to understand how to get the
static properties
final type value.I'd love to have either more functions or more documentation on how to traverse the TypeDoc trees. I feel like I've spent all day banging against this and haven't made any progress.
The text was updated successfully, but these errors were encountered: