import type { AlwatrSignal, SubscribeOptions } from '@alwatr/flux'; /** * React hook for subscribing to an Alwatr signal and managing its state. * * * @param signalInstance - The Alwatr signal instance to subscribe to * @param defaultValue - Default value to use when signal hasn't emitted yet * @param options - Optional subscription options * * @returns The current signal state * * @example * ```tsx * // Create a signal * const notificationSignal = new AlwatrSignal('notification'); * * // Basic usage * function NotificationBell() { * const defaultNotification = { message: '', count: 0 }; * const notification = useSignal(notificationSignal, defaultNotification); * * return ( *
* {notification.count > 0 && ( * {notification.message} * )} *
* ); * } * * // Advanced usage with options * function ConditionalNotification() { * const notification = useSignal( * notificationSignal, * defaultNotification, * { once: true } // Only receive first notification * ); * * return
{notification.message}
; * } * ``` */ export declare function useSignal(signalInstance: AlwatrSignal, defaultValue: T, options?: SubscribeOptions): T; //# sourceMappingURL=use-signal.d.ts.map