/** * Server-side readers for published content. * * These live in the SDK rather than the scaffolded app because they carry the * invariants that keep public routes cacheable and correct: initialization is * awaited per read so a failed cold start can recover, a miss is reported * distinctly from an outage so it can become a real 404 instead of a cached * 200, internal document namespaces are refused before they can render as * public pages, and prerendering is aborted rather than baking an empty page * into the build. A renderer that gets any of those wrong fails in ways that * only show up under CDN caching or a backend blip. * * How a miss is presented — the copy, the styling, the editor links — is the * app's business, and stays in the app. */ import type { Data } from "@puckeditor/core"; /** * Outcome of a published-page read. * * `missing` and `unavailable` are deliberately separate. A miss is a real 404 — * the caller should say so, so crawler traffic is not cached as a wall of * 200-status "doesn't exist yet" pages. An outage is not: 404ing a published * page because the backend blipped would deindex live content, so the caller * should keep serving a non-cacheable holding page instead. */ export type PublishedPageResult = { status: "ok"; data: Data; } | { status: "missing"; } | { status: "unavailable"; }; /** * Options for a published-page read. */ export type LoadPublishedPageOptions = { /** * Extra path prefixes to refuse, added to the built-in list rather than * replacing it. Additive on purpose: a site that needs its own internal * namespace should not be able to un-block `/_registry` by supplying a * shorter list. */ internalPathPrefixes?: readonly string[]; }; /** * Published Puck data for `path`. * * Internal namespaces report `missing` without reaching the backend, so a * renderer that carries no denylist of its own still 404s them. */ export declare function loadPublishedPage(path: string, options?: LoadPublishedPageOptions): Promise; /** * Collection template keys for the current render. * * Memoized with cache(): metadata resolution and the page body each need them, * and each call lists every key in the store. */ export declare const loadRouteTemplateKeys: () => Promise;