@idevconn/ai-chat-client 0.1.2

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,49 @@
1
+ interface ChatStreamEvent {
2
+ type: 'token' | 'tool_call' | 'tool_result' | 'done' | 'error';
3
+ content?: string;
4
+ usage?: {
5
+ promptTokens: number;
6
+ completionTokens: number;
7
+ totalTokens: number;
8
+ };
9
+ error?: string;
10
+ }
11
+ interface StarterTopic {
12
+ label: string;
13
+ message: string;
14
+ icon?: string;
15
+ description?: string;
16
+ }
17
+ interface ThemeConfig {
18
+ primaryColor?: string;
19
+ borderRadius?: string;
20
+ fontFamily?: string;
21
+ darkMode?: boolean;
22
+ position?: 'bottom-right' | 'bottom-left';
23
+ zIndex?: number;
24
+ width?: string;
25
+ height?: string;
26
+ }
27
+ interface AiChatConfig {
28
+ endpoint: string;
29
+ apiKey?: string;
30
+ token?: string;
31
+ getToken?: () => Promise<string>;
32
+ theme?: ThemeConfig;
33
+ welcomeMessage?: string;
34
+ placeholder?: string;
35
+ starterTopics?: StarterTopic[];
36
+ botName?: string;
37
+ botAvatar?: string;
38
+ persistSession?: boolean;
39
+ showTimestamps?: boolean;
40
+ }
41
+ interface ChatMessageUI {
42
+ id: string;
43
+ role: 'user' | 'assistant';
44
+ content: string;
45
+ timestamp: number;
46
+ streaming?: boolean;
47
+ }
48
+
49
+ export type { AiChatConfig as A, ChatMessageUI as C, StarterTopic as S, ThemeConfig as T, ChatStreamEvent as a };
@@ -0,0 +1,12 @@
1
+ declare class AiChatElement extends HTMLElement {
2
+ private root;
3
+ private shadowContainer;
4
+ static get observedAttributes(): string[];
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ attributeChangedCallback(): void;
8
+ private render;
9
+ private buildConfig;
10
+ }
11
+
12
+ export { AiChatElement };
@@ -0,0 +1,12 @@
1
+ declare class AiChatElement extends HTMLElement {
2
+ private root;
3
+ private shadowContainer;
4
+ static get observedAttributes(): string[];
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ attributeChangedCallback(): void;
8
+ private render;
9
+ private buildConfig;
10
+ }
11
+
12
+ export { AiChatElement };