@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
25 lines • 1.18 kB
TypeScript
import type { LoadSource } from "../../CodeHighlighter/types.js";
import { type StoreAtMode } from "../loaderUtils/processRelativeImports.js";
interface LoadSourceOptions {
maxDepth?: number;
maxFiles?: number;
includeDependencies?: boolean;
storeAt?: StoreAtMode;
}
/**
* Default loadServerSource function that reads a file and extracts its dependencies.
* This function is used to load source files for demos, resolving their imports and dependencies.
* It reads the source file, resolves its imports, and returns the processed source along with any
* additional files and dependencies that were found.
*/
export declare const loadServerSource: LoadSource;
/**
* Creates a loadSource function that reads a file and extracts its dependencies.
*
* @param options.storeAt - Controls how imports are stored in extraFiles:
* - 'canonical': Full resolved path (e.g., '../Component/index.js')
* - 'import': Import path with file extension (e.g., '../Component.js')
* - 'flat': Flattened to current directory with rewritten imports (e.g., './Component.js')
*/
export declare function createLoadServerSource(options?: LoadSourceOptions): LoadSource;
export {};