/** * Files Hook * * React hook for accessing Files 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 } = useFilesService(); * * // Use service methods * const items = await service.fetchAll(); * const item = await service.create({ name: 'New' }); * ``` */ import type { FrontendFilesDomainService } from '../../domain/files'; import type { UseServiceAsyncResult } from '@plyaz/types/core'; /** Service key for Files in ServiceRegistry */ export declare const FILES_SERVICE_KEY = "files"; /** * Hook for Files service (async - with loading state) * * Use this when the service may be lazily initialized. * Returns { service, isLoading, error }. * * @example * ```typescript * const { service, isLoading, error } = useFilesService(); * const items = await service.fetchAll(); * ``` */ export declare function useFilesService(): UseServiceAsyncResult; /** * Hook for Files 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 = useFilesServiceSync(); * const item = await service.create({ name: 'New' }); * ``` */ export declare function useFilesServiceSync(): FrontendFilesDomainService; /** * Get Files 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 getFilesService(); * await service.create(data); * }; * * // In a store action * const myStore = create((set) => ({ * create: async (data) => { * const service = await getFilesService(); * const entity = await service.create(data); * set({ entity }); * }, * })); * ``` */ export declare function getFilesService(): Promise; /** * Create service accessor for Zustand stores * * @example * ```typescript * import { createFilesServiceAccessor } from './useFiles'; * * const getFiles = createFilesServiceAccessor(); * * const myStore = create((set) => ({ * items: [], * fetch: async () => { * const service = await getFiles(); * const items = await service.fetchAll(); * set({ items }); * }, * })); * ``` */ export declare function createFilesServiceAccessor(): () => Promise; //# sourceMappingURL=useFiles.d.ts.map