Skip to content

renderTypeWithLinks

Render a type string with clickable links for known types

Import:

import { renderTypeWithLinks } from '@mnaoumov/typescript-dev-toolkit/docs-site/api-doc-link-rendering';

Signature:

function renderTypeWithLinks(typeText: string, allTypes: Map<string, TypeInfo>, selfTypeName: string | undefined, selfNamespace: string | undefined): string

Parameters:

Parameter Type Description
typeText string The type text.
allTypes Map<string, TypeInfo> Every documented type, keyed by $\{namespace\}#$\{name\}.
selfTypeName string | undefined The name of the type the page documents, which this links to.
selfNamespace string | undefined The namespace of the page being rendered, preferred when a name is ambiguous.

Returns: string — The type text with markdown links.