-
-
Notifications
You must be signed in to change notification settings - Fork 735
Inaccurate JSON output types #1389
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
Comments
TypeDoc exports a Alternatively, to avoid writing out to disk in the first place, you could use TypeDoc's API, though be aware that this will be changing somewhat significantly in 0.20. const TypeDoc = require('typedoc');
const app = new TypeDoc.Application();
app.options.addReader(new TypeDoc.TSConfigReader());
app.options.addReader(new TypeDoc.TypeDocReader());
app.bootstrap({
tsconfig: 'tsconfig.json',
});
const project = app.convert(app.expandInputFiles(['src']));
if (project) { // Project may not have converted correctly
const outputDir = 'docs';
// Rendered docs
app.generateDocs(project, outputDir);
// Alternatively generate JSON output
app.generateJson(project, outputDir + '/documentation.json');
} |
Hi, thanks for the reply. I've tried using the |
That's a bug with those typings then, feel free to submit a PR! |
Oh, ok, thanks. I'll close the issue for now. |
@Gerrit0 I've found something interesting: |
I looked at the schema code again, and there are some very questionable choices for the types there... why is |
Well... much later than I wanted to get to it, but I did finally get to it. v0.20.0-beta.13 has the corrected types. There was a cast to |
Hi, I'd like to get the data that TypeDoc generates when it parses a project and use it to convert it to a custom documentation format. The only way I could find is to generate a JSON file in a temp directory so that it can be parsed: the problem with that is that there are no typings for it, and so I can't be sure of all the properties it could have. I've tried manually assigning types from the package but they don't always match correctly, and I was ending up putting
// @ts-expect-error
everywhere...Does anybody know how can I get this data directly from the package, before it gets converted to JSON?
The text was updated successfully, but these errors were encountered: