/** A per-directory module resolved by walking up from a route: the two error * boundaries, plus `loading` (the pending-navigation skeleton). */ export type BoundaryFile = "not-found" | "error" | "loading"; /** * Resolve the nearest `/` module for a route by walking its * component path up to the app root, returning the first key that exists. * Nearest ancestor wins — the same model the server's `findBoundary` uses, but * driven off client-side keys so the runtime needs no extra server round-trip. * * `component` is a cwd-relative path with "/" separators and no extension * (e.g. "web/app/dashboard/orgs/[slug]/page"). `keys` is the set to resolve * against: `Object.keys(manifest.routes)` for not-found/error, which ship as * route entries, or the loading registry's keys for `loading`, which ships in * the shared chunk instead. */ export declare function nearestBoundaryComponent(component: string, fileName: BoundaryFile, routeKeys: Iterable): string | null; /** * The URL-space directory a module sits in: its parent path with `(group)` * segments removed, since a group contributes no URL segment. * * `web/app/(marketing)/pricing/page` → `web/app/pricing`, and * `web/app/(marketing)/not-found` → `web/app`. That is what makes a group's * boundary resolve for `/` — matching the server, which walks the real * directories but treats group dirs as transparent the same way. */ export declare function boundaryScope(componentPath: string): string; /** Runtime internals the boundary needs, injected so the module stays * browser-safe AND unit-testable. */ export interface BoundaryDeps { /** Resolve the client build manifest (`{ routes: {...} }`). */ loadManifest: () => Promise<{ routes?: Record; } | null>; /** Dynamically load a route entry → its Page + Layout chain. */ loadRouteEntry: (component: string) => Promise<{ Page: any; Layouts: any[]; }>; /** Client-side navigation — used by an error boundary's reset(). */ navigate: (href: string, opts?: { replace?: boolean; }) => void; /** Wrap a Page in its Layout chain with props (the runtime's buildTree). */ buildTree: (Page: any, Layouts: any[], props: any) => any; /** The props the active page was rendered with (auth, serverData, …). */ getPageProps: () => any; /** Current same-origin href, for an error boundary's reset() re-navigation. */ getResetHref: () => string; } /** * Build the client error / not-found boundary against the runtime's internals. * Returns `withBoundary(tree, component, navEpoch)` — the transparent root * wrapper the runtime puts around every page — plus `PylonBoundary` for tests. * * Behavior: a `notFound()` (digest "PYLON_NOT_FOUND") or any error thrown * during a descendant's render is caught; the nearest not-found.tsx / error.tsx * for the active route is resolved from the manifest, loaded, and rendered in * its own layout chain WITH the page's props (so an auth-guarding layout sees * the real auth and doesn't redirect away). Resets on navigation via a changing * `navEpoch` prop — not a key — so layouts keep their state across nav. */ export declare function createPylonBoundary(deps: BoundaryDeps): { withBoundary: (tree: any, component: string, navEpoch: number) => import("react").CElement(state: { err: any; } | ((prevState: Readonly<{ err: any; }>, props: Readonly) => { err: any; } | Pick<{ err: any; }, K> | null) | Pick<{ err: any; }, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly; state: Readonly<{ err: any; }>; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{ err: any; }>, nextContext: any): boolean; componentWillUnmount?(): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{ err: any; }>): any; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{ err: any; }>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{ err: any; }>, nextContext: any): void; }>; PylonBoundary: { new (p: any): { componentDidUpdate(prev: any): void; componentDidCatch(err: any): void; render(): any; context: unknown; setState(state: { err: any; } | ((prevState: Readonly<{ err: any; }>, props: Readonly) => { err: any; } | Pick<{ err: any; }, K> | null) | Pick<{ err: any; }, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly; state: Readonly<{ err: any; }>; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{ err: any; }>, nextContext: any): boolean; componentWillUnmount?(): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{ err: any; }>): any; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{ err: any; }>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{ err: any; }>, nextContext: any): void; }; getDerivedStateFromError(err: any): { err: any; }; contextType?: import("react").Context | undefined; propTypes?: any; }; };