@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
25 lines • 1.33 kB
text/typescript
import type { Code, ParseSource } from "../../CodeHighlighter/types.mjs";
/**
* Pure function to identify which variants need transformation.
* Returns entries of variants that have transforms requiring processing.
*
* Skips variants whose transforms have already been embedded into
* `source.data.transforms` (i.e. already processed). Also requires at least
* one transform entry to still carry a `delta` — manifest-only entries
* (with `delta` stripped after embedding) are ignored.
*/
export declare function getVariantsToTransform(parsedCode: Code): Array<[string, any]>;
/**
* Pure async function to transform a single variant's code and extraFiles.
* Returns the transformed variant or the original if transformation fails.
*/
export declare function computeVariantDeltas(variant: string, variantCode: any, parseSource: ParseSource): Promise<any>;
/**
* Computes transform deltas for all variants in the parsed code.
* This function generates the transformation data that can be applied later.
*
* @param parsedCode - The parsed code object containing variants
* @param parseSource - The parser function to parse source strings
* @returns A promise that resolves to the code with computed transforms
*/
export declare function computeHastDeltas(parsedCode: Code, parseSource: ParseSource): Promise<Code>;