TypeStrong / typedoc

Documentation generator for TypeScript projects.
https://typedoc.org
Apache License 2.0
7.79k stars 705 forks source link

Use typedoc as remote type #1947

Closed Kivylius closed 2 years ago

Kivylius commented 2 years ago

Search terms

typedoc, typescript, remote, micro frontends

Question

I love typedoc and its generated docs, but is it possible to use the output of typedoc or even write some plugin to be able to use typedoc output as remote type (comment or import) e.g.

/** typedoc:url website.com/typedoc/MyComponentType **/
const MyComponent = import('website.com/components/MyComponent');

- or -

import MyComponentType from  `website.com/typedoc/MyComponentType`;
const MyComponent: MyComponentType = import('website.com/components/MyComponent');

This pattern would allow remote types, when using patterns like micro frontend and there no direct importing of the different repos. This could also aid in the generation of better docs, where the type is remote, we could say something like:

import MyComponentType from  `website.com/typedoc/MyComponentType`;
type Something {
   MyComponent: MyComponentType
}

Let me know if this is possible, if not maybe point me in the right direction.

Gerrit0 commented 2 years ago

You're probably after renderer.addUnknownSymbolResolver - https://github.com/TypeStrong/typedoc/blob/master/internal-docs/third-party-symbols.md

Gerrit0 commented 2 years ago

If you're asking if TypeDoc can add custom module resolution (e.g. Deno), no, I have no plans to add that. TypeDoc giving the same behavior as tsc is important.