UNPKG

2.8 kBTypeScriptView Raw
1import { DocNode, DocNodeKind, IDocNodeParameters, IDocNodeParsedParameters } from './DocNode';
2import { DocMemberReference } from './DocMemberReference';
3import { TokenSequence } from '../parser/TokenSequence';
4/**
5 * Constructor parameters for {@link DocDeclarationReference}.
6 */
7export interface IDocDeclarationReferenceParameters extends IDocNodeParameters {
8 packageName?: string;
9 importPath?: string;
10 memberReferences?: DocMemberReference[];
11}
12/**
13 * Constructor parameters for {@link DocDeclarationReference}.
14 */
15export interface IDocDeclarationReferenceParsedParameters extends IDocNodeParsedParameters {
16 packageNameExcerpt?: TokenSequence;
17 importPathExcerpt?: TokenSequence;
18 importHashExcerpt?: TokenSequence;
19 spacingAfterImportHashExcerpt?: TokenSequence;
20 memberReferences?: DocMemberReference[];
21}
22/**
23 * Represents a declaration reference.
24 *
25 * @remarks
26 * Declaration references are TSDoc expressions used by tags such as `{@link}`
27 * or `{@inheritDoc}` that need to refer to another declaration.
28 */
29export declare class DocDeclarationReference extends DocNode {
30 private _packageName;
31 private readonly _packageNameExcerpt;
32 private _importPath;
33 private readonly _importPathExcerpt;
34 private readonly _importHashExcerpt;
35 private readonly _spacingAfterImportHashExcerpt;
36 private readonly _memberReferences;
37 /**
38 * Don't call this directly. Instead use {@link TSDocParser}
39 * @internal
40 */
41 constructor(parameters: IDocDeclarationReferenceParameters | IDocDeclarationReferenceParsedParameters);
42 /** @override */
43 get kind(): DocNodeKind | string;
44 /**
45 * The optional package name, which may optionally include an NPM scope.
46 *
47 * Example: `"@scope/my-package"`
48 */
49 get packageName(): string | undefined;
50 /**
51 * The optional import path. If a package name is provided, then if an import path is provided,
52 * the path must start with a "/" delimiter; otherwise paths are resolved relative to the source file
53 * containing the reference.
54 *
55 * Example: `"/path1/path2"`
56 * Example: `"./path1/path2"`
57 * Example: `"../path2/path2"`
58 */
59 get importPath(): string | undefined;
60 /**
61 * The chain of member references that indicate the declaration being referenced.
62 * If this list is empty, then either the packageName or importPath must be provided,
63 * because the reference refers to a module.
64 */
65 get memberReferences(): ReadonlyArray<DocMemberReference>;
66 /**
67 * Generates the TSDoc representation of this declaration reference.
68 */
69 emitAsTsdoc(): string;
70 /** @override */
71 protected onGetChildNodes(): ReadonlyArray<DocNode | undefined>;
72}
73//# sourceMappingURL=DocDeclarationReference.d.ts.map
\No newline at end of file