@pubuduth-aplicy/chat-ui 2.1.46 → 2.1.48
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/package.json +1 -1
- package/src/declarations.d.ts +18 -5
- package/src/index.tsx +1 -1
package/package.json
CHANGED
package/src/declarations.d.ts
CHANGED
|
@@ -18,16 +18,29 @@ declare module '*.svg' {
|
|
|
18
18
|
declare module '@pubuduth-aplicy/chat-ui' {
|
|
19
19
|
import { ReactNode, FC } from 'react';
|
|
20
20
|
|
|
21
|
+
interface ChatConfig {
|
|
22
|
+
apiUrl: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
interface ChatProviderProps {
|
|
22
26
|
userId: string;
|
|
23
27
|
children: ReactNode;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export function useChatContext(): {
|
|
29
|
-
socket: any; // Replace 'any' with proper Socket type
|
|
30
|
+
interface ChatContextValue {
|
|
31
|
+
socket: any; // Replace 'any' with proper Socket type if available
|
|
30
32
|
userId: string;
|
|
31
33
|
onlineUsers: any[];
|
|
32
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Export the Chat component and provider
|
|
37
|
+
export const ChatProvider: FC<ChatProviderProps>;
|
|
38
|
+
export const Chat: FC;
|
|
39
|
+
|
|
40
|
+
// Export the config functions
|
|
41
|
+
export function initChatConfig(config: ChatConfig): void;
|
|
42
|
+
export function getChatConfig(): ChatConfig;
|
|
43
|
+
|
|
44
|
+
// Export the hook
|
|
45
|
+
export function useChatContext(): ChatContextValue;
|
|
33
46
|
}
|
package/src/index.tsx
CHANGED