/** * Notifications Hook * * React hook for accessing Notifications service operations. * Uses ServiceRegistry for service access - the service handles all * data transformation, validation, and API calls. * * For most cases, use hooks directly from @plyaz/api/src/services. * This hook is for cases where you need integration with the domain service. * * @example * ```typescript * const { service, isLoading, error } = useNotificationsService(); * * // Use service methods * const items = await service.fetchAll(); * const item = await service.create({ name: 'New' }); * ``` */ import type { FrontendNotificationsDomainService } from '../../domain/notifications'; import type { UseServiceAsyncResult } from '@plyaz/types/core'; /** Service key for Notifications in ServiceRegistry */ export declare const NOTIFICATIONS_SERVICE_KEY = "notifications"; /** * Hook for Notifications service (async - with loading state) * * Use this when the service may be lazily initialized. * Returns { service, isLoading, error }. * * @example * ```typescript * const { service, isLoading, error } = useNotificationsService(); * const items = await service.fetchAll(); * ``` */ export declare function useNotificationsService(): UseServiceAsyncResult; /** * Hook for Notifications service (sync - throws if not ready) * * Use this when you're sure the service is already initialized. * Throws if service is not available. * * @example * ```typescript * const service = useNotificationsServiceSync(); * const item = await service.create({ name: 'New' }); * ``` */ export declare function useNotificationsServiceSync(): FrontendNotificationsDomainService; /** * Get Notifications service directly from registry (non-hook) * * Use this in callbacks or outside React components. * * @example * ```typescript * // In a callback * const handleSubmit = async () => { * const service = await getNotificationsService(); * await service.create(data); * }; * * // In a store action * const myStore = create((set) => ({ * create: async (data) => { * const service = await getNotificationsService(); * const entity = await service.create(data); * set({ entity }); * }, * })); * ``` */ export declare function getNotificationsService(): Promise; /** * Create service accessor for Zustand stores * * @example * ```typescript * import { createNotificationsServiceAccessor } from './useNotifications'; * * const getNotifications = createNotificationsServiceAccessor(); * * const myStore = create((set) => ({ * items: [], * fetch: async () => { * const service = await getNotifications(); * const items = await service.fetchAll(); * set({ items }); * }, * })); * ``` */ export declare function createNotificationsServiceAccessor(): () => Promise; //# sourceMappingURL=useNotifications.d.ts.map