settleCapture
The whole capture settle, for every surface that shoots a page: the CLI's screenshot and print-preview routes and the render worker.
The whole capture settle, for every surface that shoots a page: the CLI’s screenshot and print-preview routes and the render worker. One function rather than a recipe each host retypes, because the legs and their ORDER are the contract — a surface that waits differently flattens different pixels than the artifact its preview promised.
Every page gets, in order:
- hydration complete — island pages only. The host’s readiness promise, FIRST, before the font/decode pass below: an island’s DOM does not exist until it mounts, so a decode pass run before hydration measures a document the artifact will not contain, and every image an island renders would go unwaited.
- fonts, images, rAF — the standing readiness pair, over the (hydrated) DOM.
- network quiescence — host-observed, for whatever the page is still
fetching: an island’s tiles and glyph ranges, or a stylesheet’s own
off-origin refs, which no other leg waits for (a
background-imageis in no decode pass). Unconditional, because the egress contract — a FAILED external request fails the job — is only sound once nothing is still in flight. It is a wait for activity to stop, not a proof that what arrived is painted, and it detects nothing about a decoded image failing to raster — that class is contention between browsers over one machine, and no amount of settling reaches it. - animations landed — every finite animation fast-forwarded to its end state. Unconditional, and AFTER quiescence: a reveal fires at hydration, but a load reveal is pure CSS and an island-free page has them too. This is the leg that decides what a scroll-driven reveal contributes to the artifact, together with {@link CAPTURE_IN_VIEW_SCRIPT}, which is what made it fire at all.
- paint grace + rAF flush — an island engine’s own fades, then the tick that puts them on screen. An island-free page has no engine to fade and takes only the flush. The grace stays a constant beat because a canvas engine’s fades are its own, painted outside the animation timeline leg 4 can reach.
Legs 1 and 3 are bounded by {@link CAPTURE_ISLAND_SETTLE_TIMEOUT_MS} and fail naming themselves.
Import from @homepages/template-kit.
Signature
Section titled “Signature”function settleCapture(host: CaptureSettleHost): Promise<void>Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
host |
CaptureSettleHost |
required |
Returns
Section titled “Returns”Promise<void>
See also
Section titled “See also”captureViewportframeTokensprintPageSizeresolveFormatGeometryCAPTURE_HAS_ISLANDS_EXPRESSIONCAPTURE_ISLAND_PAINT_GRACE_EXPRESSIONCAPTURE_ISLAND_PAINT_GRACE_MSCAPTURE_ISLAND_QUIET_WINDOW_MSCAPTURE_ISLAND_SETTLE_TIMEOUT_MSCAPTURE_ISLANDS_READY_EXPRESSIONCAPTURE_ISLANDS_READY_GLOBALCAPTURE_READY_EXPRESSIONCAPTURE_WAIT_UNTILFRAME_ROOT_CLASSCaptureSettleHostCaptureViewportFormatIdentityFrameTokensPrintPageSizeResolvedFormatGeometryDocumentFormatImageFormatPhysicalLength