UNPKG

3.27 kBTypeScriptView Raw
1import { DocNodeKind, DocNode } from './DocNode';
2import { DocDeclarationReference } from './DocDeclarationReference';
3import { DocInlineTagBase, IDocInlineTagBaseParsedParameters, IDocInlineTagBaseParameters } from './DocInlineTagBase';
4import { TokenSequence } from '../parser/TokenSequence';
5/**
6 * Constructor parameters for {@link DocLinkTag}.
7 */
8export interface IDocLinkTagParameters extends IDocInlineTagBaseParameters {
9 codeDestination?: DocDeclarationReference;
10 urlDestination?: string;
11 linkText?: string;
12}
13/**
14 * Constructor parameters for {@link DocLinkTag}.
15 */
16export interface IDocLinkTagParsedParameters extends IDocInlineTagBaseParsedParameters {
17 codeDestination?: DocDeclarationReference;
18 urlDestinationExcerpt?: TokenSequence;
19 spacingAfterDestinationExcerpt?: TokenSequence;
20 pipeExcerpt?: TokenSequence;
21 spacingAfterPipeExcerpt?: TokenSequence;
22 linkTextExcerpt?: TokenSequence;
23 spacingAfterLinkTextExcerpt?: TokenSequence;
24}
25/**
26 * Represents an `{@link}` tag.
27 */
28export declare class DocLinkTag extends DocInlineTagBase {
29 private readonly _codeDestination;
30 private _urlDestination;
31 private readonly _urlDestinationExcerpt;
32 private readonly _spacingAfterDestinationExcerpt;
33 private readonly _pipeExcerpt;
34 private readonly _spacingAfterPipeExcerpt;
35 private _linkText;
36 private readonly _spacingAfterLinkTextExcerpt;
37 private readonly _linkTextExcerpt;
38 /**
39 * Don't call this directly. Instead use {@link TSDocParser}
40 * @internal
41 */
42 constructor(parameters: IDocLinkTagParameters | IDocLinkTagParsedParameters);
43 /** @override */
44 get kind(): DocNodeKind | string;
45 /**
46 * If the link tag refers to a declaration, this returns the declaration reference object;
47 * otherwise this property is undefined.
48 * @remarks
49 * Either the `codeDestination` or the `urlDestination` property will be defined, but never both.
50 */
51 get codeDestination(): DocDeclarationReference | undefined;
52 /**
53 * If the link tag was an ordinary URI, this returns the URL string;
54 * otherwise this property is undefined.
55 * @remarks
56 * Either the `codeDestination` or the `urlDestination` property will be defined, but never both.
57 */
58 get urlDestination(): string | undefined;
59 /**
60 * An optional text string that is the hyperlink text. If omitted, the documentation
61 * renderer will use a default string based on the link itself (e.g. the URL text
62 * or the declaration identifier).
63 *
64 * @remarks
65 *
66 * In HTML, the hyperlink can include leading/trailing space characters around the link text.
67 * For example, this HTML will cause a web browser to `y` and also the space character before
68 * and after it:
69 *
70 * ```html
71 * x<a href="#Button"> y </a> z
72 * ```
73 *
74 * Unlike HTML, TSDoc trims leading/trailing spaces. For example, this TSDoc will be
75 * displayed `xy z` and underline only the `y` character:
76 *
77 * ```
78 * x{@link Button | y } z
79 * ```
80 */
81 get linkText(): string | undefined;
82 /** @override */
83 protected getChildNodesForContent(): ReadonlyArray<DocNode | undefined>;
84}
85//# sourceMappingURL=DocLinkTag.d.ts.map
\No newline at end of file