> ## Documentation Index
> Fetch the complete documentation index at: https://mint-tsdocs.saulo.engineer/llms.txt
> Use this file to discover all available pages before exploring further.

# writeLinkTagWithCodeDestination

> Writes a link tag that references code entities (API items). Overrides parent implementation to: 1. Resolve API references via ApiModel with caching 2. Generate markdown links to resolved items' documentation pages 3. Use scoped names as link text when not explicitly provided

export const RefLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('RefLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-reflink broken-link" title="Invalid RefLink target" data-component="tsdocs-reflink">Invalid Link</span>;
  }
  const linkText = children || target;
  const path = typeof window !== 'undefined' && window.getRefPath ? window.getRefPath(target) : `./${target.split('.').filter(s => s.length > 0).join('/')}`;
  const isValid = typeof window !== 'undefined' && window.VALID_REFS && window.VALID_REFS.has(target);
  const className = !isValid ? 'tsdocs-reflink broken-link' : 'tsdocs-reflink';
  const title = !isValid ? `Broken API reference: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-reflink">
      {linkText}
    </a>;
};

export const PageLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('PageLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-pagelink broken-link" title="Invalid PageLink target" data-component="tsdocs-pagelink">Invalid Link</span>;
  }
  const linkText = children || target;
  let path = target;
  if (!path.startsWith('/')) {
    path = `/${target}`;
  }
  const isValid = typeof window !== 'undefined' && window.VALID_PAGES && window.VALID_PAGES.has(target);
  const className = !isValid ? 'tsdocs-pagelink broken-link' : 'tsdocs-pagelink';
  const title = !isValid ? `Broken page link: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-pagelink">
      {linkText}
    </a>;
};

# writeLinkTagWithCodeDestination

## Summary

Writes a link tag that references code entities (API items).  Overrides parent implementation to: 1. Resolve API references via ApiModel with caching 2. Generate markdown links to resolved items' documentation pages 3. Use scoped names as link text when not explicitly provided

## Signature

```typescript theme={null}
protected writeLinkTagWithCodeDestination(docLinkTag: DocLinkTag, context: IMarkdownEmitterContext<ICustomMarkdownEmitterOptions>): void;
```

## Parameters

### docLinkTag

**Type**:`DocLinkTag`

The link tag to write

### context

**Type**:<RefLink target="mint-tsdocs.IMarkdownEmitterContext">`IMarkdownEmitterContext<ICustomMarkdownEmitterOptions>`</RefLink>

Emission context with options containing contextApiItem and filename resolver

## Returns

**Type**:`void`

Writes a link tag that references code entities (API items).Overrides parent implementation to: 1. Resolve API references via ApiModel with caching 2. Generate markdown links to resolved items' documentation pages 3. Use scoped names as link text when not explicitly provided

## Remarks

Uses ApiResolutionCache for performance. Cache hit rates are typically 90% during documentation generation due to repeated references to common types.  If resolution fails, logs a debug warning but doesn't write anything (fails silently). This is intentional - unresolvable references are usually external types or errors in the source TSDoc.
