import type * as ReactTypes from 'react'; import { ReactiveSignal } from '../internals/reactive.js'; /** Marked on the outer wrapper returned by `component()` for async (generator) definitions. */ export declare const SIGNALIUM_ASYNC_COMPONENT: unique symbol; /** * Call from wrappers around `use()` if you might receive a Signalium async component by mistake. * React's `use()` does not support Signalium async `component()` wrappers — render them under * `` and use `await` inside the component (after the async transform) instead. */ export declare function throwIfSignaliumAsyncComponentPassedToUse(resource: unknown): void; export { isGeneratorFunction, isAsyncFunctionWithoutTransform } from './component-shared.js'; /** * Synchronous replay driver for async `component()` (authoring: `async`/`await`; Babel rewrites to a generator). * * Each React render starts a **new** iterator and walks it in a tight loop. Each `yield` (from * the compiled generator, originally `await`) is treated like `use(promise)` / Suspense: pending * thenables **throw** (interrupting the render); settled `ReactivePromise` values are injected via * `next(value)` and the loop continues in the same turn. * * **Hooks after a suspending `await`:** Same family as React `use()` — the throw aborts before * later code runs; the next attempt replays from the top. Do not use conditional hooks without * Suspense on paths that skip them. * * **Plain `Promise` / other thenables:** First time pending, **throw** for Suspense and register * the outcome in a `WeakMap` keyed by thenable identity. After settlement, the **same** object * replays inject the value (or throw the rejection) synchronously. Keep **stable thenable * identity** across replays (e.g. store in a ref). Thenables may expose React `use()`-style * `status` / `value` / `reason` for synchronous reads when present. * * **Generator `let` / `const`:** Reset every replay; durable state should use React hooks, refs, or * Signalium signals. * * `ownerSignal` is set as `CURRENT_CONSUMER` so reads inside the generator participate in the * reactive graph like `compute` in `runSignal`. */ export declare function runSyncReplayAsyncComponent

(fn: (props: P) => Generator, props: P, ownerSignal: ReactiveSignal): ReactTypes.ReactNode | ReactTypes.ReactNode[] | null; /** * Async Signalium `component()`: one lazy reactive signal per **instance** (same as sync * `component()`), outer `useMemo` keyed by `hashValue(props)`. No definition-scoped props map. */ export declare function createAsyncComponentWrapper

(fn: (props: P) => Generator): (props: P) => ReactTypes.ReactNode; //# sourceMappingURL=async-component.d.ts.map