Open NullVoxPopuli opened 5 months ago
There are not - typedoc doesn't provide a browser bundle. Theoretically the models could be extracted with some work to remove node dependencies, but they currently also depend on node apis.
One thing I'm trying to figure out, and kinda gave up on last night (for now?) is finding the object in the output-json that represents a Reference
.
like in Foo<X>
, what is actually X
?
I know this points at the symbolIdMap, but that has a sourceFilepath, which doesn't matches to the file paths in sources[].filePath
, so I figure there must be some other way.
This is the code I was last trying: https://github.com/universal-ember/kolay/pull/43/files#diff-e67be3ef957214cba90a21f8bcc80542a449df7086fb062c8b933ab4ee76a24aR9
(apologies for the any
usage all over the place, but I also couldn't figure out the types of the JSON structure, and I'm fairly certain that everything I have type-wise around the JSON output is wrong :sweat_smile: )
Don't have time to look at your code tonight, but https://typedoc.org/api/modules/JSONOutput.html has interfaces which describe the output.
X
is probably a reference type. How it shows up in the json depends on if it has been resolved or not. If it includes a numeric target, that is pointing to a serialized reflection, it isn't pointing at the symbol ID map.
I spent a bit of time looking at your code... and I'm not sure what you're actually trying to do. getSignatureType
implies you're looking for call signatures but it looks like you're actually trying to get the first type argument? Maybe "signature" has some special meaning in your domain...
In the case of (extendedType as any).target.sourceFileName
existing, the reference is pointing to some type which is not included in the doucmentation, so you can't resolve that reference.
In my specific case, Signature
is the name of the type that has has this shape:
interface Signature {
Element: HTMLElement;
Args: { ... };
Blocks: { ... };
}
the reference is pointing to some type which is not included in the doucmentation, so you can't resolve that reference.
yeah, this kinda makes sense -- I've generated typedoc JSON from emitted declarations, rather than from source
what I'm trying to do with references, is in this situation:
export interface Signature { ... }
export default class Demo extends Component<Signature> { ... }
I want to get the type of Signature
from Demo
, like:
class Demo extends Component<Signature>
// ^ what properties are on this?
The Signature
type is exported, so I figured it'd referenceable.
details, if you're curious :sweat_smile:
but it looks like you're actually trying to get the first type argument Maybe "signature" has some special meaning in your domain...
yeah, the base class I'm referencing only takes one type argument (or function, etc), I have these situations where I'm trying to obtain the type:
class extends Component<?> { }
class extends Modifier<?> { }
class extends Helper<?> { }
const a = modifier<?>(() => {})
const b = helper<?>(() => {})
const c = resource<?>(() => {})
and I'm not sure what you're actually trying to do
at a super high level, I'm trying to generate nice looking type docs for known shapes of types/interfaces -- examples here (where "not currently supported" means I couldn't figure it out):
I spent a bit of time looking at your code
I appreciate your time!! <3
The Signature type is exported, so I figured it'd referenceable.
It will be - if it is exported from your entry point. I suspect whatever is passed to TypeDoc only exports the wrapping class from the entrypoint.
It looks like cloning your repo and pnpm i
, pnpm build
isn't sufficient to get up and running, so I can't really provide any more insight here
I am interested in someday providing a minimal bundle that can be included in browser builds, but from a quick skim to refresh my memory from the last time I looked at this... getting that is probably more than an afternoon of work.
Converting this to a feature request, will probably be 0.27... december-ish?
Search terms
I found in response to one of my other questions: https://github.com/TypeStrong/typedoc/issues/2392 These were suggested;
how do I get access to these?
Question
how do I get access to traversal utils? is the browser bundle small? (should be 0 dependencies, yeah?)