@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
24 lines • 1.3 kB
text/typescript
import type { Root as HastRoot } from 'hast';
import type { SourceComments, SourceEnhancer, SourceEnhancers } from "../../CodeHighlighter/types.mjs";
/**
* Records on the HAST root that an enhancer with this name has been applied,
* so subsequent passes can skip it. No-op when the enhancer has no
* `enhancerName`.
*/
export declare function recordEnhancerApplied(root: HastRoot, enhancer: SourceEnhancer): void;
/**
* Returns true if the enhancer has a stable name that already appears in
* `root.data.appliedEnhancers`. Anonymous enhancers (no `enhancerName`) are
* never skipped.
*/
export declare function shouldSkipEnhancer(root: HastRoot, enhancer: SourceEnhancer): boolean;
/**
* Runs a single enhancer with the skip/record bookkeeping. Returns the
* (possibly unchanged) root; awaits the enhancer when it returns a promise.
*/
export declare function applyEnhancer(root: HastRoot, comments: SourceComments | undefined, fileName: string, enhancer: SourceEnhancer): Promise<HastRoot>;
/**
* Runs the enhancer pipeline sequentially, skipping any enhancer whose
* `enhancerName` is already recorded on the HAST root.
*/
export declare function applyEnhancers(root: HastRoot, comments: SourceComments | undefined, fileName: string, enhancers: SourceEnhancers): Promise<HastRoot>;