@usechat/react-native 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -652,16 +652,17 @@ interface ChatInitResponse {
652
652
  success: boolean;
653
653
  message: string;
654
654
  projectId: string;
655
+ projectName?: string;
655
656
  activatedAt: string;
656
657
  }
657
658
  /**
658
659
  * Initialize the chat SDK with project verification
659
660
  *
660
- * This function validates the project ID with the API and sets up the SDK for use.
661
+ * This function validates the project ID against UseChat's API.
661
662
  * All UseChat components and hooks require this to be called first.
662
663
  *
663
- * @param config - Configuration object containing projectId and optional apiUrl
664
- * @returns Promise that resolves to ChatInitResponse or rejects with ChatInitError
664
+ * @param config - Configuration object containing projectId
665
+ * @returns Promise that resolves to ChatInitResponse or rejects with Error
665
666
  */
666
667
  declare const initChat: (config: ChatInitConfig) => Promise<ChatInitResponse>;
667
668
 
@@ -669,10 +670,11 @@ declare const initChat: (config: ChatInitConfig) => Promise<ChatInitResponse>;
669
670
  * Simple Authentication System for UseChat SDK
670
671
  *
671
672
  * This system ensures initChat() is called before using any components or hooks.
672
- * No loading states - just immediate error throwing for better developer experience.
673
+ * Tracks initialization state to handle race conditions gracefully.
673
674
  */
675
+ type InitStatus = 'idle' | 'pending' | 'success' | 'error';
674
676
  interface AuthState {
675
- isInitialized: boolean;
677
+ status: InitStatus;
676
678
  projectId: string | null;
677
679
  error: string | null;
678
680
  }
@@ -688,6 +690,14 @@ declare const getProjectId: () => string;
688
690
  * Check if SDK is initialized (without throwing)
689
691
  */
690
692
  declare const isInitialized: () => boolean;
693
+ /**
694
+ * Check if SDK is initializing
695
+ */
696
+ declare const isInitializing: () => boolean;
697
+ /**
698
+ * Get the current initialization status
699
+ */
700
+ declare const getInitStatus: () => InitStatus;
691
701
 
692
702
  interface ChatComponents {
693
703
  MessageList?: ComponentType<MessageListProps>;
@@ -799,4 +809,4 @@ declare const useDateFormatter: () => {
799
809
  groupMessages: (messages: Message[]) => MessageListItem[];
800
810
  };
801
811
 
802
- export { AttachmentMenu, type AttachmentResult, Chat, ChatAvatar, type ChatConfig, ChatHeader, type ChatHeaderProps, type ChatInitConfig, type ChatInitResponse, ChatItem, ChatList, ChatListSearchBar, type ChatListSearchBarProps, type ChatProps, ChatProvider, ChatScreenHeader, type I18nConfig, type I18nContextValue, I18nProvider, type Message$1 as Message, MessageInput, type MessageInputRef, MessageList, type MessageListRef, type SupportedLocale, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeSpacing, type ThemeTypography, type TranslationFunction, type TranslationKeys, TypingIndicator, type TypingIndicatorProps, defaultTheme, defaultTranslations, getAuthState, getProjectId, getTranslation, initChat, isInitialized, isSupportedLocale, useAttachments, useChatConfig, useChatMessages, useChatSDK, useDateFormatter, useMessageActions, useMessageInput, useMessageList, useMessageReactions, useTheme, useTranslation, useTranslationFunction };
812
+ export { AttachmentMenu, type AttachmentResult, Chat, ChatAvatar, type ChatConfig, ChatHeader, type ChatHeaderProps, type ChatInitConfig, type ChatInitResponse, ChatItem, ChatList, ChatListSearchBar, type ChatListSearchBarProps, type ChatProps, ChatProvider, ChatScreenHeader, type I18nConfig, type I18nContextValue, I18nProvider, type InitStatus, type Message$1 as Message, MessageInput, type MessageInputRef, MessageList, type MessageListRef, type SupportedLocale, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeSpacing, type ThemeTypography, type TranslationFunction, type TranslationKeys, TypingIndicator, type TypingIndicatorProps, defaultTheme, defaultTranslations, getAuthState, getInitStatus, getProjectId, getTranslation, initChat, isInitialized, isInitializing, isSupportedLocale, useAttachments, useChatConfig, useChatMessages, useChatSDK, useDateFormatter, useMessageActions, useMessageInput, useMessageList, useMessageReactions, useTheme, useTranslation, useTranslationFunction };
package/dist/index.d.ts CHANGED
@@ -652,16 +652,17 @@ interface ChatInitResponse {
652
652
  success: boolean;
653
653
  message: string;
654
654
  projectId: string;
655
+ projectName?: string;
655
656
  activatedAt: string;
656
657
  }
657
658
  /**
658
659
  * Initialize the chat SDK with project verification
659
660
  *
660
- * This function validates the project ID with the API and sets up the SDK for use.
661
+ * This function validates the project ID against UseChat's API.
661
662
  * All UseChat components and hooks require this to be called first.
662
663
  *
663
- * @param config - Configuration object containing projectId and optional apiUrl
664
- * @returns Promise that resolves to ChatInitResponse or rejects with ChatInitError
664
+ * @param config - Configuration object containing projectId
665
+ * @returns Promise that resolves to ChatInitResponse or rejects with Error
665
666
  */
666
667
  declare const initChat: (config: ChatInitConfig) => Promise<ChatInitResponse>;
667
668
 
@@ -669,10 +670,11 @@ declare const initChat: (config: ChatInitConfig) => Promise<ChatInitResponse>;
669
670
  * Simple Authentication System for UseChat SDK
670
671
  *
671
672
  * This system ensures initChat() is called before using any components or hooks.
672
- * No loading states - just immediate error throwing for better developer experience.
673
+ * Tracks initialization state to handle race conditions gracefully.
673
674
  */
675
+ type InitStatus = 'idle' | 'pending' | 'success' | 'error';
674
676
  interface AuthState {
675
- isInitialized: boolean;
677
+ status: InitStatus;
676
678
  projectId: string | null;
677
679
  error: string | null;
678
680
  }
@@ -688,6 +690,14 @@ declare const getProjectId: () => string;
688
690
  * Check if SDK is initialized (without throwing)
689
691
  */
690
692
  declare const isInitialized: () => boolean;
693
+ /**
694
+ * Check if SDK is initializing
695
+ */
696
+ declare const isInitializing: () => boolean;
697
+ /**
698
+ * Get the current initialization status
699
+ */
700
+ declare const getInitStatus: () => InitStatus;
691
701
 
692
702
  interface ChatComponents {
693
703
  MessageList?: ComponentType<MessageListProps>;
@@ -799,4 +809,4 @@ declare const useDateFormatter: () => {
799
809
  groupMessages: (messages: Message[]) => MessageListItem[];
800
810
  };
801
811
 
802
- export { AttachmentMenu, type AttachmentResult, Chat, ChatAvatar, type ChatConfig, ChatHeader, type ChatHeaderProps, type ChatInitConfig, type ChatInitResponse, ChatItem, ChatList, ChatListSearchBar, type ChatListSearchBarProps, type ChatProps, ChatProvider, ChatScreenHeader, type I18nConfig, type I18nContextValue, I18nProvider, type Message$1 as Message, MessageInput, type MessageInputRef, MessageList, type MessageListRef, type SupportedLocale, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeSpacing, type ThemeTypography, type TranslationFunction, type TranslationKeys, TypingIndicator, type TypingIndicatorProps, defaultTheme, defaultTranslations, getAuthState, getProjectId, getTranslation, initChat, isInitialized, isSupportedLocale, useAttachments, useChatConfig, useChatMessages, useChatSDK, useDateFormatter, useMessageActions, useMessageInput, useMessageList, useMessageReactions, useTheme, useTranslation, useTranslationFunction };
812
+ export { AttachmentMenu, type AttachmentResult, Chat, ChatAvatar, type ChatConfig, ChatHeader, type ChatHeaderProps, type ChatInitConfig, type ChatInitResponse, ChatItem, ChatList, ChatListSearchBar, type ChatListSearchBarProps, type ChatProps, ChatProvider, ChatScreenHeader, type I18nConfig, type I18nContextValue, I18nProvider, type InitStatus, type Message$1 as Message, MessageInput, type MessageInputRef, MessageList, type MessageListRef, type SupportedLocale, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeSpacing, type ThemeTypography, type TranslationFunction, type TranslationKeys, TypingIndicator, type TypingIndicatorProps, defaultTheme, defaultTranslations, getAuthState, getInitStatus, getProjectId, getTranslation, initChat, isInitialized, isInitializing, isSupportedLocale, useAttachments, useChatConfig, useChatMessages, useChatSDK, useDateFormatter, useMessageActions, useMessageInput, useMessageList, useMessageReactions, useTheme, useTranslation, useTranslationFunction };