Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/typedoc' into feature/ty…
Browse files Browse the repository at this point in the history
…pedoc-signature
  • Loading branch information
ZEROM22 committed Dec 11, 2024
2 parents 12fbd31 + f52b42d commit 59412ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions packages/library-declaration/lib/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export class Group {
description = ""
}

export type Definition = DefinitionMap[keyof DefinitionMap]

export interface DefinitionMap {
declaration: Declaration
fragment: Fragment
}

export class Declaration {
name = ""
signature = new DeclarationSignature()
Expand Down
15 changes: 11 additions & 4 deletions packages/typedoc-declaration/lib/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1215,11 +1215,12 @@ export class Repository {
const d = e.declaration
const f = flatTrail(t.trail.real)
r.#trailIndex.set(d, f)
r.#idIndex.set(t.sourceId, e.id)

for (const [i, p] of t.parameters.entries()) {
const e = d.parameters[i]
const m = d.parameters[i]
const f = flatTrail(p.trail.real)
r.#trailIndex.set(e, f)
r.#trailIndex.set(m, f)
}
}

Expand All @@ -1234,19 +1235,25 @@ export class Repository {
return this.#entities
}

#trailIndex = new Map<L.Declaration | L.Fragment, FlatTrail>()
#trailIndex = new Map<L.Definition, FlatTrail>()

#idIndex = new Map<number, number>()

constructor(o: J.Reflection) {
this.#sourceTree = o
}

trailOf(t: L.Declaration | L.Fragment): FlatTrail | undefined {
trailOf(t: L.Definition): FlatTrail | undefined {
return this.#trailIndex.get(t)
}

reflectionOf(t: FlatTrail): J.Reflection | undefined {
return resolveTrail(this.#sourceTree, t)
}

idOf(o: J.Reflection): number | undefined {
return this.#idIndex.get(o.id)
}
}

export class TrailDuplex {
Expand Down

0 comments on commit 59412ab

Please sign in to comment.