import React, { ReactNode } from 'react'; interface EarnLayerConfig { proxyBaseUrl?: string; } interface AdPreferences { ad_types?: ('hyperlink' | 'thinking' | 'banner' | 'popup' | 'video')[]; frequency?: 'low' | 'normal' | 'high'; revenue_vs_relevance?: number; display_ad_similarity_threshold?: number; min_seconds_between_display_ads?: number; categories?: string[]; } interface ConversationOptions { visitorId?: string; adTypes?: ('hyperlink' | 'display')[]; frequency?: 'low' | 'normal' | 'high'; adPreferences?: AdPreferences; demoMode?: boolean; } interface Conversation { conversation_id: string; creator_id: string; ad_settings: any; status: string; created_at: string; } interface DisplayAd { id: string; impressionId: string; title: string; description?: string; url: string; imageUrl?: string; adType: 'banner' | 'popup' | 'video' | 'thinking'; source: 'queue' | 'fallback'; needsDescription?: boolean; } declare class EarnLayerClient { private proxyBaseUrl; constructor(config?: EarnLayerConfig); initializeConversation(options?: ConversationOptions): Promise; getDisplayAd(conversationId: string, adType?: string, thinkingAdTimeout?: number, refresh?: boolean): Promise; trackImpression(impressionId: string): Promise; trackClick(impressionId: string): Promise; confirmHyperlinkImpressions(conversationId: string, messageText: string): Promise<{ confirmed_count: number; impression_ids: string[]; }>; private generateVisitorId; } interface EarnLayerContextValue { client: EarnLayerClient; conversationId: string | null; isReady: boolean; error: string | null; initializeConversation: (options?: ConversationOptions) => Promise; } interface EarnLayerProviderProps { children: ReactNode; proxyBaseUrl?: string; conversationOptions?: ConversationOptions; debug?: boolean; } declare const EarnLayerProvider: React.FC; declare const useEarnLayerClient: () => EarnLayerContextValue; declare const useEarnLayer: () => EarnLayerContextValue; interface UseDisplayAdOptions { conversationId?: string; adType?: 'banner' | 'popup' | 'video' | 'thinking'; placement?: string; autoFetch?: boolean; debug?: boolean; thinkingAdTimeout?: number; onAdFetched?: (ad: DisplayAd) => void; onError?: (error: Error) => void; } interface UseDisplayAdReturn { ad: DisplayAd | null; isLoading: boolean; error: Error | null; refetch: () => Promise; refetchWithRefresh: () => Promise; } declare function useDisplayAd(options?: UseDisplayAdOptions): UseDisplayAdReturn; interface UseDisplayAdsOptions { conversationId?: string; autoRefresh?: boolean; refreshInterval?: number; pollInterval?: number; debug?: boolean; } declare function useDisplayAds({ conversationId: propConversationId, autoRefresh, refreshInterval, pollInterval, debug, }?: UseDisplayAdsOptions): { ads: DisplayAd[]; currentAd: DisplayAd | null; loading: boolean; error: Error | null; refetch: () => Promise; nextAd: () => void; previousAd: () => void; }; export { EarnLayerProvider, useDisplayAd, useDisplayAds, useEarnLayer, useEarnLayerClient }; export type { EarnLayerProviderProps, UseDisplayAdOptions, UseDisplayAdReturn };