import React from "react";
import type { ComponentRef } from "@rebasepro/types";
/**
* Resolves a `ComponentRef` into a renderable `React.ComponentType`.
*
* This hook handles all three forms of `ComponentRef`:
*
* 1. **`LazyComponentRef`** (produced by the Vite plugin from string paths):
* Wraps the lazy loader with `React.lazy()` for automatic code-splitting.
*
* 2. **`() => Promise<{ default: ComponentType }>`** (manual lazy import):
* Also wraps with `React.lazy()`. Distinguished from regular components
* by checking that the function has no parameters and is not a known
* React internal (no `$$typeof`).
*
* 3. **Direct `React.ComponentType`**:
* Returned as-is.
*
* If the ref is `undefined` or a raw string (which should never happen at
* runtime in the browser since the Vite plugin transforms strings), returns `undefined`.
*
* The returned component is stable across re-renders as long as the `ref`
* is referentially stable.
*
* **Usage:** Wrap the rendered component in `
(ref: ComponentRef
| undefined): React.ComponentType
| undefined; /** * Pure function version of the resolver, for use outside React components. * Same resolution logic as `useResolvedComponent`. * * Results are cached per reference identity — calling this multiple times * with the same `ref` object returns the same `React.ComponentType`. */ export declare function resolveComponentRef
(ref: ComponentRef
| undefined): React.ComponentType
| undefined;