@cimulate/copilot-widget 1.40.0 → 1.41.1

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.
@@ -360,6 +360,7 @@ export declare const eventHandlers: {
360
360
  session: {
361
361
  resetConversation: () => void;
362
362
  endConversation: () => void;
363
+ sendMessage: typeof sendMessage;
363
364
  };
364
365
  };
365
366
 
@@ -991,6 +992,23 @@ declare interface SendError {
991
992
 
992
993
  export declare type SendMessage = (text: string, options?: SendMessageOptions) => Promise<SendMessageResult>;
993
994
 
995
+ /**
996
+ * Send a shopper query into the current conversation.
997
+ *
998
+ * Safe to call before the widget is open: the query is queued until the
999
+ * widget opens and the agent's welcome message has arrived. Pair with
1000
+ * `eventHandlers.components.toggleWidgetOpen(true)` to show the widget.
1001
+ * Rejects if called before `injectMessagingWidget()` has mounted the widget.
1002
+ *
1003
+ * @example
1004
+ * ```js
1005
+ * const { sendMessage, eventHandlers } = window.CimulateMessaging;
1006
+ * sendMessage("running shoes");
1007
+ * eventHandlers.components.toggleWidgetOpen(true);
1008
+ * ```
1009
+ */
1010
+ export declare function sendMessage(text: string, options?: SendMessageOptions): Promise<SendMessageResult>;
1011
+
994
1012
  export declare interface SendMessageOptions {
995
1013
  silent?: boolean;
996
1014
  reconcileMessageId?: string;