Skip to content

memberHref

Build the href for a member, pointing to the parent type’s page if inherited

Import:

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

Signature:

function memberHref(memberSlugString: string, inheritedFrom: string, allTypes: Map<string, TypeInfo>, currentNamespace: string | undefined): string

Parameters:

Parameter Type Description
memberSlugString string The member’s route segment.
inheritedFrom string The name of the type the member is inherited from, or an empty string for an own member.
allTypes Map<string, TypeInfo> Every documented type, keyed by $\{namespace\}#$\{name\}.
currentNamespace string | undefined The namespace of the referencing page, preferred when the name is ambiguous.

Returns: string — The link, or an empty string when no page documents the member.