import type { MaybeRefOrGetter } from './_shared'; import type { Ref } from '@stacksjs/stx'; /** * Reactive Server-Sent Events (EventSource) connection. * * @param url - The EventSource URL (can be a ref, getter, or raw string) * @param events - Array of event names to listen for (in addition to 'message') * @param options - Configuration options * @returns Reactive EventSource state and control methods * * @example * ```ts * const { data, event, status, close } = useEventSource('/api/events', ['update', 'delete'], { * withCredentials: true, * }) * ``` */ export declare function useEventSource(url: MaybeRefOrGetter, events?: string[], options?: UseEventSourceOptions): UseEventSourceReturn; export declare interface UseEventSourceOptions { withCredentials?: boolean immediate?: boolean } export declare interface UseEventSourceReturn { data: Ref event: Ref status: Ref error: Ref eventSource: Ref close: () => void open: () => void } export type EventSourceStatus = 'CONNECTING' | 'OPEN' | 'CLOSED';