@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
41 lines • 1.61 kB
text/typescript
import type { ElementContent } from 'hast';
import type { LanguageCapabilities } from "./getLanguageCapabilities.mjs";
import type { ScanState, ModuleLinkMapEntry } from "./scanState.mjs";
/**
* Options passed to enhanceChildren for cleaner signatures.
*/
export interface EnhanceOptions {
linkMap: Record<string, string>;
typeRefComponent?: string;
typePropRefComponent?: string;
typeParamRefComponent?: string;
typeValueRefComponent?: string;
linkProps?: 'shallow' | 'deep';
linkParams?: boolean;
linkScope?: boolean;
linkValues?: boolean;
linkArrays?: boolean;
moduleLinkMap?: Record<string, ModuleLinkMapEntry>;
defaultImportSlug?: string;
lang: LanguageCapabilities;
}
/**
* Single-pass function that enhances children by:
* 1. Linking type/export name spans (chains) to their anchors
* 2. Tracking owner context for property linking
* 3. Wrapping property names (spans or plain text) with prop ref elements
*
* State is threaded through recursive calls so context flows across
* nested frame/line elements.
*/
export declare function enhanceChildren(children: ElementContent[], options: EnhanceOptions, state: ScanState): ElementContent[];
/**
* Resets all import-related state flags.
*/
/**
* Wraps the expression nodes in `newChildren` from `startChildIndex` to the end
* (excluding the trailing `;` or `\n`) in a value-ref element.
* Called after processTextNode detects a statement boundary that flushed a
* pending expression.
*/
export declare function wrapExpressionNodes(newChildren: ElementContent[], state: ScanState, options: EnhanceOptions): void;