import { ReactNode } from 'react'; import { AquienpzClient } from './index.js'; import { ResolveSlotOptions, SlotResolution } from '@aquienpz/asset-client'; /** * @aquienpz/sdk/react — React hooks layered on top of the universal SDK. * * Kept in a subpath so the SSR-safe core (`@aquienpz/sdk`) stays * dependency-free of react. Import only what you need: * * import { useSlot, useSlots, AquienpzProvider } from "@aquienpz/sdk/react"; * * Pattern: wrap your app in `` once at * the root; hooks read the client from context. No prop-drilling. */ declare function AquienpzProvider(props: { client: AquienpzClient; children: ReactNode; }): ReactNode; declare function useAquienpzClient(): AquienpzClient; type SlotState = { /** Resolved DTO (`null` while loading or unbound). */ resolution: SlotResolution | null; /** Convenience: the CDN URL, when resolved. */ url: string | null; isLoading: boolean; error: Error | null; }; /** * Subscribe to a single slot. Re-resolves when the key changes or the * cache is invalidated. Returns `{resolution, url, isLoading, error}`. */ declare function useSlot(slotKey: string, options?: ResolveSlotOptions): SlotState; /** * Bulk version — fetches N keys in one round-trip. Returns a map keyed * by slot key. Pass a STABLE array reference (memoize with useMemo) to * avoid re-fetches on every render. */ declare function useSlots(slotKeys: string[], options?: ResolveSlotOptions): { resolutions: Record; isLoading: boolean; error: Error | null; }; export { AquienpzProvider, useAquienpzClient, useSlot, useSlots };