@bangdb/web-sdk 1.0.5

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.
@@ -0,0 +1,76 @@
1
+ type ColorTokens = {
2
+ background: string;
3
+ foreground: string;
4
+ card: string;
5
+ cardForeground: string;
6
+ primary: string;
7
+ primaryForeground: string;
8
+ secondary: string;
9
+ secondaryForeground: string;
10
+ muted: string;
11
+ mutedForeground: string;
12
+ accent: string;
13
+ accentForeground: string;
14
+ border: string;
15
+ input: string;
16
+ ring: string;
17
+ radius: string;
18
+ shadowPanel: string;
19
+ shadowBubble: string;
20
+ shadowInput: string;
21
+ };
22
+ type ApiConfig = {
23
+ apikey: string;
24
+ resourceURL: string;
25
+ backendURL: string;
26
+ userid: string;
27
+ indexName: string;
28
+ };
29
+ interface ChatWidgetOptions {
30
+ colorTokens?: ColorTokens;
31
+ title?: string;
32
+ config: ApiConfig;
33
+ logo?: string;
34
+ }
35
+ declare class ChatWidget {
36
+ private font;
37
+ private injectThemeVars;
38
+ private injectGlobalFonts;
39
+ private TOKENS;
40
+ private readonly store;
41
+ private apiConfig;
42
+ private root;
43
+ private container;
44
+ private bubbleEl;
45
+ private chatUIEl;
46
+ private chatAreaEl;
47
+ private renderedMessageIds;
48
+ private chatTitle;
49
+ private logoUrl;
50
+ constructor(options: ChatWidgetOptions);
51
+ private mount;
52
+ init(): Promise<void>;
53
+ private handleChatDataChange;
54
+ private handleModeChange;
55
+ createChatBubble(): HTMLElement;
56
+ createChatUI(): HTMLElement;
57
+ chatArea(): HTMLElement;
58
+ loadingIndicator(): HTMLElement;
59
+ userRequestMessage(query: string): HTMLElement;
60
+ aiResponseMessage(response: any): HTMLElement;
61
+ private renderSourceTags;
62
+ private renderTables;
63
+ private renderImages;
64
+ chatQueryForm(): HTMLElement;
65
+ sendQuery(): Promise<void>;
66
+ downloadChat(): void;
67
+ }
68
+
69
+ declare function init(options: ChatWidgetOptions): ChatWidget;
70
+ declare global {
71
+ interface Window {
72
+ BangdbChatWidget: any;
73
+ }
74
+ }
75
+
76
+ export { type ApiConfig, ChatWidget, type ChatWidgetOptions, type ColorTokens, init };
@@ -0,0 +1,76 @@
1
+ type ColorTokens = {
2
+ background: string;
3
+ foreground: string;
4
+ card: string;
5
+ cardForeground: string;
6
+ primary: string;
7
+ primaryForeground: string;
8
+ secondary: string;
9
+ secondaryForeground: string;
10
+ muted: string;
11
+ mutedForeground: string;
12
+ accent: string;
13
+ accentForeground: string;
14
+ border: string;
15
+ input: string;
16
+ ring: string;
17
+ radius: string;
18
+ shadowPanel: string;
19
+ shadowBubble: string;
20
+ shadowInput: string;
21
+ };
22
+ type ApiConfig = {
23
+ apikey: string;
24
+ resourceURL: string;
25
+ backendURL: string;
26
+ userid: string;
27
+ indexName: string;
28
+ };
29
+ interface ChatWidgetOptions {
30
+ colorTokens?: ColorTokens;
31
+ title?: string;
32
+ config: ApiConfig;
33
+ logo?: string;
34
+ }
35
+ declare class ChatWidget {
36
+ private font;
37
+ private injectThemeVars;
38
+ private injectGlobalFonts;
39
+ private TOKENS;
40
+ private readonly store;
41
+ private apiConfig;
42
+ private root;
43
+ private container;
44
+ private bubbleEl;
45
+ private chatUIEl;
46
+ private chatAreaEl;
47
+ private renderedMessageIds;
48
+ private chatTitle;
49
+ private logoUrl;
50
+ constructor(options: ChatWidgetOptions);
51
+ private mount;
52
+ init(): Promise<void>;
53
+ private handleChatDataChange;
54
+ private handleModeChange;
55
+ createChatBubble(): HTMLElement;
56
+ createChatUI(): HTMLElement;
57
+ chatArea(): HTMLElement;
58
+ loadingIndicator(): HTMLElement;
59
+ userRequestMessage(query: string): HTMLElement;
60
+ aiResponseMessage(response: any): HTMLElement;
61
+ private renderSourceTags;
62
+ private renderTables;
63
+ private renderImages;
64
+ chatQueryForm(): HTMLElement;
65
+ sendQuery(): Promise<void>;
66
+ downloadChat(): void;
67
+ }
68
+
69
+ declare function init(options: ChatWidgetOptions): ChatWidget;
70
+ declare global {
71
+ interface Window {
72
+ BangdbChatWidget: any;
73
+ }
74
+ }
75
+
76
+ export { type ApiConfig, ChatWidget, type ChatWidgetOptions, type ColorTokens, init };