UNPKG

@mui/internal-docs-infra

Version:

MUI Infra - internal documentation creation tools.

37 lines 1.98 kB
import type { VariantSource, Transforms, SourceComments } from "../../CodeHighlighter/types.mjs"; import type { FallbackNode } from "../../CodeHighlighter/fallbackFormat.mjs"; /** * Applies a specific transform to a variant source and returns the transformed * source plus a remapped copy of the supplied `comments` map. See * {@link applyCodeTransformWithCommentsCore} for the full contract; this wrapper * binds the built-in `decodeHastSource`. * * @throws Error if the transform key doesn't exist or patching fails */ export declare function applyCodeTransformWithComments(source: VariantSource, transforms: Transforms, transformKey: string, comments?: SourceComments, fallback?: FallbackNode[]): { source: VariantSource; comments?: SourceComments; }; /** * Applies multiple transforms to a variant source in sequence, shifting * comments through each hop. See {@link applyCodeTransformsWithCommentsCore}; * this wrapper binds the built-in `decodeHastSource`. * * @throws Error if any transform key doesn't exist or patching fails */ export declare function applyCodeTransformsWithComments(source: VariantSource, transforms: Transforms, transformKeys: string[], comments?: SourceComments, fallback?: FallbackNode[]): { source: VariantSource; comments?: SourceComments; }; /** * Convenience wrapper around {@link applyCodeTransformWithComments} for * callers that don't need the shifted comments map. Returns the transformed * `VariantSource` directly. */ export declare function applyCodeTransform(source: VariantSource, transforms: Transforms, transformKey: string, fallback?: FallbackNode[]): VariantSource; /** * Convenience wrapper around {@link applyCodeTransformsWithComments} for * callers that don't need the shifted comments map. Returns the transformed * `VariantSource` directly. */ export declare function applyCodeTransforms(source: VariantSource, transforms: Transforms, transformKeys: string[], fallback?: FallbackNode[]): VariantSource;