UNPKG

@mui/internal-docs-infra

Version:

MUI Infra - internal documentation creation tools.

29 lines 1.75 kB
import type * as EditingEngine from "./EditingEngine.mjs"; /** The resolved editing-engine module: `createEditableEngine` + source-editing fns. */ export type EditingEngineModule = typeof EditingEngine; /** * Resolves the live-editing engine module. `CodeProvider` supplies one via * context (eager → bundled, resolves instantly; lazy → dynamic `import()`); * `useEditable` / `useSourceEditing` also have the built-in default below so * editing works without a provider. */ export type EditingEngineLoader = () => Promise<EditingEngineModule>; /** Built-in loader, used when no provider supplies an `editingEngineLoader`. */ export declare const defaultEditingEngineLoader: EditingEngineLoader; /** Synchronously reads the cached module, or `undefined` if not yet resolved. */ export declare function peekEditingEngine(): EditingEngineModule | undefined; /** * Resolves the editing-engine module (from the warm cache, else via the loader) * and caches it. Returns the cached value synchronously when warm. Rejects if * the load fails; callers decide whether to surface or swallow that. */ export declare function loadEditingEngine(loader?: EditingEngineLoader): EditingEngineModule | Promise<EditingEngineModule>; /** * Eagerly resolves and caches the editing-engine module so the next editable * block attaches (and the first edit commits) synchronously instead of after a * load round-trip. Fire-and-forget — fails open. Pass the provider's * `editingEngineLoader` to share its page-wide deduplication. */ export declare function preloadEditingEngine(loader?: EditingEngineLoader): Promise<void>; /** Clears the cache so the next resolve loads from scratch. For tests. */ export declare function resetEditingEngineCache(): void;