export { C as ComponentMountPayload, b as ComponentType, a as ComponentUnmountPayload, V as VariableRecord, d as VariableType, c as VariableUpdatedPayload } from '../lifecycle-DRSAPNpC.js'; /** * Component Event Payloads * * Types for component_trigger and component_update events */ /** * Component trigger payload - sent when an alert/widget should activate * * Contains variant data that gets injected into template variables * * @example * ```typescript * window.eekoSDK.on('component_trigger', (payload) => { * console.log('Username:', payload.username); * console.log('Amount:', payload.amount); * }); * ``` */ interface ComponentTriggerPayload { /** Event category (donation, follow, subscription, bits, raid, custom) */ type?: string; /** Username who triggered the event */ username?: string; /** Display name (may differ from username) */ displayName?: string; /** Profile picture URL */ profilePictureUrl?: string; /** Message content (for donations, cheers, etc.) */ message?: string; /** Amount for monetary events */ amount?: number; /** Currency code (USD, EUR, etc.) or platform currency type */ currency?: string; /** Pre-formatted amount string (e.g., "$5.00", "100 bits") */ formattedAmount?: string; /** Source platform */ platform?: 'twitch' | 'kick' | 'youtube' | 'tiktok' | 'rumble'; /** Subscription tier (1, 2, or 3) */ tier?: number; /** Number of months subscribed */ months?: number; /** Number of gifted subs */ giftCount?: number; /** Whether this is anonymous */ isAnonymous?: boolean; /** Any additional custom data */ [key: string]: unknown; } /** * Component update payload - sent for state updates to widgets * * Used for interactive widgets that maintain state * * @example * ```typescript * window.eekoSDK.on('component_update', (payload) => { * console.log('Updated data:', payload.data); * }); * ``` */ interface ComponentUpdatePayload { /** Target component ID */ component_id?: string; /** Update data to apply */ data: Record; /** State changes */ state_update?: Record; /** Event timestamp */ timestamp?: number; } /** * Component dismiss payload - tells a widget to dismiss/hide the current alert. * * @example * ```typescript * window.eekoSDK.on('component_dismiss', () => { * alertEl.classList.remove('show'); * }); * ``` */ interface ComponentDismissPayload { /** Target component ID */ component_id?: string; /** Event timestamp */ timestamp?: number; /** Any additional dismiss data */ [key: string]: unknown; } /** * Chat Message Payload * * Unified chat message format supporting all platforms * (Twitch, Kick, YouTube, TikTok, Rumble) */ /** * Supported streaming platforms */ type Platform = 'twitch' | 'kick' | 'youtube' | 'tiktok' | 'rumble'; /** * Message fragment types for rich text */ type FragmentType = 'text' | 'emote' | 'mention' | 'cheermote' | 'link'; /** * Emote provider for third-party emote services */ type EmoteProvider = 'native' | 'bttv' | 'ffz' | '7tv'; /** * Message fragment for rich text content */ interface MessageFragment { /** Fragment type */ type: FragmentType; /** Text content of this fragment */ text: string; /** Emote name (for emote type) */ emoteName?: string; /** URL to emote image */ emoteUrl?: string; /** Platform-specific emote ID */ emoteId?: string; /** Emote provider (native platform or third-party) */ emoteProvider?: EmoteProvider; /** User ID being mentioned (for mention type) */ mentionUserId?: string; /** Username being mentioned */ mentionUsername?: string; /** Number of bits (for cheermote type) */ bits?: number; /** URL (for link type) */ url?: string; } /** * Badge information for user status display */ interface Badge { /** Badge identifier */ id: string; /** Human-readable badge name */ name: string; /** URL to badge image */ imageUrl?: string; /** Count for multi-level badges (e.g., months subscribed) */ count?: number; } /** * User status/roles in chat */ interface UserStatus { /** User is verified on the platform */ isVerified?: boolean; /** User is a channel moderator */ isModerator?: boolean; /** User is a subscriber/member */ isSubscriber?: boolean; /** User is a VIP */ isVip?: boolean; /** User is the channel broadcaster */ isBroadcaster?: boolean; /** Message is from an anonymous user */ isAnonymous?: boolean; /** User's badges */ badges?: Badge[]; } /** * Reply/thread information */ interface ReplyInfo { /** ID of the message being replied to */ messageId: string; /** Text of the original message */ text: string; /** User ID of original message author */ userId: string; /** Username of original message author */ username: string; /** Display name of original message author */ displayName?: string; } /** * User information in chat message */ interface ChatUser { /** Platform-specific user ID */ id: string; /** Username (login name) */ username: string; /** Display name (may differ from username) */ displayName?: string; /** URL to user's profile picture */ profilePictureUrl?: string; /** User's chat color (hex code) */ color?: string; } /** * Chat message context */ interface ChatContext { /** Source platform */ platform: Platform; /** Channel/room ID */ channelId: string; /** Channel/room name */ channelName?: string; /** Unique message ID */ messageId: string; /** ISO 8601 timestamp */ timestamp: string; } /** * Message content */ interface MessageContent { /** Plain text content */ text: string; /** Rich text fragments (emotes, mentions, etc.) */ fragments?: MessageFragment[]; } /** * Unified chat message payload * * This is the primary format for all chat messages across platforms * * @example * ```typescript * window.eekoSDK.on('chat_message', (message) => { * console.log(`${message.user.displayName}: ${message.message.text}`); * * if (message.userStatus?.isModerator) { * console.log('Message from a mod!'); * } * }); * ``` */ interface ChatMessagePayload { /** Message type identifier */ type: 'chat_message'; /** Context information */ context: ChatContext; /** User who sent the message */ user: ChatUser; /** Message content */ message: MessageContent; /** User status/badges */ userStatus?: UserStatus; /** Reply information (if this is a reply) */ replyTo?: ReplyInfo; /** Platform-specific data */ platformData?: Record; } /** * Type guard for ChatMessagePayload */ declare function isChatMessagePayload(msg: unknown): msg is ChatMessagePayload; export { type Badge, type ChatContext, type ChatMessagePayload, type ChatUser, type ComponentDismissPayload, type ComponentTriggerPayload, type ComponentUpdatePayload, type EmoteProvider, type FragmentType, type MessageContent, type MessageFragment, type Platform, type ReplyInfo, type UserStatus, isChatMessagePayload };