UNPKG

1.4 kBTypeScriptView Raw
1import { type Comment, type CommentDisplayPart, Reflection, ReflectionSymbolId } from "../../models";
2import { type DeclarationReference } from "./declarationReference";
3export type ExternalResolveResult = {
4 target: string;
5 caption?: string;
6};
7/**
8 * @param ref - Parsed declaration reference to resolve. This may be created automatically for some symbol, or
9 * parsed from user input.
10 * @param refl - Reflection that contains the resolved link
11 * @param part - If the declaration reference was created from a comment, the originating part.
12 * @param symbolId - If the declaration reference was created from a symbol, or `useTsLinkResolution` is turned
13 * on and TypeScript resolved the link to some symbol, the ID of that symbol.
14 */
15export type ExternalSymbolResolver = (ref: DeclarationReference, refl: Reflection, part: Readonly<CommentDisplayPart> | undefined, symbolId: ReflectionSymbolId | undefined) => ExternalResolveResult | string | undefined;
16export type LinkResolverOptions = {
17 preserveLinkText: boolean;
18};
19export declare function resolveLinks(comment: Comment, reflection: Reflection, externalResolver: ExternalSymbolResolver, options: LinkResolverOptions): void;
20export declare function resolvePartLinks(reflection: Reflection, parts: readonly CommentDisplayPart[], externalResolver: ExternalSymbolResolver, options: LinkResolverOptions): CommentDisplayPart[];