/** * Universal Entity Data Hook * * Provides CRUD operations for any entity based on configuration. * Now powered by TanStack Query for: * - Automatic caching (5min stale, 1hr gc) * - Request deduplication * - Optimistic updates * - Parallel fetching * - Background refetch */ import type { EntityConfig } from '../lib/entities/types'; export interface UseEntityOptions { entityConfig: EntityConfig; enableRealtime?: boolean; enableCache?: boolean; pageSize?: number; includeChildren?: boolean; autoFetch?: boolean; } export interface EntityHookResult { items: Record[]; item: Record | null; childData: Record; isLoading: boolean; isCreating: boolean; isUpdating: boolean; isDeleting: boolean; error: string | null; validationErrors: Record; currentPage: number; totalPages: number; totalItems: number; searchQuery: string; filters: Record; sort: { field: string; direction: 'asc' | 'desc'; } | null; canCreate: boolean; canRead: boolean; canUpdate: boolean; canDelete: boolean; fetchAll: (options?: { page?: number; search?: string; filters?: Record; }) => Promise; fetchOne: (id: string) => Promise; create: (data: Record) => Promise; update: (id: string, data: Record) => Promise; delete: (id: string) => Promise; bulkDelete: (ids: string[]) => Promise; setSearchQuery: (query: string) => void; setFilters: (filters: Record) => void; setSort: (field: string, direction: 'asc' | 'desc') => void; createChild: () => Promise; updateChild: () => Promise; deleteChild: () => Promise; refresh: () => Promise; reset: () => void; } /** * useEntity - TanStack Query powered entity hook * * Provides complete entity management with automatic caching and optimizations */ export declare function useEntity(options: UseEntityOptions): EntityHookResult; //# sourceMappingURL=useEntity.d.ts.map