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