@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
26 lines • 1.7 kB
text/typescript
import type { LoadFallbackCodeFn, LoadVariantFn, ComputeHastDeltasFn } from "./CodeContext.mjs";
import type { EditingEngineModule } from "../useCode/editingEngineCache.mjs";
import type { CreateTransformedFiles } from "../useCode/TransformEngine.mjs";
/**
* Preload keys + dynamic-import factories for CodeHighlighter's heavy functions.
*
* Shared by `CodeProvider` (which exposes them as lazy context accessors) and
* `CodeHighlighterClient` (which speculatively preloads them on first render).
* Using the identical `key -> factory` pair on both sides lets `PreloadProvider`
* dedupe to a single fetch per page - the speculative preload and the eventual
* consumer resolve the same promise.
*
* The `import()`s are inside the factories, so importing this module is cheap:
* the heavy modules (and their transitive deps like jsondiffpatch) only load
* when a factory is actually invoked.
*/
export declare const PRELOAD_KEY_LOAD_VARIANT = "docs-infra/loadIsomorphicCodeVariant";
export declare const PRELOAD_KEY_LOAD_FALLBACK = "docs-infra/loadCodeFallback";
export declare const PRELOAD_KEY_COMPUTE_DELTAS = "docs-infra/computeHastDeltas";
export declare const loadVariantFactory: () => Promise<LoadVariantFn>;
export declare const loadFallbackFactory: () => Promise<LoadFallbackCodeFn>;
export declare const computeHastDeltasFactory: () => Promise<ComputeHastDeltasFn>;
export declare const PRELOAD_KEY_EDITING = "docs-infra/editingEngine";
export declare const editingEngineFactory: () => Promise<EditingEngineModule>;
export declare const PRELOAD_KEY_TRANSFORM_ENGINE = "docs-infra/transformEngine";
export declare const transformEngineFactory: () => Promise<CreateTransformedFiles>;