import { TopicSubscription, NovuError } from '@novu/js'; /** * Get all subscriptions for a topic. * Props for the useSubscriptions hook. * * @example * ```tsx * // Get all subscriptions for a topic * const { subscriptions } = useSubscriptions({ * topicKey: 'my-topic' * }); * * // Get subscriptions with callbacks * const { subscriptions, refetch } = useSubscriptions({ * topicKey: 'my-topic', * onSuccess: (data) => console.log('Loaded:', data), * onError: (error) => console.error('Error:', error) * }); * ``` */ type UseSubscriptionsProps = { topicKey: string; onSuccess?: (data: TopicSubscription[]) => void; onError?: (error: NovuError) => void; }; type UseSubscriptionsResult = { subscriptions?: TopicSubscription[]; error?: NovuError; isLoading: boolean; isFetching: boolean; refetch: () => Promise; }; declare const useSubscriptions: ({ topicKey, onSuccess, onError }: UseSubscriptionsProps) => UseSubscriptionsResult; export { useSubscriptions }; export type { UseSubscriptionsProps, UseSubscriptionsResult };