/** * El streamer o un moderador ha baneado permanentemente (permaban) a un usuario. */ interface BanInfoType{type:string; /** roomId - Identificación numérica del canal en cuestión. */ roomId:number; /** targetUserId - */ targetUserId:number; /** tmi - Timestamp del momento en que ocurre el evento. */ tmi:number;channel:string;username:string;raw:any;}interface TimeoutInfoType extends BanInfoType{type:string;banDuration:number;}type ClearChatType="clearchat"|"timeout"|"ban"; /** * El streamer o un moderador ha borrado todos los mensajes del canal */ interface ClearChatInfoType{ /** type - El tipo de evento, "clearchat" en este caso. */ type:ClearChatType; /** roomId - Identificación numérica del canal en cuestión. */ roomId:number; /** tmi - Timestamp del momento en que ocurre el evento. */ tmi:number; /** raw - Información cruda del evento, directamente desde Twitch. */ raw:string;}interface ClearMsgInfoType{username:string;roomId:number;type:string;tmi:number;channel:string;message:string;}interface RoomStateInfoType{type:string;emoteOnly:boolean;followersOnly:number;r9k:boolean;roomId:number;slow:number;subsOnly:boolean;channel:string;}interface AnnouncementInfoType{color:string;roomId:number;systemMsg:string;}type AnnouncementGroupType=AnnouncementInfoType|object;interface SubPlanType{planName:string;plan:string;isPrime:boolean;isTier1:boolean;isTier2:boolean;isTier3:boolean;}type SubType="sub"|"resub";interface SubInfoType{cumulativeMonths:number;months:number;multimonthDuration:number;multimonthTenure:number;shouldShareStreak:boolean;streakMonths:number;subPlan:SubPlanType;wasGifted:boolean;systemMsg:string;}type SubInfoOptionalType=SubInfoType|object;interface ReplyParentType{displayName:string;msgBody:string;msgId:string;userId:number;userLogin:string;}interface ReplyThreadType{parentMsgId:string;parentUserLogin:string;}interface ReplyType extends ReplyParentType,ReplyThreadType{type:string;}type ReplyInfoType=ReplyType|object;type ColorType="#ff0000"|"#0000ff"|"#008000"|"#b22222"|"#ff7f50"|"#9acd32"|"#ff4500"|"#2e8b57"|"#daa520"|"#d2691e"|"#5f9ea0"|"#1e90ff"|"#ff69b4"|"#8a2be2"|"#00ff7f";type PremiumColorType=string;interface UserInfoType{username:string;avatar?:Promise;displayName:string;color:ColorType|PremiumColorType;isVip:boolean;isMod:boolean;isSub:boolean;isTurbo:boolean;isPrime:boolean;isBot:boolean;} /** * * ISCORE: Identity language (raza, religión, género, orientación, discapacidad, hate...) * SSCORE: Sexually explicit language (palabras de tipo sexual, partes íntimas...) * ASCORE: Aggressive language (hostilidad, bullying...) * PSCORE: Profanity (lenguaje vulgar, útil para mantener un chat family-friendly) */ type ScoreFlagType="ISCORE"|"SSCORE"|"ASCORE"|"PSCORE";interface ScoreType{flag:ScoreFlagType;level:number;}interface FlagFragmentType{messageFragment:string;scoreList:Array;}type FlagsType=FlagFragmentType|object;interface MessageInfoType{id:string;isFirstMessage:boolean;isReturningChatter:boolean;isEmoteOnly:boolean;isHighlightedMessage:boolean;isGigantifiedEmoteMessage:boolean;isAnimatedMessage:boolean;flagsInfo?:FlagsType;roomId:number;userId:number;tmi:number;msgId:string;messageData:Array;message:HTMLSpanElement;rawMessage:string;}interface BitsInfoType{bits:number;}type BitsGroupType=BitsInfoType|object; /** * Badges que el usuario tiene visibles en el chat. */ interface BadgeInfoType{ /** Nombre del badge. */ name:string; /** Valor asociado al badge. */ value:string; /** Imagen identificativa del badge. */ image:string; /** Descripción del badge. */ description:string; /** Número completo de meses. */ fullMonths?:number; /** Número del fundador. */ founderNumber?:number; /** El usuario ha votado una predicción. */ predictionInfo?:string;}interface UserMessageInfoType{type:string;username:string;channel:string;message:string;badges:Array;userInfo:UserInfoType;messageInfo:MessageInfoType;replyInfo?:ReplyInfoType;bitsInfo?:BitsGroupType;raw:string;}type JoinPartType="join"|"part"; /** * Información del evento de entrada de un usuario. */ interface JoinPartInfoType{ /** Evento de entrada (join) o de salida (part). */ type:JoinPartType; /** Nombre de usuario de la persona. */ username:string; /** Canal en el que ha interactuado el usuario. */ channel:string; /** Información cruda como llega del servidor */ raw:string;}type NoticeGroupType="emote_only_off"|"emote_only_on"|"followers_on"|"followers_off"|"slow_on"|"slow_off"|"subs_on"|"subs_off"|"r9k_on"|"r9k_off";interface RaidInfoType{displayName:string;username:string;profileImageURL:string;viewerCount:number;}type RaidGroupType=RaidInfoType|object;interface MysteryGiftInfoType{massGiftCount:number;originId:string;isAnonymous:boolean;senderUsername:string;subPlan:string;systemMsg:string;senderCount?:number;}interface StandardPayforwardInfoType{gifterAnonymous:boolean;gifterId:number;gifterUserName:string;gifterDisplayName:string;recipientId:number;recipientUserName:string;recipientDisplayName:string;systemMsg:string;}interface CommunityPayforwardInfoType{gifterAnonymous:boolean;gifterId:number;gifterUserName:string;gifterDisplayName:string;systemMsg:string;}interface GiftPaidUpgradeInfoType{type:string;senderUsername:string;senderDisplayName:string;systemMsg:string;username:string;displayName:string;}interface PrimePaidUpgradeInfoType{type:string;username:string;displayName:string;subPlan:string;systemMsg:string;}interface GoalInfoType{contributionType:string;currentContributions:number;description:string;targetContributions:number;userContributions:number;}type GoalGroupType=GoalInfoType|object;interface GiftInfoType{giftMonths:number;months:number;originId:string;isAnonymous:boolean;gifterUserName:string;gifterDisplayName:string;recipientDisplayName:string;recipientId:number;recipientUserName:string;subPlan:SubPlanType;systemMsg:string;senderCount?:number;funString?:string;goalInfo?:GoalGroupType;}type GiftGroupType=MysteryGiftInfoType|StandardPayforwardInfoType|CommunityPayforwardInfoType|GiftPaidUpgradeInfoType|PrimePaidUpgradeInfoType|GiftInfoType|object;interface ViewerMilestoneType{category:string;copoReward:number;value:number;systemMsg:string;}interface BaseUserNotice{type:string;channel:string;userInfo:UserInfoType;messageInfo:MessageInfoType;message:string;raw:string;}interface SubNoticeType extends BaseUserNotice{type:"sub"|"resub"|"giftpaidupgrade"|"primepaidupgrade";subInfo:SubInfoOptionalType;}interface RaidNoticeType extends BaseUserNotice{type:"raid";raidInfo:RaidGroupType;}interface GiftNoticeType extends BaseUserNotice{type:"submysterygift"|"standardpayforward"|"subgiftpaidupgrade"|"subgift";giftInfo:GiftGroupType;}interface AnnouncementNoticeType extends BaseUserNotice{type:"announcement";announcementInfo:AnnouncementGroupType;}interface ViewerMilestoneNoticeType extends BaseUserNotice{type:"viewermilestone";milestoneInfo:ViewerMilestoneType;}interface UserNoticeInfoType extends BaseUserNotice{subInfo?:SubInfoOptionalType;giftInfo?:GiftGroupType;raidInfo?:RaidGroupType;announcementInfo?:AnnouncementGroupType;milestoneInfo?:ViewerMilestoneType;}type EventType="join"|"part"|"sub"|"resub"|"extendsub"|"primepaidupgrade"|"primecommunitygiftreceived"|"subgift"|"submysterygift"|"standardpayforward"|"subgiftpaidupgrade"|"anonsubgift"|"rewardgift"|"anongiftpaidupgrade"|"communitypayforward"|"bits"|"bitsbadgetier"|"charity"|"ritual"|"clearchat"|"ban"|"timeout"|"clearmsg"|"raid"|"unraid"|"roomstate"|"announcement"|"raw"|"message"|"action"|"emote_only_off"|"emote_only_on"|"followers_on"|"followers_off"|"slow_on"|"slow_off"|"subs_on"|"subs_off"|"r9k_on"|"r9k_off"|"viewermilestone"; /** * Tipos de eventos de Twitch que puedes escuchar */ type EventTypeMap={"clearchat":ClearChatInfoType;"ban":BanInfoType;"timeout":TimeoutInfoType;"clearmsg":ClearMsgInfoType;"sub":SubNoticeType;"resub":SubInfoType;"raid":RaidInfoType;"join":JoinPartInfoType;"part":JoinPartInfoType;"submysterygift":MysteryGiftInfoType;"communitypayforward":CommunityPayforwardInfoType;"standardpayforward":StandardPayforwardInfoType;"primepaidupgrade":PrimePaidUpgradeInfoType;"giftpaidupgrade":GiftPaidUpgradeInfoType;"subgift":GiftInfoType;"roomstate":RoomStateInfoType;"announcement":AnnouncementInfoType; /** Un usuario ha escrito un mensaje en el canal */"message":UserMessageInfoType;"action":UserMessageInfoType;"bits":BitsInfoType;"raw":object;"emote_only_on":NoticeGroupType;"emote_only_off":NoticeGroupType;"followers_on":NoticeGroupType;"followers_off":NoticeGroupType;"slow_on":NoticeGroupType;"slow_off":NoticeGroupType;"subs_on":NoticeGroupType;"subs_off":NoticeGroupType;"r9k_on":NoticeGroupType;"r9k_off":NoticeGroupType;"viewermilestone":ViewerMilestoneType;};type ImageApiConfig={type:"image";url:(username:string)=>string;};type JsonApiConfig={type:"json";url:(username:string)=>string;extract:(data:unknown)=>string;transform?:(url:string)=>string;};type TextApiConfig={type:"text";url:(username:string)=>string;transform?:(url:string)=>string;};type ApiConfig=ImageApiConfig|JsonApiConfig|TextApiConfig;type CustomJsonApi={url:(username:string)=>string;extract:(data:unknown)=>string;transform?:(url:string)=>string;};type CustomJsonApiConfig={url:string;extract:string;transform?:[string,string];};declare const APIS:Record;declare const getAvatar:(username:string,apiKey?:keyof typeof APIS)=>Promise;declare const setCustomApiFromJson:(config:CustomJsonApiConfig)=>void;interface OptionsObject{channels:Array;secure:boolean;avatarProvider:string;badges:Array;customApi:CustomJsonApiConfig;debug:boolean;}interface BadgeJSONInfoType{ /** Identificador del badge en formato "nombre/valor" (ej: "subscriber/12"). */ text:string; /** Valor asociado al badge. */ value:string|number; /** Imagen identificativa del badge. */ image:string; /** Descripción del badge. */ description:string;}declare class Client{#private;channels:Array;options:OptionsObject|undefined;badges:Array;constructor();connect(options:OptionsObject):void;isLive(channel:any):Promise;on(type:T,action:(data:EventTypeMap[T])=>void):void;pong():void;close():void;}declare const client:Client;interface HypeChatType{amount:number;currency:string;exponent:number;level:string;isSystemMessage:boolean;}type HypeChatInfoType=HypeChatType|object;export{type AnnouncementGroupType,type AnnouncementInfoType,type AnnouncementNoticeType,type BadgeInfoType,type BadgeJSONInfoType,type BanInfoType,type BaseUserNotice,type BitsGroupType,type BitsInfoType,type ClearChatInfoType,type ClearChatType,type ClearMsgInfoType,type CommunityPayforwardInfoType,type CustomJsonApi,type CustomJsonApiConfig,type EventType,type EventTypeMap,type FlagsType,type GiftInfoType,type GiftNoticeType,type GiftPaidUpgradeInfoType,type GoalGroupType,type GoalInfoType,type HypeChatInfoType,type JoinPartInfoType,type JoinPartType,type MessageInfoType,type MysteryGiftInfoType,type NoticeGroupType,type OptionsObject,type PrimePaidUpgradeInfoType,type RaidGroupType,type RaidInfoType,type RaidNoticeType,type ReplyInfoType,type RoomStateInfoType,type StandardPayforwardInfoType,type SubInfoOptionalType,type SubInfoType,type SubNoticeType,type SubPlanType,type SubType,type TimeoutInfoType,type UserInfoType,type UserMessageInfoType,type UserNoticeInfoType,type ViewerMilestoneNoticeType,type ViewerMilestoneType,client,getAvatar,setCustomApiFromJson};