@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
24 lines • 1.08 kB
text/typescript
export type StoreAtMode = 'canonical' | 'import' | 'flat';
export interface ProcessImportsResult {
processedSource: string;
extraFiles: Record<string, string>;
}
/**
* Processes imports based on the specified storage mode, automatically handling
* source rewriting when needed (e.g., for 'flat' mode). Works for both JavaScript and simple file types.
*
* @param source - The original source code
* @param importResult - The result from parseImports
* @param storeAt - How to process the imports
* @param isJsFile - Whether this is a JavaScript file (false = basic processing for CSS/JSON/etc.)
* @param resolvedPathsMap - Map from import paths to resolved file paths (only needed for JavaScript files)
* @returns Object with processed source and extraFiles mapping
*/
export declare function processRelativeImports(source: string, importResult: Record<string, {
url: string;
names: string[];
positions?: Array<{
start: number;
end: number;
}>;
}>, storeAt: StoreAtMode, isJsFile?: boolean, resolvedPathsMap?: Map<string, string>): ProcessImportsResult;