import { routeActive, TimerOptions, WatchSource, WatchCallback, on, ActivityPredicate, ListenerTarget, capture, WatchValues, documentVisible, task, watch, WatchContext, windowFocused, timer, } from '../core.js'; /** Reactive result of a {@link resource}: current value, loading state, and controls. */ interface ResourceResult { value: T | null; pending: boolean; error: Error | null; refresh(): void; } /** Create a source-driven resource whose loader receives the latest source value. */ declare function resource( source: () => TSource, load: (value: TSource, opts: { signal: AbortSignal }) => PromiseLike | T ): ResourceResult; /** Creates a render-scoped async resource with cancellation and refresh; SSR has special data rules. */ declare function resource< T, const TDeps extends readonly unknown[] = readonly unknown[], >( fn: (opts: { signal: AbortSignal }) => PromiseLike | T, deps: TDeps ): ResourceResult; declare function resource( fn: (opts: { signal: AbortSignal }) => PromiseLike | T ): ResourceResult; /** Connection status of a {@link stream}. */ type StreamStatus = | 'connecting' | 'connected' | 'reconnecting' | 'closed' | 'error'; /** Reactive result of a {@link stream}: current value, connection status, and controls. */ interface StreamResult { value: T | null; status: StreamStatus; pending: boolean; stale: boolean; error: Error | null; restart(): void; close(): void; } /** Options for {@link stream}. */ interface StreamOptions { deps?: readonly unknown[]; initialValue?: T; } type StreamSource = (context: { signal: AbortSignal; }) => AsyncIterable | PromiseLike>; /** Connect a stream from an input read during a positional component render. */ declare function stream( source: () => TSource, connect: ( value: TSource, context: { signal: AbortSignal } ) => AsyncIterable | PromiseLike>, options?: Omit, 'deps'> ): StreamResult; /** Subscribe to a streaming data source for the current component's lifetime, with auto reconnect/cleanup. */ declare function stream( source: StreamSource, options?: StreamOptions ): StreamResult; export { type ActivityPredicate, type ListenerTarget, type ResourceResult, type StreamOptions, type StreamResult, type StreamStatus, type TimerOptions, type WatchCallback, type WatchContext, type WatchSource, type WatchValues, capture, documentVisible, on, resource, routeActive, stream, task, timer, watch, windowFocused, };