import type { RegistryDuckType } from '../types/context-types'; import type { Item } from '../Gallery'; export type ResourceRegistry = RegistryDuckType; export type RegistryItemMapper = (entry: TRegistryItem & { providerType: string; }) => Item; /** * Configuration for `useRegistryGallery`. Consumers provide the registry instance plus callbacks * describing how to convert registry entries into gallery items and which messages to surface. */ interface UseRegistryGalleryOptions { registry: RegistryDuckType | null; initialProviderType?: string; missingRegistryMessage: string; missingProviderMessage: string; emptyWarningMessage: string; emptyDeleteWarningMessage?: string; emptySearchWarningMessage: string; mapItem: RegistryItemMapper; listIdsOptions?: Record; sortFields?: string[]; disableInitialFetch?: boolean; } /** * Shape of the stateful values and callbacks returned from `useRegistryGallery`. */ interface UseRegistryGalleryResult { items: Item[]; loading: boolean; searching: boolean; error?: string; warning?: string; providerType?: string; handleUpload: (files: File[]) => Promise; handleSearch: (searchStr?: string) => Promise; handleDelete: (item: Item) => Promise; } /** * Shared hook that encapsulates all registry-backed Gallery behaviors such as * provider detection, listing/searching items, uploads, deletes, and warning/error state. * Consumers provide registry-specific mapping logic through the `mapItem` callback so UIs * can reuse the same data lifecycle without duplicating state management. */ export declare const useRegistryGallery: ({ registry, initialProviderType, missingRegistryMessage, missingProviderMessage, emptyWarningMessage, emptyDeleteWarningMessage, emptySearchWarningMessage, mapItem, listIdsOptions, sortFields, disableInitialFetch, }: UseRegistryGalleryOptions) => UseRegistryGalleryResult; export {}; //# sourceMappingURL=useRegistryGallery.d.ts.map