@gigabuddy/chat-sdk 0.1.8 → 0.1.9
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/index.d.ts +1 -1
- package/src/lib/types.d.ts +8 -8
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { GigabuddyChat } from './lib/GigabuddyChat.js';
|
|
2
2
|
export { Conversation } from './lib/Conversation.js';
|
|
3
|
-
export type { GigabuddyChatConfig, ChannelEvent, ChannelEventType, ConversationEventMap, Message, UserProfile, ConversationType, ConversationVisibility, MessageRole, MessageContent, TextContent,
|
|
3
|
+
export type { GigabuddyChatConfig, ChannelEvent, ChannelEventType, ConversationEventMap, Message, UserProfile, ConversationType, ConversationVisibility, MessageRole, MessageContent, TextContent, GadgetContent, DataContent, SystemContent, CompositeContent, MessageReaction, ConversationReadState, ConversationInfo, ChatUser, UserStreamEventType, ConversationAddedEvent, ConversationRemovedEvent, ChatEventBus, ChatNotification, } from './lib/types.js';
|
package/src/lib/types.d.ts
CHANGED
|
@@ -31,16 +31,16 @@ export type ConversationType = 'channel' | 'dm' | 'group_dm';
|
|
|
31
31
|
export type ConversationVisibility = 'public' | 'private';
|
|
32
32
|
export type MessageRole = 'member' | 'buddy' | 'operator' | 'system';
|
|
33
33
|
/** Rich message content — discriminated union */
|
|
34
|
-
export type MessageContent = TextContent |
|
|
34
|
+
export type MessageContent = TextContent | GadgetContent | DataContent | SystemContent | CompositeContent;
|
|
35
35
|
export interface TextContent {
|
|
36
36
|
type: 'text';
|
|
37
37
|
text: string;
|
|
38
38
|
format?: 'plain' | 'markdown';
|
|
39
39
|
}
|
|
40
|
-
export interface
|
|
41
|
-
type: '
|
|
42
|
-
|
|
43
|
-
type: '
|
|
40
|
+
export interface GadgetContent {
|
|
41
|
+
type: 'gadget';
|
|
42
|
+
gadgetRef: {
|
|
43
|
+
type: 'gadget';
|
|
44
44
|
id: string;
|
|
45
45
|
};
|
|
46
46
|
props?: Record<string, unknown>;
|
|
@@ -61,7 +61,7 @@ export interface SystemContent {
|
|
|
61
61
|
}
|
|
62
62
|
export interface CompositeContent {
|
|
63
63
|
type: 'composite';
|
|
64
|
-
blocks: (TextContent |
|
|
64
|
+
blocks: (TextContent | GadgetContent | DataContent)[];
|
|
65
65
|
}
|
|
66
66
|
export interface MessageReaction {
|
|
67
67
|
emoji: string;
|
|
@@ -107,7 +107,7 @@ export interface ChatUser {
|
|
|
107
107
|
avatarUrl?: string;
|
|
108
108
|
handle?: string;
|
|
109
109
|
}
|
|
110
|
-
export type ChannelEventType = 'message' | '
|
|
110
|
+
export type ChannelEventType = 'message' | 'gadget' | 'data' | 'instruction' | 'typing' | 'status' | 'error' | 'thread_reply' | 'reaction_added' | 'participant_joined' | 'participant_left';
|
|
111
111
|
/** User-stream-level event types (superset of channel events) */
|
|
112
112
|
export type UserStreamEventType = ChannelEventType | 'conversation_added' | 'conversation_removed' | 'notification';
|
|
113
113
|
/** Server-initiated notification delivered via the user stream. */
|
|
@@ -161,7 +161,7 @@ export interface Message {
|
|
|
161
161
|
}
|
|
162
162
|
export interface ConversationEventMap {
|
|
163
163
|
message: (event: ChannelEvent) => void;
|
|
164
|
-
|
|
164
|
+
gadget: (event: ChannelEvent) => void;
|
|
165
165
|
typing: (event: ChannelEvent) => void;
|
|
166
166
|
status: (event: ChannelEvent) => void;
|
|
167
167
|
error: (event: ChannelEvent) => void;
|