1 | import type ts from "typescript";
|
2 | import { type Reflection } from "./abstract.js";
|
3 | import { ContainerReflection } from "./container.js";
|
4 | import type { DeclarationReflection } from "./declaration.js";
|
5 | import { type Type } from "../types.js";
|
6 | import { ReflectionKind } from "./kind.js";
|
7 | import { type CommentDisplayPart } from "../comments/index.js";
|
8 | import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
|
9 | import type { Serializer } from "../../serialization/serializer.js";
|
10 | import type { Deserializer, JSONOutput } from "../../serialization/index.js";
|
11 | import type { FileRegistry } from "../FileRegistry.js";
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare class ProjectReflection extends ContainerReflection {
|
20 | readonly variant = "project";
|
21 | private symbolToReflectionIdMap;
|
22 | private reflectionIdToSymbolIdMap;
|
23 | private reflectionIdToSymbolMap;
|
24 | private removedSymbolIds;
|
25 | private referenceGraph?;
|
26 | private reflectionChildren;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | reflections: {
|
35 | [id: number]: Reflection;
|
36 | };
|
37 | |
38 |
|
39 |
|
40 | packageName?: string;
|
41 | |
42 |
|
43 |
|
44 | packageVersion?: string;
|
45 | |
46 |
|
47 |
|
48 | readme?: CommentDisplayPart[];
|
49 | |
50 |
|
51 |
|
52 | readonly files: FileRegistry;
|
53 | constructor(name: string, registry: FileRegistry);
|
54 | /**
|
55 | * Return whether this reflection is the root / project reflection.
|
56 | */
|
57 | isProject(): this is ProjectReflection;
|
58 | /**
|
59 | * Return a list of all reflections in this project of a certain kind.
|
60 | *
|
61 | * @param kind The desired kind of reflection.
|
62 | * @returns An array containing all reflections with the desired kind.
|
63 | */
|
64 | getReflectionsByKind(kind: ReflectionKind): Reflection[];
|
65 | /**
|
66 | * Registers the given reflection so that it can be quickly looked up by helper methods.
|
67 | * Should be called for *every* reflection added to the project.
|
68 | */
|
69 | registerReflection(reflection: Reflection, symbol: ts.Symbol | undefined, filePath: string | undefined): void;
|
70 | /**
|
71 | * Removes references to reflections contained within the provided type.
|
72 | * Plugins which overwrite types on reflections should pass the type to this
|
73 | * method before overwriting the property.
|
74 | * @since 0.26.6
|
75 | */
|
76 | removeTypeReflections(type: Type | undefined): void;
|
77 | /**
|
78 | * Removes a reflection from the documentation. Can be used by plugins to filter reflections
|
79 | * out of the generated documentation. Has no effect if the reflection is not present in the
|
80 | * project.
|
81 | */
|
82 | removeReflection(reflection: Reflection): void;
|
83 | /** @internal */
|
84 | mergeModules(source: DeclarationReflection, target: DeclarationReflection | ProjectReflection): void;
|
85 | /**
|
86 | * Remove a reflection without updating the parent reflection to remove references to the removed reflection.
|
87 | */
|
88 | private _removeReflection;
|
89 | /**
|
90 | * Gets the reflection registered for the given reflection ID, or undefined if it is not present
|
91 | * in the project.
|
92 | */
|
93 | getReflectionById(id: number): Reflection | undefined;
|
94 | /**
|
95 | * Gets the reflection associated with the given symbol, if it exists.
|
96 | * @internal
|
97 | */
|
98 | getReflectionFromSymbol(symbol: ts.Symbol): Reflection | undefined;
|
99 | /**
|
100 | * Gets the reflection associated with the given symbol id, if it exists.
|
101 | * If there are multiple reflections associated with this symbol, gets the first one.
|
102 | * @internal
|
103 | */
|
104 | getReflectionFromSymbolId(symbolId: ReflectionSymbolId): Reflection | undefined;
|
105 | /** @internal */
|
106 | getReflectionsFromSymbolId(symbolId: ReflectionSymbolId): Reflection[];
|
107 | /** @internal */
|
108 | getSymbolIdFromReflection(reflection: Reflection): ReflectionSymbolId | undefined;
|
109 | /** @internal */
|
110 | registerSymbolId(reflection: Reflection, id: ReflectionSymbolId): void;
|
111 | symbolIdHasBeenRemoved(id: ReflectionSymbolId): boolean;
|
112 | /**
|
113 | * THIS MAY NOT BE USED AFTER CONVERSION HAS FINISHED.
|
114 | * @internal
|
115 | */
|
116 | getSymbolFromReflection(reflection: Reflection): ts.Symbol | undefined;
|
117 | private getReferenceGraph;
|
118 | toObject(serializer: Serializer): JSONOutput.ProjectReflection;
|
119 | fromObject(de: Deserializer, obj: JSONOutput.ProjectReflection): void;
|
120 | }
|