import { ComponentType } from 'react'; import { Context } from 'react'; import { ImgHTMLAttributes } from 'react'; import { MouseEvent as MouseEvent_2 } from 'react'; import { ProcedureInput } from '@voltro/client'; import { ProcedureOutput } from '@voltro/client'; import { ProcedureTypeMap } from '@voltro/client'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { Ref } from 'react'; import { ResolvableHeaders } from '@voltro/client'; import { Rpc } from '@effect/rpc'; import { RpcGroup } from '@effect/rpc'; /** Decision outcome for a document-level anchor click. */ export declare type AnchorNavigationDecision = { readonly kind: 'spa'; readonly to: string; } | { readonly kind: 'native'; }; /** * Map of api name → resolved typed rpc client. Installed by the * framework's mount() bootstrap. Consumers read it via useAppClient(). */ export declare type AppClients = ReadonlyMap; export declare const AppClientsContext: Context; /** Render a deferred loader value behind a streamed `` boundary. */ export declare const Await: ({ value, fallback, children, errorFallback }: AwaitProps) => ReactNode; export declare interface AwaitProps { /** A deferred field off `useLoaderData()`. */ readonly value: Promise; /** Rendered until the value arrives. This is what the STREAMED SHELL * contains, so keep it cheap and layout-stable. */ readonly fallback: ReactNode; /** Rendered with the resolved value. */ readonly children: (value: T) => ReactNode; /** Rendered if the deferred promise REJECTS. Without it a rejection * propagates to the route's `error.tsx` and takes the whole page with it — * usually the wrong trade for a subtree that was deferred precisely * because it is optional. */ readonly errorFallback?: ReactNode; } /** A navigation the blocker is holding back. `retry()` proceeds with the * original navigation; `reset()` cancels it and clears the block. */ export declare interface BlockedNavigation { /** The `to` argument of the held-back `navigate` call. */ readonly to: string; /** The options of the held-back call (e.g. `{ replace: true }`). */ readonly opts?: NavigateOptions; /** Proceed with the blocked navigation (bypasses the guard once). */ readonly retry: () => void; /** Cancel the blocked navigation and return to the idle state. */ readonly reset: () => void; } /** A registered navigation guard. Returns `true` to BLOCK the pending * navigation. `to`/`opts` describe where the user is trying to go. */ export declare type BlockerFn = (next: { readonly to: string; readonly opts?: NavigateOptions; }) => boolean; /** The state a `useBlocker` returns. `blocked` is `false` until a navigation * is held back; when true, `retry()`/`reset()` proceed or cancel it. */ export declare type BlockerState = { readonly blocked: false; } | { readonly blocked: true; /** Where the user is trying to go. */ readonly to: string; /** Proceed with the held-back navigation. */ readonly retry: () => void; /** Cancel the held-back navigation. */ readonly reset: () => void; }; /** A breadcrumb entry — the last one is rendered as the current page. */ export declare interface BlogBreadcrumb { readonly label: string; readonly href?: string; } /** * The blog/changelog content shell. Centered max-width container with a * sticky header (brand + top nav), optional breadcrumbs, and an optional * footer. */ export declare const BlogLayout: (props: BlogLayoutProps) => ReactNode; export declare interface BlogLayoutProps { readonly brand: ReactNode; readonly topNav: ReadonlyArray; readonly children: ReactNode; /** Active path for top-nav + breadcrumb highlighting. */ readonly pathname?: string; /** Optional node pinned to the right of the header, after the nav — e.g. a * language switcher or action buttons. */ readonly headerRight?: ReactNode; /** Router link component (e.g. `PlainLink` from @voltro/web). */ readonly Link?: ComponentType; readonly footer?: ReactNode; readonly breadcrumbs?: ReadonlyArray; } /** Minimal shape a link component must satisfy (matches PlainLinkProps). */ export declare interface BlogLinkProps { readonly to: string; readonly children: ReactNode; readonly className?: string; } /** A top-nav entry. */ export declare interface BlogNavItem { readonly label: string; readonly href: string; } export declare interface BrowserConsoleBridge { /** Restore `console.*`, flush pending entries one last time. */ readonly dispose: () => void; } export declare interface BrowserConsoleBridgeOptions { /** URL the CLI mounts `/_voltro/inspect/clientLog` on. Pass the * same origin the page is loaded from in the common case * (`window.location.origin`); the CLI's webDev middleware accepts * it without CORS preflight. */ readonly baseUrl: string; /** Voltro app name (the `name:` from `app.config.ts`). Carried in * every batch so multi-app dev setups can attribute log lines. */ readonly appName: string; /** Override flush interval (default 400ms). Mainly for tests. */ readonly flushAfterMs?: number; } /** Absolute canonical URL for a page. Relative paths are also valid in a * `` (crawlers resolve them against the document base), * but an absolute one is unambiguous across environments — pass the production * `siteUrl` and the page's root-relative `path`. */ export declare const canonicalUrl: (siteUrl: string, path: string) => string; /** * Structured result of running a route's loaders: the page (leaf) loader's * data plus each chain segment's loader data, keyed by segment index. */ export declare interface ChainLoaderData { readonly page: unknown; readonly segments: Readonly>; } declare interface CompiledRoute extends PageDescriptor { readonly regex: RegExp; /** Names of capture groups, in match order. Catch-all params capture * a `/`-joined string of the remaining path segments. */ readonly paramNames: ReadonlyArray; /** Sort priority — lower wins. Static segments rank above dynamic, * dynamic above catch-all. Ensures `/users/me` beats `/users/[id]` and * both beat `/users/[...rest]`. */ readonly priority: number; } export declare const compileRoute: (route: PageDescriptor) => CompiledRoute; /** The English defaults. A deployment overrides any subtree via * {@link FallbackStringsProvider} or a per-component `strings` prop; * unspecified keys fall through to these. */ export declare const defaultFallbackStrings: FallbackStrings; /** * Split a loader's result into data that blocks the shell and data that * streams in after it. * * Legal in a PAGE loader on `renderMode: 'ssr'` + `interactive: 'full'`, and in * a LAYOUT loader that also serves a `renderMode:'spa'` page under it (the SSR * layout shell — streamed per request by `voltro dev` / `voltro serve`). Every * other combination is a hard boot/build error naming the page, because there * is no honest way to stream into a stored artefact or into a document with no * React runtime. See {@link assertDeferralSupported}. * * Deliberately NOT a `const` type parameter: a loader's `{ title: 'Ok' }` must * widen to `string`, the way any other loader's return type does. Pinning the * literal would make every page's data type change whenever a default string * in the loader changed. * * @param eager values already resolved (or awaited by the loader itself) * @param deferred promises — NOT awaited by the loader */ export declare const defer: >>(eager: TEager, deferred: TDeferred) => DeferredLoaderResult; /** Brand key on the object `defer()` returns. A single explicit container * check — NOT a scan of arbitrary loader results for markers by shape. */ declare const DEFERRED_RESULT_TAG: "__voltroDeferredLoaderResult"; /** What a loader returns when it defers part of its data. Opaque to user * code: build it with {@link defer}, read it with `useLoaderData()`. */ export declare interface DeferredLoaderResult> = Record>> { readonly [DEFERRED_RESULT_TAG]: true; /** Awaited before the shell renders — present in the SSR markup AND in the * inlined `__voltro_state__` payload. */ readonly eager: TEager; /** Streamed after the shell — each key becomes a promise on * `useLoaderData()`, to be rendered through ``. */ readonly deferred: TDeferred; } export declare interface DevStatus { /** Stable id; re-pushing the same id replaces the entry (lets a * caller update its label without dropping + re-creating). */ readonly id: string; readonly kind: DevStatusKind; /** Short label rendered inside the pill, e.g. "Compiling…". Kept * under ~24 chars so the pill stays visually compact. */ readonly label: string; } export declare type DevStatusKind = 'compiling' | 'loading' | 'reconnecting' | 'error'; export declare interface ErrorBoundaryProps { readonly error: unknown; readonly reset: () => void; } declare const EXTERNAL_URL_BRAND: unique symbol; /** * Escape-hatch for any URL the codegen can't model: cross-origin * (`https://example.com`), `mailto:`, `tel:`, hash-only (`#section`), * or a sibling-app route the workspace scanner missed. * * The wrapper is a no-op at runtime — the brand exists purely for * compile-time `` checks. The point is to force a deliberate * choice at the call-site instead of letting any string slip past. */ export declare const externalUrl: (url: string) => VoltroExternalUrl; /** Every user-facing string the shipped fallback chrome renders. Scalars are * literals; anything that interpolates a value is a function so a locale can * reorder. English defaults live in {@link defaultFallbackStrings}. */ export declare interface FallbackStrings { /** — the runtime-error diagnostic card. */ readonly error: { /** The muted brand tag at the top-right of the card. */ readonly brandTag: string; /** The collapsible stack-trace disclosure summary. */ readonly stackTrace: string; /** Primary action — in-place ErrorBoundary reset. */ readonly retry: string; /** Secondary action — hard `window.location.reload()`. */ readonly reload: string; /** Copy-to-clipboard button, idle label. */ readonly copy: string; /** Copy button label after a successful clipboard write. */ readonly copied: string; /** Copy button label after BOTH clipboard paths failed (points at the * revealed manual-select block). */ readonly copyFailed: string; /** The footer hint's bold heading. */ readonly serverContextHeading: string; /** The footer hint prose. `command` is the pre-formatted `` element * for `voltro logs --since 30s` — a locale reorders the sentence around * it but never translates the command itself. */ readonly serverContextHint: (command: ReactNode) => ReactNode; }; /** — the route-miss (404) card. */ readonly notFound: { /** The pill tag at the top of the card. */ readonly badge: string; /** The headline. */ readonly heading: string; /** The body prose. `path` is the current pathname ``, `pagesDir` the * `*.page.tsx` `` — a locale reorders the sentence around both. */ readonly body: (path: ReactNode, pagesDir: ReactNode) => ReactNode; }; } /** Provide localized (or otherwise overridden) fallback strings to the shipped * default ErrorBoundary / NotFound chrome below. Overrides are deep-merged onto * the English defaults — supply only the sections/keys you change. Nesting * providers merges onto the parent. */ export declare function FallbackStringsProvider(props: { readonly strings: PartialFallbackStrings; readonly children: ReactNode; }): ReactNode; /** * Pick the not-found descriptor whose prefix is the longest match for * `pathname`. `''` (root) always matches as a last resort. Returns null * only if there are no descriptors at all. */ export declare const findNotFound: (notFounds: ReadonlyArray, pathname: string) => NotFoundDescriptor | null; /** Browser-style printf substitution over a console call's args. Exported * for direct unit coverage; the bridge below is its only runtime caller. */ export declare const formatPrintf: (args: ReadonlyArray) => FormattedCall; declare interface FormattedCall { readonly message: string; readonly rest: ReadonlyArray; } /** * Look up a registered island Component by name. Returns undefined if * the name isn't registered (typically means the user forgot to import * the island file in this bundle). */ export declare const getIslandComponent: (name: string) => ComponentType | undefined; /** Read the latest snapshot. Returns a frozen-ish reference safe to * use as a `useSyncExternalStore` getSnapshot result. */ export declare const getRouteSnapshot: () => RouteSnapshot; /** Read the current set of statuses. Returns a STABLE reference — * same array until the next mutation, so the result is safe to use * as a `useSyncExternalStore` snapshot. */ export declare const getStatuses: () => ReadonlyArray; /** * Client-side runtime: scan the document for `[data-voltro-island]` * markers and schedule each for hydration per its strategy. Called once * at mount time by `@voltro/web/mount` when the page declares * `interactive: 'islands'`. Idempotent — running twice is a no-op (we * mark elements as visited). */ export declare const hydrateIslandsOnPage: () => void; export declare type HydrateStrategy = /** Hydrate as soon as the client runtime mounts (after main script load). */ 'load' /** Hydrate when the browser is idle (via `requestIdleCallback`, with a * setTimeout fallback for browsers that lack it). */ | 'idle' /** Hydrate when the element scrolls into the viewport (IntersectionObserver). */ | 'visible' /** Hydrate on the first pointer / keyboard interaction with the element. */ | 'interaction' /** Never hydrate. Useful for fully-static islands (e.g. SSR-only data * display that never changes). */ | 'never'; declare const Image_2: ({ src, alt, width, height, fill, sizes, priority, loader, placeholder, blurDataURL, style, ...rest }: ImageProps) => ReactElement; export { Image_2 as Image } /** App-level default loader for every `` below it. A per-image * `loader` prop overrides this. */ export declare const ImageConfigProvider: ({ loader, children, }: { readonly loader: ImageLoader; readonly children: ReactNode; }) => ReactElement; /** Maps a logical src + a target pixel width to a concrete URL. The hook * for on-the-fly resizing — e.g. `({src,width}) => \`${src}?w=${width}\`` * against an image CDN or the storage serve endpoint. */ export declare type ImageLoader = (params: { readonly src: string; readonly width: number; }) => string; export declare interface ImageProps extends Omit, 'src' | 'width' | 'height' | 'loading' | 'srcSet'> { readonly src: string; /** Required — accessibility. Use `alt=""` for purely decorative images. */ readonly alt: string; /** Intrinsic width in px. Required unless `fill`. */ readonly width?: number; /** Intrinsic height in px. Required unless `fill`. */ readonly height?: number; /** Absolutely fill the nearest positioned ancestor (object-fit: cover). * Use instead of width/height when the container sizes the image. */ readonly fill?: boolean; /** `sizes` media hint, e.g. `(max-width:768px) 100vw, 50vw`. Defaults to * `100vw` under `fill`. */ readonly sizes?: string; /** Above-the-fold / LCP image: eager-load + high fetch priority. */ readonly priority?: boolean; /** Per-image URL loader (overrides the ImageConfigProvider default). */ readonly loader?: ImageLoader; /** `'blur'` paints `blurDataURL` behind the image until it loads. */ readonly placeholder?: 'blur' | 'empty'; readonly blurDataURL?: string; } export declare const installBrowserConsoleBridge: (options: BrowserConsoleBridgeOptions) => BrowserConsoleBridge; export declare const installServerLogRelay: (options: ServerLogRelayOptions) => ServerLogRelay; /** * How the client-side JS hydrates a server-rendered page. * * - 'full' — Hydrate the entire page tree as one React root. * Default for `'spa'` pages and the safe default for * `'static'` pages that haven't been thought through. * Subscriptions + interactivity work everywhere. * - 'islands' — Skip the full-tree hydration. The client runtime * only hydrates `
` markers * emitted by `island()`. Other parts of the page stay * pure static HTML with no React lifecycle running. * Best perf for content-heavy pages with isolated * interactive zones. * * Defaults to `'full'` when not specified. */ export declare type InteractiveMode = 'full' | 'islands' | 'none'; /** True for exactly the object {@link defer} returns. */ export declare const isDeferredLoaderResult: (value: unknown) => value is DeferredLoaderResult; /** * Wrap a Component as an island. The returned Component renders the * inner content wrapped in a marker `
` that * carries the island's name + props + hydrate strategy. The same * call also registers the Component under its name so the client * runtime can find it when hydrating. */ export declare const island:

>(Component: ComponentType

, options: IslandOptions) => ComponentType

; export declare interface IslandOptions { /** Stable id of this island. Must be unique within an app. The framework * uses it to match the server-rendered marker with the client-side * Component. */ readonly name: string; /** When the client runtime should hydrate this island. Defaults to * `visible` — matches Astro's default and is the best perf/UX balance. */ readonly hydrate?: HydrateStrategy; } /** Brand guard — true for any `NotFoundError`, even one minted by a * duplicate class identity in another bundle. */ export declare const isNotFound: (e: unknown) => e is NotFoundError; /** Brand guard — true for any `RedirectError`, even cross-bundle. */ export declare const isRedirect: (e: unknown) => e is RedirectError; /** Join an origin (`https://example.com`, optionally with a trailing slash) to a * root-relative path, collapsing the slash seam so exactly one separates them. */ export declare const joinUrl: (siteUrl: string, path: string) => string; /** Lazy variant of `pageRoute`: takes a thunk that dynamically imports the page * instead of an already-imported module. The chunk loads only when the route * first matches — the initial bundle no longer pulls in every page. */ export declare const lazyPageRoute: (pattern: string, load: () => Promise>, extras?: { readonly chain?: ReadonlyArray; }) => PageDescriptor; export declare const Link: ({ to, children, onClick, prefetch: prefetchProp, replace, onMouseEnter, onFocus, ref, ...anchorProps }: LinkProps) => ReactNode; export declare interface LinkProps extends Omit, 'href' | 'onClick'> { readonly to: VoltroUrl; readonly children: ReactNode; readonly onClick?: (event: MouseEvent_2) => void; /** When and how to pre-warm the destination. See {@link PrefetchMode}. */ readonly prefetch?: PrefetchMode; /** Swap the current history entry instead of pushing a new one — * mirror of `NavigateOptions.replace`. */ readonly replace?: boolean; /** * Forwarded to the underlying ``. * * It already WAS, at runtime — every prop this component does not consume * itself is spread onto the anchor, `ref` included, and React 19 passes it to * a function component as an ordinary prop. Only the type did not say so, and * `AnchorHTMLAttributes` does not carry `ref`. So any polymorphic slot that * threads one through — MUI's `