@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
15 lines • 982 B
text/typescript
import type { UseStreamControllerOptions, UseStreamControllerResult } from "./types.mjs";
/**
* Scope a group of chunks so the page can tell when they have all loaded.
*
* Returns a `Controller` provider to wrap the chunks in - it supplies the
* controller's gate as the ambient gate (via `CoordinatedGateContext`), so
* chunks rendered inside register their swap with it through `CoordinatedLazy`
* without a `gate` prop - and a reactive `loading` flag that stays `true` until
* every registered chunk settles. Completion resolves via the gate's
* **known-count** (`knownCount`) or **last-chunk** (`streaming` + `markLast`)
* signals; with neither, it opens as soon as the chunks present in the initial
* commit all settle. Each chunk also registers with the page-global gate (via
* `CoordinatedLazy`), so a page-wide coordinated commit waits for them too.
*/
export declare function useStreamController(options?: UseStreamControllerOptions): UseStreamControllerResult;