@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
24 lines • 1.35 kB
TypeScript
import type { LoadCodeMeta } from "../../CodeHighlighter/types.js";
export interface CreateLoadCodeMetaOptions {}
/**
* Default loadServerCodeMeta function that resolves variant paths from demo files.
* This function is used to load code metadata for demos, specifically resolving paths for variants defined in the demo files.
* It reads the demo file, parses it to find `createDemo` calls with variants, and resolves the paths for those variants.
* It returns a Code object mapping variant names to their resolved file URLs.
*/
export declare const loadServerCodeMeta: LoadCodeMeta;
/**
* Creates a loadCodeMeta function that resolves variant paths from demo files.
*
* This factory function creates a LoadCodeMeta implementation that:
* 1. Parses the demo file to find createDemo calls with variants
* 2. Resolves all variant entry point paths using resolveVariantPaths
* 3. Returns a Code object mapping variant names to their resolved file URLs
*
* The actual loading, parsing, and transformation of the variants is handled
* elsewhere by the CodeHighlighter component using loadVariant.
*
* @param options - Configuration options (currently unused)
* @returns LoadCodeMeta function that takes a URL and returns Promise<Code>
*/
export declare function createLoadServerCodeMeta(_options?: CreateLoadCodeMetaOptions): LoadCodeMeta;