@linktr.ee/messaging-react 1.16.1 → 1.17.0-rc-1769690110

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.ts CHANGED
@@ -3,6 +3,7 @@ import { ChannelFilters } from 'stream-chat';
3
3
  import { default as default_2 } from 'react';
4
4
  import { EmptyStateIndicatorProps } from 'stream-chat-react';
5
5
  import { MessagingUser } from '@linktr.ee/messaging-core';
6
+ import { SendMessageAPIResponse } from 'stream-chat';
6
7
  import { StreamChat } from 'stream-chat';
7
8
  import { StreamChatService } from '@linktr.ee/messaging-core';
8
9
  import { StreamChatServiceConfig } from '@linktr.ee/messaging-core';
@@ -55,7 +56,7 @@ export declare const ChannelView: default_2.NamedExoticComponent<ChannelViewProp
55
56
  * Props that MessagingShell passes through to ChannelView.
56
57
  * ChannelViewProps is the source of truth for these props.
57
58
  */
58
- declare type ChannelViewPassthroughProps = Pick<ChannelViewProps, 'renderMessageInputActions' | 'CustomChannelEmptyState' | 'onDeleteConversationClick' | 'onBlockParticipantClick' | 'onReportParticipantClick' | 'dmAgentEnabled'>;
59
+ declare type ChannelViewPassthroughProps = Pick<ChannelViewProps, 'renderMessageInputActions' | 'CustomChannelEmptyState' | 'onDeleteConversationClick' | 'onBlockParticipantClick' | 'onReportParticipantClick' | 'dmAgentEnabled' | 'messageMetadata' | 'onMessageSent'>;
59
60
 
60
61
  /**
61
62
  * ChannelView component props
@@ -93,6 +94,25 @@ export declare interface ChannelViewProps {
93
94
  * The library reads chatbot_paused from channel.data internally.
94
95
  */
95
96
  dmAgentEnabled?: boolean;
97
+ /**
98
+ * Custom metadata to attach to all outgoing messages.
99
+ * Used for paid messaging flows where messages need custom_type and listing_id.
100
+ *
101
+ * @example
102
+ * messageMetadata={{ custom_type: 'MESSAGE_PAID', listing_id: '...' }}
103
+ */
104
+ messageMetadata?: Pick<MessageMetadata, 'custom_type' | 'listing_id'>;
105
+ /**
106
+ * Callback fired after a message is successfully sent.
107
+ * Receives the full API response including message.id.
108
+ * Useful for triggering payment flows with the message ID.
109
+ *
110
+ * @example
111
+ * onMessageSent={(response) => {
112
+ * openPaymentModal(response.message.id)
113
+ * }}
114
+ */
115
+ onMessageSent?: (response: SendMessageAPIResponse) => void;
96
116
  }
97
117
 
98
118
  export declare interface Faq {
@@ -130,6 +150,18 @@ export declare interface FaqListProps {
130
150
  */
131
151
  export declare const formatRelativeTime: (date: Date) => string;
132
152
 
153
+ /**
154
+ * Message metadata for paid messaging and chatbot flows.
155
+ * Used to identify message types and payment status.
156
+ */
157
+ export declare interface MessageMetadata {
158
+ custom_type?: 'MESSAGE_TIP' | 'MESSAGE_PAID' | 'MESSAGE_CHATBOT';
159
+ amount_text?: string;
160
+ payment_status?: string;
161
+ payment_intent_id?: string;
162
+ listing_id?: string;
163
+ }
164
+
133
165
  /**
134
166
  * Messaging capabilities configuration
135
167
  */
@@ -307,13 +339,7 @@ declare module 'stream-chat' {
307
339
  * Message metadata from backend.
308
340
  * Contains type and payment information.
309
341
  */
310
- metadata?: {
311
- custom_type?: 'MESSAGE_TIP' | 'MESSAGE_PAID' | 'MESSAGE_CHATBOT';
312
- amount_text?: string;
313
- payment_status?: string;
314
- payment_intent_id?: string;
315
- listing_id?: string;
316
- };
342
+ metadata?: MessageMetadata;
317
343
  }
318
344
  }
319
345