/** * This file is auto generated by `scripts/generate-method-action-types.ts`. * Do not edit manually. */ import type { BackendWebSocketService } from "./BackendWebSocketService.mjs"; /** * Establishes WebSocket connection * * @returns Promise that resolves when connection is established */ export type BackendWebSocketServiceConnectAction = { type: `BackendWebSocketService:connect`; handler: BackendWebSocketService['connect']; }; /** * Closes WebSocket connection * * @returns Promise that resolves when disconnection is complete */ export type BackendWebSocketServiceDisconnectAction = { type: `BackendWebSocketService:disconnect`; handler: BackendWebSocketService['disconnect']; }; /** * Sends a message through the WebSocket * * @param message - The message to send * @returns Promise that resolves when message is sent */ export type BackendWebSocketServiceSendMessageAction = { type: `BackendWebSocketService:sendMessage`; handler: BackendWebSocketService['sendMessage']; }; /** * Sends a request and waits for a correlated response * * @param message - The request message * @returns Promise that resolves with the response data */ export type BackendWebSocketServiceSendRequestAction = { type: `BackendWebSocketService:sendRequest`; handler: BackendWebSocketService['sendRequest']; }; /** * Gets current connection information * * @returns Current connection status and details */ export type BackendWebSocketServiceGetConnectionInfoAction = { type: `BackendWebSocketService:getConnectionInfo`; handler: BackendWebSocketService['getConnectionInfo']; }; /** * Gets all subscription information for a specific channel * * @param channel - The channel name to look up * @returns Array of subscription details for all subscriptions containing the channel */ export type BackendWebSocketServiceGetSubscriptionsByChannelAction = { type: `BackendWebSocketService:getSubscriptionsByChannel`; handler: BackendWebSocketService['getSubscriptionsByChannel']; }; /** * Checks if a channel has a subscription * * @param channel - The channel name to check * @returns True if the channel has a subscription, false otherwise */ export type BackendWebSocketServiceChannelHasSubscriptionAction = { type: `BackendWebSocketService:channelHasSubscription`; handler: BackendWebSocketService['channelHasSubscription']; }; /** * Finds all subscriptions that have channels starting with the specified prefix * * @param channelPrefix - The channel prefix to search for (e.g., "account-activity.v1") * @returns Array of subscription info for matching subscriptions */ export type BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction = { type: `BackendWebSocketService:findSubscriptionsByChannelPrefix`; handler: BackendWebSocketService['findSubscriptionsByChannelPrefix']; }; /** * Register a callback for specific channels * * @param options - Channel callback configuration * @param options.channelName - Channel name to match exactly * @param options.callback - Function to call when channel matches * * @example * ```typescript * // Listen to specific account activity channel * webSocketService.addChannelCallback({ * channelName: 'account-activity.v1.eip155:0:0x1234...', * callback: (notification) => { * console.log('Account activity:', notification.data); * } * }); * * // Listen to system notifications channel * webSocketService.addChannelCallback({ * channelName: 'system-notifications.v1', * callback: (notification) => { * console.log('System notification:', notification.data); * } * }); * ``` */ export type BackendWebSocketServiceAddChannelCallbackAction = { type: `BackendWebSocketService:addChannelCallback`; handler: BackendWebSocketService['addChannelCallback']; }; /** * Remove a channel callback * * @param channelName - The channel name to remove callback for * @returns True if callback was found and removed, false otherwise */ export type BackendWebSocketServiceRemoveChannelCallbackAction = { type: `BackendWebSocketService:removeChannelCallback`; handler: BackendWebSocketService['removeChannelCallback']; }; /** * Get all registered channel callbacks (for debugging) */ export type BackendWebSocketServiceGetChannelCallbacksAction = { type: `BackendWebSocketService:getChannelCallbacks`; handler: BackendWebSocketService['getChannelCallbacks']; }; /** * Create and manage a subscription with direct callback routing * * @param options - Subscription configuration * @param options.channels - Array of channel names to subscribe to * @param options.callback - Callback function for handling notifications * @returns Promise that resolves with subscription object containing unsubscribe method */ export type BackendWebSocketServiceSubscribeAction = { type: `BackendWebSocketService:subscribe`; handler: BackendWebSocketService['subscribe']; }; /** * Union of all BackendWebSocketService action types. */ export type BackendWebSocketServiceMethodActions = BackendWebSocketServiceConnectAction | BackendWebSocketServiceDisconnectAction | BackendWebSocketServiceSendMessageAction | BackendWebSocketServiceSendRequestAction | BackendWebSocketServiceGetConnectionInfoAction | BackendWebSocketServiceGetSubscriptionsByChannelAction | BackendWebSocketServiceChannelHasSubscriptionAction | BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction | BackendWebSocketServiceAddChannelCallbackAction | BackendWebSocketServiceRemoveChannelCallbackAction | BackendWebSocketServiceGetChannelCallbacksAction | BackendWebSocketServiceSubscribeAction; //# sourceMappingURL=BackendWebSocketService-method-action-types.d.mts.map