// Generated by dts-bundle v0.7.3 // Dependencies for this module: // ../../events // ../../@just4/ajax/interfaces // ../../@polyv/chat-sdk // ../../@polyv/rtas-sdk declare module '@polyv/interactions-receive-sdk' { /** * 互动功能 SDK 调用入口。 * @packageDocumentation */ import { updateConfig, updateRatsConfig } from '@polyv/interactions-receive-sdk/data-hub'; import { FeedBack } from '@polyv/interactions-receive-sdk/apps/feedback/feedback'; import { CheckIn } from '@polyv/interactions-receive-sdk/apps/check-in/check-in'; import { AnswerCard } from '@polyv/interactions-receive-sdk/apps/answer-card/answer-card'; import { PushCard } from '@polyv/interactions-receive-sdk/apps/push-card/push-card'; import { PopupAd } from "@polyv/interactions-receive-sdk/apps/popup-ad/popup-ad"; import { Lottery } from '@polyv/interactions-receive-sdk/apps/lottery/lottery'; import { Questionnaire } from '@polyv/interactions-receive-sdk/apps/questionnaire/questionnaire'; import { Announcement } from '@polyv/interactions-receive-sdk/apps/announcement/announcement'; import { RedEnvelope } from '@polyv/interactions-receive-sdk/apps/red-envelope/red-envelope'; import { RedpackRain } from '@polyv/interactions-receive-sdk/apps/redpack-rain/redpack-rain'; import { SeatTable } from '@polyv/interactions-receive-sdk/apps/seat-table/seat-table'; import { Vote } from '@polyv/interactions-receive-sdk/apps/vote/vote'; import { WelfareLottery } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/welfare-lottery'; import { QuestionAnswer } from '@polyv/interactions-receive-sdk/apps/question-answer/question-answer'; import { Tuwen } from '@polyv/interactions-receive-sdk/apps/tuwen/tuwen'; import { Product } from '@polyv/interactions-receive-sdk/apps/product/product'; import { getApiToken } from '@polyv/interactions-receive-sdk/utils/get-token'; import { RequestAuthorizeMethod } from '@polyv/interactions-receive-sdk/utils/ajax-utils'; import { EnrollLottery } from '@polyv/interactions-receive-sdk/apps/enroll-lottery/enroll-lottery'; import { Topic } from '@polyv/interactions-receive-sdk/apps/topic/topic'; import { RushAnswer } from '@polyv/interactions-receive-sdk/apps/rush-answer/rush-answer'; import { AddressManagement } from '@polyv/interactions-receive-sdk/apps/address-management/address-management'; import { Order } from '@polyv/interactions-receive-sdk/apps/order/order'; const version: string; export { updateRatsConfig, updateConfig, getApiToken, RequestAuthorizeMethod, FeedBack, CheckIn, AnswerCard, PushCard, Lottery, Questionnaire, Announcement, RedEnvelope, RedpackRain, SeatTable, Vote, WelfareLottery, Tuwen, Product, EnrollLottery, QuestionAnswer, Topic, RushAnswer, AddressManagement, Order, version, PopupAd, }; } declare module '@polyv/interactions-receive-sdk/data-hub' { /** * @internal * 公共数据存储 * @packageDocumentation */ import * as EventEmitter from 'events'; import { Config, DomainInfo, Store, UniversalParams } from '@polyv/interactions-receive-sdk/types'; import { SignatureMethod } from '@polyv/interactions-receive-sdk/types/encryption'; import { AuthorizeSignParams } from '@polyv/interactions-receive-sdk/utils/ajax-utils'; import { IARRatsConfig } from '@polyv/interactions-receive-sdk/types/rtas'; /** SDK 事件总线(区别于各模块实例内部的 eventEmitter,这里用于处理通知各模块同步配置等操作) */ export const SDKEventEmitter: EventEmitter; /** 请求token Promise 实例 */ export const privateDataHub: { getTokenPromise: Promise | null; }; export function generateDefaultDomainInfo(): Required; /** 互动接收端 SDK 配置信息 */ export let store: Store; /** * 更新互动接收端 SDK 配置 * @param newConfig 新配置信息 */ export function updateConfig(newConfig: Config): void; /** * 更新互动接收端 SDK 埋点配置 * @param ratsConfig */ export function updateRatsConfig(ratsConfig: IARRatsConfig): Promise; /** * 使用外部的 viewerApiToken getter 进行 token 更新 * @returns Promise */ export const asyncUpdateToken: () => Promise; /** * 使用外部的 viewerApiToken getter 进行 x-auth-token 更新 * @returns Promise */ export const asyncUpdateXAuthToken: () => Promise; export const asyncGetParamsSign: (params: UniversalParams, signatureMethod: SignatureMethod, secretKey?: string) => Promise; } declare module '@polyv/interactions-receive-sdk/apps/feedback/feedback' { /** * 反馈模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { feedBackEvents } from '@polyv/interactions-receive-sdk/apps/feedback/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { SubmitInfo } from '@polyv/interactions-receive-sdk/apps/feedback/message'; /** 提交反馈信息接口响应 */ export interface SubmitInfoRes { code: number; data: unknown; status: string; success: boolean; error: string; } /** * 反馈SDK * @class */ export class FeedBack extends App { /** 反馈模块事件 */ events: typeof feedBackEvents; /** 反馈类型ID */ feedTypeId: number; /** 反馈类型描述 */ feedTypeLabel: string; /** 额外反馈的详情 */ feedDetailed: string; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * @internal * 处理提交反馈 */ protected onSubmit(): void; /** * 提交反馈信息 * @param params 提交反馈的具体信息数据 * @returns Promise */ feedbackSave(params: SubmitInfo): Promise; /** * 生成验证码 * @param params 请求生成验证码具体信息数据 * @returns Promise */ getcode(): Promise; /** * 清除反馈模块逻辑 */ destroy(): void; } } declare module '@polyv/interactions-receive-sdk/apps/check-in/check-in' { /** * 签到模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { CheckInEvents } from '@polyv/interactions-receive-sdk/apps/check-in/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { CheckInMsg } from '@polyv/interactions-receive-sdk/apps/check-in/message'; import { CountdownCbData } from '@polyv/interactions-receive-sdk/types/countdown'; /** * 签到SDK * @class */ export class CheckIn extends App { /** 签到模块事件 */ events: typeof CheckInEvents; /** 当前签到总限时(秒) */ limitTime: number; /** 当前签到剩余时间 */ leftTime: number; /** 当前签到提示信息 */ message: string; /** 当前签到 ID */ checkinId: string; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * @internal * @param msg 初始化消息 */ protected onSliceIDHandler(msg: never): void; /** * @internal * 处理开始签到 * @param msg 签到消息 * @returns this */ protected onSignIn(msg: CheckInMsg): this; /** * @internal * 处理停止签到 * @param msg 停止签到消息 * @returns this */ protected onStopSignIn(): this; /** * 发送签到消息给后端服务 * @returns this */ toCheckIn(): this; getCheckInInfo(): Promise<{ code: number; data: Array<{ createTime: number; checked: 'Y' | 'N'; }>; }>; /** * 判断用户是否已签到 */ isUserCheckedIn(): Promise; getForceCheckInEnabled(): boolean; /** * @internal * 初始化倒计时 * @param time 签到总时间 * @returns this */ protected initCountdown(time: number): this; /** * @internal * 处理倒计时更新回调 * @param res 倒计时回调数据 */ protected onCountdownUpdate(res: CountdownCbData): void; /** * @internal * 停止并销毁倒计时 * @returns this */ protected stopCountdown(): this; /** * 清除签到模块逻辑 */ destroy(): void; } } declare module '@polyv/interactions-receive-sdk/apps/answer-card/answer-card' { /** * 答题卡模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { AnswerCardEvents } from '@polyv/interactions-receive-sdk/apps/answer-card/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { WsQuestionContentMsg, SDKQuestionContentMsg, QuestionItemTypes, QuestionTypes, StopQuestionMsg, AnswerQuestionRes, AnswerQuestionResCode, WsQuestionResultMsg, SDKQuestionDurationRes } from '@polyv/interactions-receive-sdk/apps/answer-card/message'; /** * 答题卡SDK * @class */ export class AnswerCard extends App { /** 答题卡模块事件 */ events: typeof AnswerCardEvents; /** 答题卡类型类型(普通/快速问答形式) */ questionTypes: typeof QuestionTypes; /** 题目类型列表 */ questionItemTypes: typeof QuestionItemTypes; /** 提交答案响应状态码常量列表 */ answerQuestionResCode: typeof AnswerQuestionResCode; /** 当前题目已提交的答案字符串 */ curSubmittedAnswer: string; /** * @internal * 是否正在提交数据 */ isSubmitting: boolean; /** * @internal * 当前题目数据 */ question: SDKQuestionContentMsg | undefined; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * @internal * 处理开始答题事件,封装题目信息 * @param msg 聊天室广播答题消息 */ protected onQuestionContent(msg: WsQuestionContentMsg): void; /** * @internal * 处理聊天室结束答题 * @param msg 聊天室结束答题消息 */ protected onStopQuestionContent(msg: StopQuestionMsg): void; /** * @internal * 处理聊天室答题结果消息 * @param msg 聊天室答题结果消息 */ protected onQuestionResult(msg: WsQuestionResultMsg): Promise; /** * 提交当前题目答案 * @param answers 答案数组 * @returns 答题回调信息 */ answerQuestion(answers: string[]): Promise; /** * 获取服务器端题目剩余时间 * @returns 答题剩余时间 */ getServerTime(): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/push-card/push-card' { /** * 卡片推送模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { PushCardEvents } from '@polyv/interactions-receive-sdk/apps/push-card/events'; import { MsgHandlers, CustomEventHandlers, ApiResponseData } from '@polyv/interactions-receive-sdk/types'; import { PushCardMsg, SdkGetPushCardDataRes } from '@polyv/interactions-receive-sdk/apps/push-card/message'; export class PushCard extends App { /** 卡片推送模块事件 */ events: typeof PushCardEvents; constructor(); /** 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** 模块对应特殊事件处理方法 */ protected get customEventHandlers(): CustomEventHandlers; /** * 监听卡片推送相关消息 */ protected onNewsPushMsg(res: string): this; /** * 强制推送卡片 * @api */ forcePushCard(msg: PushCardMsg): void; /** * 处理卡片推送开始 * @param msg 开始消息 * @returns this */ protected onStart(msg: PushCardMsg): this; /** * 强制取消当前推送的卡片 * @api */ forceCancelCurrentPushCard(): void; /** * 处理卡片推送取消 * @param msg 取消消息 * @returns this */ protected onCancel(msg: PushCardMsg): this; /** * 获取卡片剩余时间 * @returns this */ getResidueTime(): this; /** * 关闭卡片 */ toClose(): void; /** * 获取推送卡片数据 * @returns Promise; /** 卡片领取统计 */ obtainCard(channelId: string, cardId: string): Promise; getNewSessionData(): { newSessionEnabled: boolean; sessionId: string; }; /** * 销毁实例,清除逻辑 */ destroy(): void; } } declare module '@polyv/interactions-receive-sdk/apps/popup-ad/popup-ad' { import App from "@polyv/interactions-receive-sdk/apps/app"; import { PopImageAd } from "@polyv/interactions-receive-sdk/apps/popup-ad/types"; import { PopupJumpType } from '@polyv/interactions-receive-sdk/apps/popup-ad/enums'; export class PopupAd extends App { PopupJumpType: typeof PopupJumpType; constructor(); /** * 获取弹窗广告信息 * @example * ```js * const adData = await popupAd.getPopImageAd(); * console.log(adData); * ``` */ getPopImageAd(): Promise; /** * 生成跳转直播间链接地址 * @example * ```js * const liveChannelUrl = popupAd.generateLiveChannelUrl("1234567890"); * console.log(liveChannelUrl); * ``` */ generateLiveChannelUrl(channelId: string): string | null; } } declare module '@polyv/interactions-receive-sdk/apps/lottery/lottery' { /** * 抽奖模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { MsgHandlers, CustomEventHandlers, EnabledType } from '@polyv/interactions-receive-sdk/types'; import { LotteryEvents } from '@polyv/interactions-receive-sdk/apps/lottery/events'; import { LotteryStartMsg, OnLotteryMsg, WsLotteryEndMsg, SdkLotteryEndMsg, CollectInfo, DelayLotteryStartMsg, OnSliceIDMsg, LotteryStatus, AnXinLotteryListRes, AnXinLottery, DelayLotteryOverMsg, DelayLotteryEndMsg, LotteryListRes } from '@polyv/interactions-receive-sdk/apps/lottery/message'; import { LotteryResGroupData } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/message'; /** 提交中奖人信息接口参数 */ export interface SubmitInfo { /** 抽奖ID */ lotteryId: string; /** 兑换码 */ winnerCode: string; /** 场次ID(可选,不传则从配置中获取) */ sessionId?: string; /** 中奖人信息字段 */ receiveInfo: CollectInfo[]; } /** 提交中奖人信息接口响应 */ export interface SubmitInfoRes { code: number; data: string; message: string; status: string; } /** 获取中奖名单方法参数 */ export interface GetWinnersParams { /** 抽奖ID */ lotteryId: string; /** 页码 */ pageNumber: number; } /** 中奖人信息 */ export interface Winner { /** 中奖人名称 */ viewerName: string; } /** * @internal * 获取中奖名单响应 */ export interface WinnerRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; data: WinnerResData; } export interface WinnerResData { /** 中奖人列表 */ contents: Winner[]; /** 每页条数 */ pageSize: number; /** 总页数 */ totalPages: number; /** 页码 */ pageNumber: number; /** 是否为第一页 */ firstPage: boolean; /** 是否为最后一页 */ lastPage: boolean; /** 下一页页码 */ nextPageNumber: number; /** 上一页页码 */ prePageNumber: number; /** 总记录数 */ totalItems: number; } /** 获取场次中奖记录方法参数 */ export interface LotteryRecordParams { /** 频道号 */ channelId?: string; /** 场次ID */ sessionId?: string; /** 用户ID */ userId?: string; } /** * @internal * 场次中奖记录后端返回信息接口 */ export interface LotteryRecordRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; /** 响应内容 */ data: LotteryRecordResItem[]; } export interface BasicLotteryRecordResItem { /** 频道号 */ channelId: string; /** 抽奖ID */ lotteryId: string; /** 奖品名称 */ prize: string; /** 是否已领取 */ received: boolean; /** 场次号 */ sessionId: string; /** 兑换码 */ winnerCode: string; /** 是否展示兑换码 */ showWinnerCode: EnabledType; } /** * @internal * 后端返回个人中奖记录 */ export interface LotteryRecordResItem extends BasicLotteryRecordResItem { /** 中奖信息字段(字符串) */ collectInfo: string; } /** 个人中奖记录接口响应 */ export interface SdkLotteryRecordRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; /** 响应内容 */ data: SdkLotteryRecordResItem[]; } /** SDK 对外触发个人中奖记录 */ export interface SdkLotteryRecordResItem extends BasicLotteryRecordResItem { /** 中奖信息字段 */ collectInfo: CollectInfo[]; } /** * @internal * 剩余时间 websocket 响应数据体 */ export interface WsLotteryLeftTimeResData { /** 剩余时间 */ time: number; } /** * @internal * 剩余时间 websocket 响应 */ export interface WsLotteryLeftTimeRes { data: WsLotteryLeftTimeResData; } /** * @internal * 查询中奖者响应数据体 */ export interface CheckIsWinnerRes { data: CheckIsWinnerResBody; } /** * @internal * 查询中奖者响应数据体主体数据 */ export interface CheckIsWinnerResBody { /** 是否中奖 */ result: boolean; /** 个人中奖信息 */ data: CheckIsWinnerResData | null; } /** * @internal * 个人中奖信息 */ export interface CheckIsWinnerResData { /** 频道ID */ channelId: string; /** 场次ID */ sessionId: string; /** 抽奖ID */ lotteryId: string; /** 奖品名称 */ prize: string; /** 中奖兑换码 */ winnerCode: string; /** 信息收集字段 */ collectInfo: CollectInfo; } /** * 抽奖SDK * @class */ export class Lottery extends App { /** 抽奖模块事件 */ events: typeof LotteryEvents; /** 抽奖状态 */ lotteryStatus: typeof LotteryStatus; /** 安信 - 抽奖列表 */ lotteryList: Array; /** 服务器时间 */ serverTime: number; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * @internal * 抽奖事件处理方法(新版抽奖) */ protected get customEventHandlers(): CustomEventHandlers; /** * @internal * 处理初始化消息中的抽奖信息 * @param msg 初始化消息 */ protected onSliceIDHandler(msg: OnSliceIDMsg): void; /** * @internal */ protected onLotteryStart(msg: LotteryStartMsg): void; /** * @internal */ protected onLottery(msg: OnLotteryMsg): void; protected triggerUpdateLotteryList(): void; /** * @internal */ protected onLotteryEnd(msg: WsLotteryEndMsg): void; /** * @internal * 触发抽奖结束消息 * @param msg 抽奖结束消息 * @returns this */ protected triggerLotteryEnd(msg: WsLotteryEndMsg): this; /** * @internal * 监听处理 lottery 事件 * @param data 消息数据 */ onCustomLotteryEvent(data: unknown): void; /** * @internal */ protected onDelayLotteryStart(msg: DelayLotteryStartMsg): void; /** * @internal */ protected onDelayLotteryOver(msg: DelayLotteryOverMsg): void; /** * @internal */ protected onDelayLotteryEnd(msg: DelayLotteryEndMsg): void; /** * 提交中奖人信息 * @param info 中奖人信息 * @returns Promise */ submitInfo(info: SubmitInfo): Promise; /** * 获取中奖人数据 * @param params 获取中奖人列表请求参数 * @returns Promise */ getWinnersList(params: GetWinnersParams): Promise; getLotteryResultGroup(lotteryId: string): Promise; getLotteryGroupDetail(params: { lotteryId: string; groupId: string; pageNumber: number; pageSize: number; }): Promise; /** * 根据场次号查询用户中奖记录 * @param params 中奖记录调用参数 * @returns Promise 中奖记录列表 */ getLotteryRecord(params?: LotteryRecordParams): Promise; /** * @internal * 获取当前抽奖剩余时间 */ getLeftTime(): Promise; /** * @internal * 查询服务端当前未关闭抽奖的个人中奖情况 * @returns 抽奖信息 */ getResult(): Promise; /** * 查询抽奖列表 * @returns 抽奖列表 * */ getLastLotteryList(): Promise; /** * * 查询多轮抽奖列表(安信专用) * @returns 抽奖列表 */ getAnXinLotteryList(): Promise; /** * * 处理抽奖结果事件(安信专用) * 对于 安信抽奖,收到lotteryEnd 事件时,挂件文案显示为抽奖中 */ protected triggerAnXinLotteryEnd(lotteryEndMsg: SdkLotteryEndMsg): void; /** * * 处理抽奖over(安信专用) * 对于 安信抽奖,收到LotteryOver事件时,该抽奖已经结束,挂件文案展示已结束 */ protected triggerAnXinLotteryOver(msg: DelayLotteryOverMsg): void; /** * 销毁实例,清除逻辑 */ destroy(): void; } } declare module '@polyv/interactions-receive-sdk/apps/questionnaire/questionnaire' { /** * 问卷模块 * @packageDocumentation * - 获取/提交问卷 * - 获取当前问卷题目列表。 * - 提交问卷。 * - 获取结果 * - 获取当前问卷结果。 */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { QuestionnaireEvents } from '@polyv/interactions-receive-sdk/apps/questionnaire/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { AnswerItem, AnswerQuestionRes, AnswerQuestionResCode, OptionsAndTips, PersonAnswer, QuestionContent, QuestionItem, QuestionItemTypes, SocketAchievementMsg, SocketEndMsg, SocketQuestionItem, SocketRankResultMsg, SocketResultMsg, SocketStartMsg, UserRankResData } from '@polyv/interactions-receive-sdk/apps/questionnaire/message'; import { EvaluationQuestionData, EvaluationQuestionMockOptions, EvaluationQuestionnaireData, EvaluationQuestionRes } from '@polyv/interactions-receive-sdk/apps/questionnaire/evaluation'; export class Questionnaire extends App { events: typeof QuestionnaireEvents; questionItemTypes: typeof QuestionItemTypes; /** * @internal */ question: QuestionContent; answer: QuestionContent; /** 提交答案响应状态码常量 */ answerQuestionResCode: typeof AnswerQuestionResCode; questionnaireList: QuestionContent[]; constructor(); /** * @internal */ protected get msgHandlers(): MsgHandlers; /** * @internal * 设置问卷信息 * @param msg 问题信息 */ protected setQuestionContent(msg: SocketStartMsg): Promise; /** * @internal * 关闭问卷答题 */ protected stopQuestion(msg: SocketEndMsg): void; getOssQuestion(ossUrl: string): Promise>; /** * 获取问卷列表 * */ getQuestionnaireList(): Promise[]>; /** * 获取考试问卷倒计时 * */ getQnTimer(questionnaireId: string): Promise<{ leftTime: number; }>; /** * 提交问卷 * @param answers 提交问卷答案, 字符串数组如['a','cd','测试'] * @param questionnaireId 问卷Id * @returns 状态码 */ answerQuestion(answers: string[], questionnaireId: string): Promise; /** * 提交风险测评问卷 * @param questionnaire 问卷信息 * @param answers 提交问卷答案, 字符串数组如['a','cd','测试'] * @param mockOptions 是否为模拟测评 * @returns 状态码 */ commitEvaluationAnswer(questionnaire: EvaluationQuestionnaireData, answers: string[], mockOptions: EvaluationQuestionMockOptions): Promise | undefined>; /** * 获取风险测评问卷内容 * @returns 风险测评问卷内容 */ getEvaluationContent(mockOptions: EvaluationQuestionMockOptions): Promise; /** * @internal * 接收问卷结果 * @description 包含题目各个选项回答情况 */ protected receivedResult(msg: SocketResultMsg): Promise; protected handlePersonResult(msg: SocketAchievementMsg): Promise; /** * @internal * 获取个人答题信息 */ protected setPersonResult(msg: SocketAchievementMsg): Promise; /** * @internal * 获取答题排行榜信息 */ protected setRankResult(msg: SocketRankResultMsg): Promise; /** * @internal * 获取当前用户答题排行榜信息 */ protected setCurrentRankDetail(questionnaireId: string): Promise; /** * @internal * 接口获取个人答题选项 */ getPersonAnswer(questionnaireId: string): Promise>; /** * @internal * 将数组格式的 options 和 tips 转换为对象格式的数据。 */ static formatOptionsAndTipsToObject({ options, tips }: { options: string[]; tips?: string[]; }): OptionsAndTips; /** * @internal * 将对象格式的 options 和 tips 转换为数组格式的数据。 */ static formatOptionsAndTipsToArray(data: T): { options: string[]; tips: string[]; }; /** * @internal * 将接口返回的题目列表数据格式化为 QuestionItem 格式。 */ static formatQuestionList(questions: Array): Array; /** * @internal * 将接口返回的题目列表数据格式化为 AnswerItem 格式。 */ static formatAnswerList(questions: Array): Array; } } declare module '@polyv/interactions-receive-sdk/apps/announcement/announcement' { /** * 公告模块 * @packageDocumentation * 实现公告功能: * - 获取公告信息 * - 移除公告信息 */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { AnnouncementEvents } from '@polyv/interactions-receive-sdk/apps/announcement/events'; import { MsgHandlers, ApiResponseData } from '@polyv/interactions-receive-sdk/types'; import { AnnounceContent, SocketAnnounceMsg, SocketRemoveBulletinMsg, BulletinListResList } from '@polyv/interactions-receive-sdk/apps/announcement/message'; /** * 公告SDK * @class */ export class Announcement extends App { /** * 公告模块事件 */ events: typeof AnnouncementEvents; /** * 公告内容 */ content?: AnnounceContent; constructor(); /** * @internal */ protected get msgHandlers(): MsgHandlers; /** * @internal * 设置公告信息 * @param msg 问题信息 */ protected setAnnouncementContent(msg: SocketAnnounceMsg): void; /** * @internal * @title 关闭公告信息 */ protected clearAnnouncement(msg: SocketRemoveBulletinMsg): void; /** * @internal * 获取本地存储的公告内容 * @returns 公告内容 */ protected getStorageAnnounce(): AnnounceContent; /** * @internal * 将已读公告写入本地存储 * @param announcement 公告内容 */ protected addToStorage(announcement: AnnounceContent): void; /** * @internal * 将当前公告设为已读 */ protected markCurReaded(): void; /** * @internal * 移除本地存储的公告 */ protected removeFromStorage(): void; /** * 获取房间公告列表。 * @returns 房间公告列表。 */ getBulletinList(score?: number, size?: number): Promise>; } } declare module '@polyv/interactions-receive-sdk/apps/red-envelope/red-envelope' { import App from '@polyv/interactions-receive-sdk/apps/app'; import { RedEnvelopeEvents } from '@polyv/interactions-receive-sdk/apps/red-envelope/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { RedEnvelopeDelayMsg, RedEnvelopeMsg, RedQuestionnaireData, RedQuestionnaireProcessData } from '@polyv/interactions-receive-sdk/apps/red-envelope/message'; import { OptionsAndTips } from '@polyv/interactions-receive-sdk/apps/questionnaire/message'; /** 领取红包接口返回数据 */ interface ReceiveResData { /** 领取ID */ logId: string; /** 用户ID */ userId: string; /** 红包ID */ redpackSendId: string; /** 频道ID */ channelId: string; /** 微信openId */ openid: string; /** 微信unoinId */ unoinId: string; /** 领取金额 */ amount: number; /** 红包类型 RAIN 红包雨 口令红包 PASSWORD 普通红包 OFFICIAL_NORMA; 积分红包雨 score_redpack_rain 积分口令红包 SCORE_PASSWORD 积分普通 SCORE_OFFICIAL_NORMAL */ redPackType: string; [key: string]: unknown; } /** 领取红包接口响应数据 */ interface ReceiveRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; data?: ReceiveResData; } /** 查询红包状态接口响应数据 */ interface RedEnvelopeStatusRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; /** 数据 */ data: unknown; } interface GetNewestResData { /** 发红包的用户头像 */ avatar: string; /** 祝福语 */ greeting: string; /** 发红包的用户昵称 */ nickname: string; /** 红包存量ID */ redCacheId: string; /** 红包ID */ redpackId: string; /** 定时红包发送时间 */ sendTime: number; /** 服务器时间 */ serverTime: number; /** 定时红包开关,Y:开启定时红包,N:关闭定时红包 */ timeEnabled: string; } interface GetNewestResError { code: number; desc: string; } interface GetNewestRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; /** 红包信息 */ data?: GetNewestResData; /** 请求失败响应的错误信息 */ error?: GetNewestResError; } /** * @internal * 获取领取红包列表响应 */ export interface receiveListRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; data: receiveList; } export interface receiveList { content: ReceiveResData; /** 当前页数 */ pageNumber: number; /** 总页数 */ totalPages: number; /** 每页条数 */ pageSize: number; } export class RedEnvelope extends App { /** 红包模块事件 */ events: typeof RedEnvelopeEvents; constructor(); /** 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * 处理红包消息 * @param msg 红包消息 * @returns this */ protected onRedPaper(msg: RedEnvelopeMsg): this; /** * 处理延时红包信息 * @param msg 红包消息 */ protected onRedPaperDelay(msg: RedEnvelopeDelayMsg): this; /** * 查询红包状态 * @param redpackId 红包ID * @param redCacheId 红包缓存ID */ checkReceiveCache(redpackId: string, redCacheId: string): Promise; /** * 领取红包 * @param redpackId 红包ID * @param redCacheId 红包缓存ID * @param password 口令,口令红包时需传 */ grabRedEnvelope(redpackId: string, redCacheId: string, password?: string): Promise; /** * 查询当前是否有倒计时红包(红包挂件) */ getNewest(): Promise; /** * 查询红包记录 */ getReceiveList(getReceiveListParams: { pageNumber: number; redPackType: string; }): Promise; submitQuestionnaireAnswer(params: { redpackId: string; questionId: string; questionGroupId: string; answer: string; }): Promise; getQuestionnaireProcess(params: { redpackId: string; questionGroupId: string; }): Promise>; getQuestionnaireData(params: { redpackId: string; questionGroupId: string; }): Promise; /** * @internal * 将对象格式的 options 和 tips 转换为数组格式的数据。 */ static formatOptionsAndTipsToArray(data: T): { options: string[]; tips: string[]; }; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/redpack-rain/redpack-rain' { import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import App from '@polyv/interactions-receive-sdk/apps/app'; import { RedpackRainEvents } from '@polyv/interactions-receive-sdk/apps/redpack-rain/events'; import { RedEnvelopeMsg } from '@polyv/interactions-receive-sdk/apps/red-envelope/message'; import { GrabRedpackParams, JoinRedpackRainParams, ReceiveRedpackRainResult, RedpackRainReceiveStatus } from '@polyv/interactions-receive-sdk/apps/redpack-rain/types'; /** * 红包雨核心类 */ export class RedpackRain extends App { events: typeof RedpackRainEvents; RedpackRainReceiveStatus: typeof RedpackRainReceiveStatus; /** 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * 处理红包消息 * @param msg 红包消息 * @returns this */ protected onRedPaper(msg: RedEnvelopeMsg): this; joinRedpackRain(params: JoinRedpackRainParams): Promise; /** * 领取红包 */ grabRedpack(params: GrabRedpackParams): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/seat-table/seat-table' { import { CustomEventHandlers, MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import App from '@polyv/interactions-receive-sdk/apps/app'; import { SeatTableEvents } from '@polyv/interactions-receive-sdk/apps/seat-table/events'; import { AddSeatTableMsg, ViewerSeatInfo, Config, SeatLikeMsg } from '@polyv/interactions-receive-sdk/apps/seat-table/message'; import { SaveSeatInfoData, UserSeatInfo, SeatList, SeatInfo, ChannelConfig, EntryParams, ExtViewerSeatInfo, SeatTemplate } from '@polyv/interactions-receive-sdk/apps/seat-table/types'; /** * 坐席表核心类 */ export class SeatTable extends App { events: typeof SeatTableEvents; seatTemplate: typeof SeatTemplate; viewerSeat: ViewerSeatInfo; seatChannelConfig: ChannelConfig; constructor(config?: Config); /** * 坐席:用户入座 * @params entryParams 用户入座信息 * */ entrySeatTale(entryParams: EntryParams): Promise; /** * 观看页-更新坐席数据 * */ updateViewerSeat(data: ViewerSeatInfo): void; /** * 获取坐席频道设置 * */ getChannelSeatInfo(): Promise; protected get customEventHandlers(): CustomEventHandlers; protected onOtherMsg(msg: string): this; /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; onLike(msg: SeatLikeMsg): void; onAddSeating(msg: AddSeatTableMsg): void; onTopicOver(msg: AddSeatTableMsg): void; _getUserSeatInfo(): Promise; /** * 获取关注列表 * * */ getFollowList(params: { offset: number; size: number; type: string; }): Promise>; /** * 获取用户的坐席信息 * @param type 用户身份 guest嘉宾 viewer观众 默认为观众 * @param seatViewerId 用户id */ getUserSeatInfo(type: string, seatViewerId?: string): Promise; _saveSeat(): Promise; /** * 当前用户上坐 */ saveSeat(): Promise; /** * 获取坐席列表 */ getSeatList(): Promise; /** * 收藏用户 * @param customSeatInfo 被收藏的用户 * */ followUser(customSeatInfo: SeatInfo): Promise; cancelFollowUser(customSeatInfo: SeatInfo): Promise; /** * 点赞嘉宾 * */ clickLike(params: { userId: string; times: number; }): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/vote/vote' { /** * 投票模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { MsgHandlers, CustomEventHandlers } from '@polyv/interactions-receive-sdk/types'; import { VoteEvents } from '@polyv/interactions-receive-sdk/apps/vote/events'; import { VoteStartMsg, VoteStopMsg, VoteResultMsg, VoteDeleteAllMsg, VoteDeleteMsg, UpdateVoteOrderMsg, VoteListRes, VoteListItem, ToVoteRes, SliceIdMsg } from '@polyv/interactions-receive-sdk/apps/vote/message'; interface VotingList { [key: string]: VoteListItem; } export class Vote extends App { /** 投票模块事件 */ events: typeof VoteEvents; curVotedList: Array; /** 当前在进行的投票活动 */ votingList: VotingList; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** 模块对应所需的事件及处理方法 */ protected get voteMsgHandlers(): MsgHandlers; /** 模块对应所需的事件及处理方法 */ protected get customEventHandlers(): CustomEventHandlers; onVoteMsg(res: string): this; /** * @internal * 处理初始化消息中的投票信息 * @param msg 初始化消息 */ protected inVoteSliceID(msg: SliceIdMsg): void; /** * 处理投票开始事件 * @param msg 聊天室广播投票开始消息 */ protected onVoteStart(msg: VoteStartMsg): void; /** * 处理投票结束事件 * @param msg 聊天室广播投票结束消息 */ protected onVoteStop(msg: VoteStopMsg): void; /** * 处理投票结果事件 * @param msg 聊天室广播投票结果消息 */ protected onVoteResult(msg: VoteResultMsg): void; /** * 处理清空投票事件 * @param msg 聊天室广播清空投票消息 */ protected onVoteDeleteAll(msg: VoteDeleteAllMsg): void; /** * 处理删除投票事件 * @param msg 聊天室广播投票删除消息 */ protected onVoteDelete(msg: VoteDeleteMsg): void; protected onVoteChangeOrder(msg: UpdateVoteOrderMsg): void; /** * 给选项投票 * @param id 投票ID */ toVote(id: string): Promise; /** * 获取已投票列表 * */ getVotedList(): Array; /** * 新增 已投票的id * */ pushVotedList(id: string): void; /** * 获取投票选项列表 */ getVoteList(): Promise; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/welfare-lottery/welfare-lottery' { /** * 条件抽奖模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { WelfareLotteryEvents } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/events'; import { WelfareLotteryStartMsg, WelfareLotteryQuestionnaireStartSocketMsg, WelfareLotterytEndMsg, TaskConditionResData, LotteryPrizeResData, LotteryWinListParams, LotteryWinListResData, LotteryDetailResData, GetWinnersParams, WinnerResData, SubmitInfo, SubmitInfoRes, WatchTimeParams, LotteryCondition, LotteryQuestionStatus, WelfareLotteryQuestionStartMsg, QuestionMsg, AnsweredResult, LotteryResGroupData, QuestionnaireCompletionStatus } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/message'; import { LotteryStartMsg } from '@polyv/interactions-receive-sdk/apps/lottery/message'; import { MsgHandlers, ApiResponseData, CustomEventHandlers, PendantListResData } from '@polyv/interactions-receive-sdk/types'; export class WelfareLottery extends App { /** 条件抽奖模块事件 */ events: typeof WelfareLotteryEvents; /** 当前最新一场条件抽奖ID */ lotteryId: string; /** 当前最新一场问卷抽奖的问卷ID */ questionnaireId: string; /** 条件抽奖类型 */ lotteryCondition: typeof LotteryCondition; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; protected get customEventHandlers(): CustomEventHandlers; protected onOtherMsg(msg: string): this; /** * 条件抽奖活动开始 */ protected onStart(msg: WelfareLotteryStartMsg): this; /** * 条件抽奖活动结束 */ protected onEnd(msg: WelfareLotterytEndMsg): this; /** * 获取挂件列表 * @returns Promise */ getPendantList(): Promise; /** * 获取任务完成情况 * @param lotteryId 抽奖ID,选传,默认为最新的一次抽奖ID * @returns Promise */ getTaskCondition(lotteryId?: string): Promise; /** * 查询中奖奖品 * @param lotteryId 抽奖ID,选传,默认为最新的一次抽奖ID * @returns Promise */ getLotteryPrize(lotteryId?: string): Promise; getLotteryResultGroup(lotteryId: string): Promise; getLotteryGroupDetail(params: { lotteryId: string; groupId: string; pageNumber: number; pageSize: number; }): Promise; /** * 判断能否满足评论抽奖条件。(观看页或外部接入时,发言使用) * @params comment * */ isBooleanToCommentLottery(comment: string): Promise; /** * SDK-UI 调用发送评论,参与抽奖 * @param comment 评论内容 */ sendComment(comment: string): Promise; /** * 完成评论抽奖 * */ finishCommentLottery(): Promise; /** * 查询中奖历史 * @param params 查询中奖历史请求参数,选传 * @returns Promise */ getLotteryWinList(params?: LotteryWinListParams): Promise; /** * 获取抽奖活动信息 * @param lotteryId 抽奖ID,选传,默认为当前最新一场抽奖ID * @returns Promise */ getWelfareLotteryDetail(lotteryId?: string): Promise; /** * 获取中奖用户列表 * @param params 获取中奖人列表请求参数,选传 * @returns Promise */ getWinnersList(params?: GetWinnersParams): Promise; /** * 提交中奖人信息 * @param info 中奖人信息 * @returns Promise */ submitInfo(info: SubmitInfo): Promise; /** * 保存观看时长 */ saveWatchTime(params: WatchTimeParams): Promise; protected onQuestionStart(msg: WelfareLotteryQuestionStartMsg): void; /** 问卷发起抽奖 */ protected onQuestionnaireStart(msg: WelfareLotteryQuestionnaireStartSocketMsg): void; protected onAddNewQuestion(msg: QuestionMsg): void; protected onOpenQuestionPrize(msg: WelfareLotteryQuestionStartMsg): void; protected onOpenQuestionnairePrize(msg: LotteryStartMsg): void; protected onQuestionEnd(): void; /** * 观众开始答题 * */ startQuestion(): Promise<{ questionId: string; }>; /** * 观众提交-问题答案 * */ sendQuestionAnswer(params: { answer: string; questionId: string; }): Promise; /** * 获取当前问卷抽奖信息 * */ getLotteryQuestionStatus(): Promise; /** * 获取当前问卷抽奖信息 * */ getLastAnsweredResult(): Promise; /** 获取当前抽奖问卷完成情况 */ getLotteryQuestionnaireCompletionStatus(): Promise; /** * 销毁实例,清除逻辑 */ destroy(): void; } } declare module '@polyv/interactions-receive-sdk/apps/question-answer/question-answer' { import App from '@polyv/interactions-receive-sdk/apps/app'; import { FiltersParams, QuestionAnswerMsg } from '@polyv/interactions-receive-sdk/apps/question-answer/message'; import { QuestionAnswerEvents } from '@polyv/interactions-receive-sdk/apps/question-answer/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; /** * 问答。 */ export class QuestionAnswer extends App { events: typeof QuestionAnswerEvents; constructor(); protected bindSDKEventEmitter(): void; protected get msgHandlers(): MsgHandlers; /** * 获取问答列表数据。 * @param {Object} filters 请求参数。 * @param [filters.id=-1] 从哪个id开始获取。如果没传,则表示获取最近的数据。 * @param [filters.size=10] 每次获取多少条数据。 * @param [filters.order=0] 获取数据的顺序。0表示id从大到小(往下加载);1表示id从小到大(往上加载)。 * @param [filters.getSelf=0] 是否只获取与自己相关的问答。1代表是,0代表不是。 * @param [filters.getCurrent=0] 返回的列表是否包括所传id对应的数据。1表示包括,0表示不包括。 */ fetchList(filters: FiltersParams): Promise<{ data: Array; }>; protected handleSocketAnswer(msg: QuestionAnswerMsg): void; protected handleSocketDelAnswer(msg: QuestionAnswerMsg): void; /** * 发送问题。 * @param {String} content 问题内容。 */ sendQuestion(content: string): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/tuwen/tuwen' { /** * 图文模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { MessageType, TuwenContent, SocketUpdateEvent, SocketDeleteEvent, SocketStickyEvent, SocketUserEvent, SocketEventTypes, MessageItem, UserInfoBase } from '@polyv/interactions-receive-sdk/apps/tuwen/message'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; export class Tuwen extends App { /** 相关聊天室事件 */ events: SocketEventTypes; /** 列表消息类型, 默认为图文 */ messageType: string; /** 消息流 */ messages: Array; /** 顶部消息流 */ topMessages: Array; /** 主持人信息 */ masterUserInfo: UserInfoBase; /** 消息数量 */ total: number; constructor(); /** * 清空聊天消息 */ clearMessageList(): void; /** 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * 获取直播列表信息 (包含主持人信息) * @param {string} startId 数据起始 ID, startId为空则表示初始化数据,默认请求前十条数据 * @return {Promise} */ getTuwenInfo(startId?: string): Promise; /** * 修改列表图文类型 * @param {string} type 图文类型 * @return {Promise} */ changeMessageType(type: MessageType): Promise; /** 创建/编辑数据 */ _updateMessage(msg: SocketUpdateEvent): void; /** 删除数据 */ _delMessage(msg: SocketDeleteEvent): void; /** * 添加/取消置顶消息 * 通过top判断消息类型, N为移除, Y为添加 */ _updateStickyMessage(msg: SocketStickyEvent): void; /** 更新用户信息 */ _updateUserInfo(msg: SocketUserEvent): void; /** 查找id对应消息列表中所在索引 */ getMessageIndexById(id: number): { topMessageIndex: number; messageIndex: number; }; } } declare module '@polyv/interactions-receive-sdk/apps/product/product' { import { CustomEventHandlers, MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import App from '@polyv/interactions-receive-sdk/apps/app'; import { ProductEvents } from '@polyv/interactions-receive-sdk/apps/product/events'; import { GetProductListParams, ProductLinkType, ProductListData, ProductMessageStatus, ProductType, ProductData, GetProductLabelListParams, ProductLabelListData, GetProductListByTagParams, ProductListPageData, ProductExplainStatus } from '@polyv/interactions-receive-sdk/apps/product/types'; import { trackLogParams } from '@polyv/interactions-receive-sdk/types/rtas'; /** * 商品库核心类 */ export class Product extends App { events: typeof ProductEvents; ProductType: typeof ProductType; ProductLinkType: typeof ProductLinkType; ProductMessageStatus: typeof ProductMessageStatus; ProductExplainStatus: typeof ProductExplainStatus; constructor(); /** 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; protected get customEventHandlers(): CustomEventHandlers; /** * 解析商品的扩展字段 */ static parseProductExt(data: ProductData): void; /** * 获取商品库的商品列表 */ getProductList(params?: GetProductListParams): Promise; /** * 获取商品库的商品列表 */ getProductListByShowId(params?: GetProductListParams): Promise; getProductListByTagId(params: GetProductListByTagParams): Promise; /** * 获取商品标签列表 */ getProductLabelList(params?: GetProductLabelListParams): Promise; clickBuyProduct(good: ProductData, productLinkJumpTipEnabled: 'Y' | 'N'): Promise; /** 关闭商品库卡片 */ closeProductBubble(): void; /** * 获取当前正在推送的商品,主要用于刷新页面后展示 */ getCurrentPushingProduct(): Promise; /** * 根据商品 id 获取商品信息 * @param productId 商品 id */ getProductById(productId: string | number): Promise; getProductExplainEnabled(): boolean; /** * 生成商品讲解回放页地址 * @param params * @returns {string} */ generateProductExplainPageUrl(params?: T): string | null; trackLog(data: trackLogParams): Promise; } } declare module '@polyv/interactions-receive-sdk/utils/get-token' { export interface GetApiTokenOption { channelId: string; viewerId: string; } export interface GetApiTokenReturn { token: string; } export const getApiToken: (options: GetApiTokenOption) => Promise; export const getTokenPromiseHandler: (updateToken?: boolean) => Promise; } declare module '@polyv/interactions-receive-sdk/utils/ajax-utils' { import { IAJAXOptions } from '@just4/ajax/interfaces'; import { ApiResponseData, UniversalParams } from '@polyv/interactions-receive-sdk/types'; import { EncryptResponseType, SignatureMethod } from '@polyv/interactions-receive-sdk/types/encryption'; /** * 请求授权方式 */ export enum RequestAuthorizeMethod { /** 通过 viewerApiToken 授权 */ Token = "token", /** 通过签名授权 */ Sign = "sign" } /** * sign 签名参数 */ export interface AuthorizeSignParams { appId?: string; sign: string; timestamp: number; xbody?: string; } export type AsyncRequestParams

= P & Partial; export interface AsyncRequestGeneratorOptions

{ /** 触发请求 */ asyncRequest: (params: AsyncRequestParams

, ajaxOptions?: IAJAXOptions) => Promise; /** 请求参数 */ params: P; /** post请求入参加密 */ postEncrypt?: boolean; /** 授权方式 */ requestAuthorizeMethod?: RequestAuthorizeMethod; /** 使用 token 方式授权时的字段名,默认:token */ tokenField?: string; /** 使用 特定的secretKey 进行签名 */ secretKey?: string; /** 签名方式 */ signatureMethod?: SignatureMethod; /** 是否添加放重放 */ signatureNonce?: boolean; /** 返回数据加密类型 */ encryptResponseType?: EncryptResponseType; /** 是否使用互动密钥来解密,默认:false */ interactDecrypt?: boolean; } /** * token 方式授权请求 */ export const asyncRequestTokenGenerator:

(options: AsyncRequestGeneratorOptions

) => Promise; /** * sign 方式授权请求 */ export const asyncRequestSignGenerator:

(options: AsyncRequestGeneratorOptions

) => Promise; /** * 解密接口返回内容 * @param result * @param isInteractDecrypt 是否默认开启互动加密的接口 * @returns */ export const asyncDecryptResponse: (result: ApiResponseData, options: AsyncRequestGeneratorOptions) => ApiResponseData; /** * 请求封装器 * @param options */ export const asyncRequestGenerator:

(options: AsyncRequestGeneratorOptions

) => Promise; } declare module '@polyv/interactions-receive-sdk/apps/enroll-lottery/enroll-lottery' { /** * 报名抽奖模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { EnrollLotteryEvents } from '@polyv/interactions-receive-sdk/apps/enroll-lottery/events'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { LotteryForDataMsg, SubmitInfoParams, WinnerListParams, WinnerResData } from '@polyv/interactions-receive-sdk/apps/enroll-lottery/message'; /** * 报名抽奖SDK * @class */ export class EnrollLottery extends App { /** 抽奖模块事件 */ events: typeof EnrollLotteryEvents; /** 是否已报名 */ hasEnrolled: boolean; constructor(); /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; protected onUpdateLotteryDetail(): Promise; protected onStartLotteryForSignUp(msg: LotteryForDataMsg): void; protected onEndLotteryForSignUp(msg: LotteryForDataMsg): void; /** * 获取报名抽奖详情 * */ getEnrollLotteryDetail(): Promise; /** 提交用户信息 * @params SubmitInfoParams 用户信息 * */ submitInfo(params: SubmitInfoParams): Promise; /** 获取中奖列表 * @params params 抽奖信息 * */ getWinnerList(params: WinnerListParams): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/topic/topic' { import { CustomEventHandlers, MsgHandlers, PendantListResData } from '@polyv/interactions-receive-sdk/types'; import App from '@polyv/interactions-receive-sdk/apps/app'; import { TopicEvents } from '@polyv/interactions-receive-sdk/apps/topic/events'; import { EntranceStatus, TopicData, TopicMessage, DeleteTopicMsg } from '@polyv/interactions-receive-sdk/apps/topic/message'; /** * 话题PK */ export class Topic extends App { events: typeof TopicEvents; topicData: TopicData; constructor(); protected get customEventHandlers(): CustomEventHandlers; protected onOtherMsg(msg: string): this; /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** 话题开始 */ protected onTopicStart(msg: TopicMessage): void; /** 话题结束 */ protected onTopicOver(msg: TopicMessage): void; /** 话题图标显示隐藏 */ protected changeEntrance(msg: EntranceStatus): void; /** 话题统计人数 */ protected onStatistics(msg: TopicData): void; /** 话题删除时,重新获取话题数据 */ protected onDelete(msg: DeleteTopicMsg): Promise; /** * 提交话题答案 * answer: left表示反方观点,right表示正方观点 * */ chooseAnswer(answer: string): Promise; /** 获取话题数据 */ getTopicData(): Promise; /** * 获取挂件列表 * @returns Promise */ getPendantList(): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/rush-answer/rush-answer' { /** * 投票模块 * @packageDocumentation */ import App from '@polyv/interactions-receive-sdk/apps/app'; import { MsgHandlers } from '@polyv/interactions-receive-sdk/types'; import { RushAnswerEvents } from '@polyv/interactions-receive-sdk/apps/rush-answer/events'; import { StartAnswerQuicklyMsg, StopAnswerQuicklyMsg, AnswerQuicklyRemainingMsg, AnswerQuicklyStatusMsg } from '@polyv/interactions-receive-sdk/apps/rush-answer/message'; export class RushAnswer extends App { /** 抢答模块事件 */ events: typeof RushAnswerEvents; constructor(); /** 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * @internal * @param msg 初始化消息 */ protected onSliceIDHandler(msg: never): void; /** * 处理抢答开始事件 * @param msg 聊天室广播抢答开始消息 */ protected onStartAnswerQuickly(msg: StartAnswerQuicklyMsg): void; /** * 处理抢答结束事件 * @param msg 聊天室广播抢答结束消息 */ protected onStopAnswerQuickly(msg: StopAnswerQuicklyMsg): void; /** * 处理抢答剩余名额事件 * @param msg 聊天室广播抢答剩余名额消息 */ protected onAnswerQuicklyRemaining(msg: AnswerQuicklyRemainingMsg): void; /** * 处理抢答状态事件 * @param msg 聊天室广播抢答状态 */ protected onAnswerQuicklyStatus(msg: AnswerQuicklyStatusMsg): void; /** * 获取当前房间抢答状态 */ getStatus(): Promise; /** * 抢答 * @param quicklyId 抢答ID */ submit(quicklyId: string, useTime: number): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/address-management/address-management' { import App from '@polyv/interactions-receive-sdk/apps/app'; import type { GetAddressListOfUserParams, AddAddressParams, UpdateAddressParams, DeleteAddressParams, AddressDetailResponse, GetAddressListOfUserResponse } from '@polyv/interactions-receive-sdk/apps/address-management/types'; export class AddressManagement extends App { constructor(); /** * @description: 获取地址列表 */ getAddressListOfUser(params?: GetAddressListOfUserParams): Promise; /** * @description: 添加地址 */ addAddress(params?: AddAddressParams): Promise; /** * @description: 修改地址 */ updateAddress(params: UpdateAddressParams): Promise; /** * @description: 删除地址 */ deleteAddress(params: DeleteAddressParams): Promise; /** * @description: 获取用户默认地址 */ getDefaultAddressOfUser(): Promise; } } declare module '@polyv/interactions-receive-sdk/apps/order/order' { import App from '@polyv/interactions-receive-sdk/apps/app'; import { GetOrderListParams, OrderListPageData, GetOrderDetailParams, OrderDetailData, SetOrderFinishParams } from '@polyv/interactions-receive-sdk/apps/order/type'; import { OrderStatus, DeliveryType } from '@polyv/interactions-receive-sdk/apps/order/message'; export class Order extends App { constructor(); /** 订单状态 */ ORDER_STATUS: typeof OrderStatus; /** 履约方式 */ DELIVERY_TYPE: typeof DeliveryType; /** 获取订单列表 */ getOrderList(params?: GetOrderListParams): Promise; /** 获取订单详情 */ getOrderDetail(params: GetOrderDetailParams): Promise; /** 订单确认收货 */ setOrderFinish(params: SetOrderFinishParams): Promise; } } declare module '@polyv/interactions-receive-sdk/types' { /** * 常用类型声明 * @packageDocumentation */ import type { Chat } from '@polyv/chat-sdk'; import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { AuthorizeSignParams, RequestAuthorizeMethod } from '@polyv/interactions-receive-sdk/utils/ajax-utils'; import { EncryptResponseType, SignatureMethod, SM2Key } from '@polyv/interactions-receive-sdk/types/encryption'; /** * 通用对象定义 */ export type UniversalParams = { [key: string]: unknown; }; export type EnabledType = 'Y' | 'N'; /** * 互动接收端 SDK 所需用户信息接口 */ export interface UserInfo { /** 用户昵称 */ nick: string; /** 用户 ID */ userId: string; /** 用户头像 */ pic: string; /** 用户登录方式 */ authType?: string; /** 微信 unionId */ unionId?: string; /** 微信openId */ openId?: string; } /** * 互动接收端 SDK 所需用户信息接口 */ export interface ChannelInfo { /** 频道号 */ channelId: string; /** 房间号 */ roomId: string; /** 场次号 */ sessionId: string; /** 直播状态 */ liveStatus?: string; /** accountId 账户id */ accountId?: string; /** 播放器延迟时间-主动延迟使互动功能和画面同步 毫秒 */ delayTime?: number; } export interface ChannelConfig { newSessionEnabled?: boolean; } /** 外部获取 channel token 时的回调数据 */ interface GetViewerApiTokenCbData { /** 账号 appId */ appId?: string; /** 频道 api token */ viewerApiToken: string; } interface GetViewerApiTokenCb { (data: GetViewerApiTokenCbData): unknown; } /** 外部获取频道 token 异步函数 */ export interface GetViewerApiToken { (cb: GetViewerApiTokenCb): unknown; } interface GetXAuthTokenCb { (data: string): void; } /** 获取 x-auth-token 异步函数 */ export interface GetXAuthToken { (cb: GetXAuthTokenCb): unknown; } interface GetParamsSignCb { (data: AuthorizeSignParams): unknown; } export interface GetParamsSignOptions { /** 签名参数 */ params: UniversalParams; /** 签名方式 */ signatureMethod: SignatureMethod; } /** 外部获取 sign 异步函数 */ export interface GetParamsSign { (options: GetParamsSignOptions, cb: GetParamsSignCb): unknown; } export interface Store extends Config { baseConfig: BaseConfig; preDomainInfo: PreDomainInfo; } /** * 互动接收端配置信息接口 */ export interface Config { /** 频道 token,用于部分接口鉴权 */ viewerApiToken?: string; /** 频道 token 异步更新函数,需回调 viewerApiToken 数据 */ getViewerApiToken?: GetViewerApiToken; xAuthToken?: string; getXAuthToken?: GetXAuthToken; appId?: string; appSecret?: string; getParamsSign?: GetParamsSign; /** 聊天室实例 */ chat?: Chat; /** socket 实例(与 chat 必须传一个) */ socket?: SocketIOClient.Socket; /** 聊天室 token */ chatToken?: string; /** 用户(观众)信息 */ userInfo: UserInfo; /** 频道信息 */ channelInfo: ChannelInfo; /** 域名信息(可选) */ domainInfo?: DomainInfo; /** sdk基础配置 */ baseConfig?: BaseConfig; preDomainInfo?: PreDomainInfo; getChannelInfo?: () => ChannelInfo; getChannelConfig?: () => ChannelConfig; /** 请求授权方式,默认:token */ requestAuthorizeMethod?: RequestAuthorizeMethod; /** 是否防重放,默认:false */ signatureNonce?: boolean; /** 签名方式,默认:MD5 */ signatureMethod?: SignatureMethod; /** 返回数据加密类型 */ encryptResponseType?: EncryptResponseType; /** 密钥对相关 */ sm2Key?: SM2Key; /** 频道对应超管配置 */ channelConfigEnable?: ChannelConfigEnable; } export interface ChannelProductPushingStatusVO { productId: number; pushRule: string; } export interface ChannelConfigEnable { productLinkJumpTipEnabled?: EnabledType; watchEventTrackEnabled?: EnabledType; productTrackEnabled?: EnabledType; channelProductPushingStatusVO?: ChannelProductPushingStatusVO; productExplainEnabled?: EnabledType; } /** 预发布环境 */ export interface PreDomainInfo { apiHost: '//api-pre.polyv.net'; chatApiHost: '//pre-apichat.polyv.net'; watchOrigin: 'https://live-pre.polyv.cn'; } export interface BaseConfig { /** 'prod' 表示生产环境,'pre' 表示预发布,其他表示测试环境。 */ apiEnv: string; /** 是否使用自定义域名, true: 优先使用domainInfo域名, false: 优先判断apiEnv环境域名 */ isUseDomainInfo: boolean; } export interface DomainInfo { /** 聊天室 api 接口域名 */ chatApiHost?: string; /** 直播 api 接口域名 */ apiHost?: string; /** 观看页域名,需要包含协议 */ watchOrigin?: string; /** 直播公用 api 域名 */ normalHost?: string; /** 直播后台 api 接口域名 */ liveHost: string; /** * 静态域名 * @internal * @ignore * @default https://liveimages.videocc.net */ staticDomain?: string; /** * 资源域名 * @internal * @ignore * @default https://s1.videocc.net */ resourceDomain?: string; } /** 事件处理方法 */ export interface MsgHandler { (msg: Message): unknown; } /** 事件处理方法集合 */ export interface MsgHandlers { [key: string]: MsgHandler; } /** 特殊事件处理方法 */ export interface CustomEventHandler { (data: unknown): unknown; } /** 特殊事件处理方法集合 */ export interface CustomEventHandlers { [key: string]: CustomEventHandler; } /** * 接口的 response */ export interface ApiResponseData { /** 状态码 */ code: number; /** 状态 */ success?: 'success' | 'error'; /** 状态 */ status?: 'success' | 'error'; /** 返回信息 */ message: string; /** 返回数据 */ data: D; /** 错误信息 */ error?: ApiError; /** data 字段是否被加密 */ encryption?: boolean; } export interface ApiError { code?: number; desc?: string; } /** * sdk参数设置 */ export interface AppConfig { useApiHost: boolean; } export interface PendantListResData extends ApiResponseData { data: { /** 挂件列表 */ list: PendantItem[]; } | null; } interface PendantItem { /** 挂件类型 */ type: string; /** 挂件ID */ pandantId: string; } /** SocketIOEvents Socket 实例原生事件 */ export enum SocketIOEvents { /** 连接socket */ CONNECT = "connect", /** 取消连接 */ DISCONNECT = "disconnect", /** 重新连接后 */ RECONNECT = "reconnect", /** 重新连接开始 */ RECONNECT_ATTEMPT = "reconnect_attempt", /** 错误 */ ERROR = "error", /** 连接错误 */ CONNECT_ERROR = "connect_error", /** 连接超时 */ CONNECT_TIMEOUT = "connect_timeout", /** 重连中 */ RECONNECTING = "reconnecting" } export {}; } declare module '@polyv/interactions-receive-sdk/types/encryption' { /** * 签名方式 */ export type SignatureMethod = 'md5' | 'MD5' | 'sha256' | 'SHA256'; /** * 接口返回数据加密类型 * 0 不加密 * 1 AES加密 * 2 SM2加密 */ export type EncryptResponseType = 0 | 1 | 2; /** * 解密编码方式 */ export enum DecryptType { Hex = "hex", Base64 = "base64" } /** 对称加密密钥对 */ export interface SM2Key { /** 接口post请求加密 */ platformPublicKey: string; /** 接口返回内容解密 */ userPrivateKey: string; } /** 解密密钥参数 */ export interface DecryptSecretKeyOptions { sign: string; iv: string; /** 加密类型,默认:hex */ decryptType?: DecryptType; } /** 接口请求解密配置参数 */ export interface DecryptOptions extends DecryptSecretKeyOptions { /** 需解密的字段,不设置时默认为整体需要解密 */ field?: string; } } declare module '@polyv/interactions-receive-sdk/types/rtas' { import { ITrackEventData, ProjectName } from '@polyv/rtas-sdk'; export type trackLogParams = ITrackEventData; export interface IARRatsConfig { project_name: ProjectName; app_name: string; } } declare module '@polyv/interactions-receive-sdk/apps/app' { /** * 互动功能基础类 * @packageDocumentation */ import * as EventEmitter from "events"; import { ChannelInfo, Config, UserInfo, MsgHandlers, CustomEventHandlers, AppConfig, PendantListResData, SocketIOEvents, DomainInfo } from "@polyv/interactions-receive-sdk/types"; import { EType, ETypeParam, Listener } from "@polyv/interactions-receive-sdk/constants/events"; import APIQuery from "@polyv/interactions-receive-sdk/utils/ajax"; import { trackLogParams } from "@polyv/interactions-receive-sdk/types/rtas"; interface asyncGetterGeneratorParams { /** * @tokenUrl * v4接口在url传入channelId viewerId viewerToken参数验证 */ asyncGetter: (tokenUrl: string) => Promise; } abstract class App { /** * @internal * 模块事件总线 */ protected _eventEmitter: EventEmitter; /** * @internal * 聊天室 api ajax 工具 */ protected _chatApi: APIQuery; /** * @internal * 直播 api ajax 工具 */ protected _api: APIQuery; /** 其他 api ajax 工具 */ protected _otherApi: APIQuery; /** 直播后台 api ajax 工具 */ protected _liveApi: APIQuery; /** 绑定了 this 上下文的 msg 处理器 */ protected _bindedMsgHandlers: MsgHandlers; /** 绑定了 this 上下文的 message 以外事件处理器 */ protected _bindedCustomEventHandlers: CustomEventHandlers; /** 观看页接口工具 */ protected _watchApi: APIQuery; /** socket.io 原生事件名称 */ socketIOEvents: typeof SocketIOEvents; /** socket.io 事件处理 */ protected _bindedSocketIOEventsHandlers: CustomEventHandlers; getFakeSocket(): EventEmitter; constructor(config?: AppConfig); /** 销毁实例 */ destroy(): void; protected get SDKEventEmitter(): EventEmitter; /** * @internal * SDK 配置信息 */ protected get store(): Config; /** * @internal * 域名配置 */ protected get domainInfo(): Required; /** * @internal * SDK 配置用户信息 */ protected get userInfo(): UserInfo; /** * @internal * SDK 配置频道信息 */ protected get channelInfo(): ChannelInfo; /** * @internal * 模块对应所需的事件及处理方法 */ protected get msgHandlers(): MsgHandlers; /** * @internal * 模块对应特殊事件处理方法 */ protected get customEventHandlers(): CustomEventHandlers; /** * @internal * msg 处理器 */ protected wrapMsgHandlers(): MsgHandlers; protected wrapCustomHandlers(): CustomEventHandlers; protected wrapSocketIOEventHandlers(): CustomEventHandlers; /** * @internal * 绑定 SDK 内部事件 */ bindSdkEvents(): void; /** * 绑定 socket.io 原生事件, */ bindSocketIOEvents(): void; /** * @internal * 解绑 socket.io 原生事件, */ unbindSocketIOEvents(): void; /** * @internal * 解绑 SDK 内部事件 */ unbindSdkEvents(): void; /** * @internal * 监听 websocket 事件, socket 实例初始化/更新后调用。 */ bindMsgHandler(): this; /** * @internal * 取消监听 websocket/聊天室事件 */ unbindMsgHandler(): this; /** * @internal * 绑定 message 以外特殊 websocket 消息 */ bindCustomEvent(): this; /** * 解除监听 message 以外的聊天室消息 */ unbindCustomEvent(): this; /** * 取消所有事件监听 */ unbindEventHandlers(): this; /** * 订阅事件 * @param event 事件名称 * @param listener 事件处理器 * @returns this */ on(event: EType, listener: Listener): this; /** * 取消订阅事件 * @param event 事件名称 * @param listener 事件处理器 * @returns this */ off(event: EType, listener: Listener): this; /** * @internal * 发布事件 * @param event 事件名称 * @param args 事件数据 * @returns this */ trigger(event: E, args: ETypeParam[E]): this; /** * @internal * 发送聊天室消息 * @param data 消息体 * @param callback 回调函数 * @param event 消息名,默认 message * @returns this */ protected emitMsg(data: unknown, callback: (res: unknown) => unknown, event?: string): this; /** * @internal * 触发 websocket 消息 * @param event 消息类型 * @param args 参数列表 * @returns this */ protected emitWs(event: string, ...args: unknown[]): this; /** * @internal * 包装 channel token 相关请求,若判断到 token 失效等情况,更新一次后再重试请求 * @param data 请求参数 * @returns 响应参数 */ protected asyncGetterGenerator(data: asyncGetterGeneratorParams): Promise; protected asyncGetXAuthToken(data: asyncGetterGeneratorParams): Promise; /** * 获取挂件列表 * @returns Promise */ getAppPendantList(): Promise; trackLog(data: trackLogParams): Promise; } export default App; } declare module '@polyv/interactions-receive-sdk/apps/feedback/events' { /** * 反馈模块相关事件 */ export enum feedBackEvents { /** * 提交反馈。 * 事件参数 * @event */ SUBMIT = "SUBMIT" } /** * 反馈模块事件数据限定 */ export type feedBackETypeParams = { [feedBackEvents.SUBMIT]: null; }; } declare module '@polyv/interactions-receive-sdk/apps/feedback/message' { /** * 反馈模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 提交反馈的数据 */ export interface SubmitInfo extends Message { /** 反馈类型 */ type: string; /** 所属分类 */ label: string; /** 反馈内容 */ content?: string; /** 验证码ID */ captchaId: string; /** 验证码值 */ captchaValue: string; /** 联系方式 */ contact?: string; /** 图片 */ imageFiles?: string[]; } } declare module '@polyv/interactions-receive-sdk/apps/check-in/events' { /** * 签到模块相关事件 * @packageDocumentation */ import { CheckInMsg } from '@polyv/interactions-receive-sdk/apps/check-in/message'; import { CountdownCbData } from '@polyv/interactions-receive-sdk/types/countdown'; /** * 签到模块相关事件 */ export enum CheckInEvents { ON_SLICE_ID = "onSliceID", /** * 开始签到。 * 事件参数:{@link CheckInMsg} * @event */ SIGN_IN = "SIGN_IN", /** * 讲师结束签到。 * 事件参数:null * @event */ STOP_SIGN_IN = "STOP_SIGN_IN", /** * 签到限时结束。 * 事件参数:null * @event */ SIGN_IN_FINISH = "SIGN_IN_FINISH", /** * 计时更新事件。 * 事件参数:{@link CountdownCbData} * @event */ SIGN_IN_TIME_UPDATED = "SIGN_IN_LEFT_TIME", /** * 签到成功事件。 * 事件参数:null * @event */ SIGN_IN_SUCCESS = "SIGN_IN_SUCCESS", /** * 签到失败事件。 * 事件参数:null * @event */ SIGN_IN_FAIL = "SIGN_IN_FAIL" } /** * 签到模块事件数据限定 */ export type CheckInETypeParams = { [CheckInEvents.ON_SLICE_ID]: never; [CheckInEvents.SIGN_IN]: CheckInMsg; [CheckInEvents.STOP_SIGN_IN]: null; [CheckInEvents.SIGN_IN_FINISH]: null; [CheckInEvents.SIGN_IN_TIME_UPDATED]: CountdownCbData; [CheckInEvents.SIGN_IN_SUCCESS]: null; }; } declare module '@polyv/interactions-receive-sdk/apps/check-in/message' { /** * 签到模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 签到开始消息数据内容 */ interface CheckInData { /** 签到 ID */ checkinId: string; /** 签到开始时间 */ createTime: number; /** 签到限制时间(单位秒) */ limitTime: number; /** 签到提示语 */ message: string; /** 签到对应场次 ID */ sessionId: string; /** 是否强制签到 */ forceCheckInEnabled: 'Y' | 'N'; } /** 签到开始消息 */ export interface CheckInMsg extends Message { /** 房间号 */ roomId: string; /** 签到详细信息 */ data: CheckInData; } export {}; } declare module '@polyv/interactions-receive-sdk/types/countdown' { /** * @internal * polyv 倒计时工具声明 * @packageDocumentation */ export interface CountdownCbData { /** 剩余时间(毫秒) */ totalMsecs: number; } export interface CountdownCb { /** 倒计时更新回调 */ (data: CountdownCbData): unknown; } } declare module '@polyv/interactions-receive-sdk/apps/answer-card/events' { /** * 答题卡模块相关事件 * @packageDocumentation */ import { SDKQuestionContentMsg, StopQuestionMsg, SDKQuestionResultMsg } from '@polyv/interactions-receive-sdk/apps/answer-card/message'; /** * 答题卡模块相关事件 */ export enum AnswerCardEvents { /** * 收到题目。 * 事件参数:{@link SDKQuestionContentMsg} * @event */ GET_TEST_QUESTION_CONTENT = "GET_TEST_QUESTION_CONTENT", /** * 结束答题。 * 事件参数:{@link StopQuestionMsg} * @event */ STOP_TEST_QUESTION = "STOP_TEST_QUESTION", /** * 收到答题结果。 * 事件参数:{@link SDKQuestionResultMsg} * @event */ GET_TEST_QUESTION_RESULT = "GET_TEST_QUESTION_RESULT" } /** * 答题卡模块事件数据限定 */ export type AnswerCardETypeParams = { [AnswerCardEvents.GET_TEST_QUESTION_CONTENT]: SDKQuestionContentMsg; [AnswerCardEvents.STOP_TEST_QUESTION]: StopQuestionMsg; [AnswerCardEvents.GET_TEST_QUESTION_RESULT]: SDKQuestionResultMsg; }; /** 问题答案数据类型 */ export interface AnswerContent { code: number; data: { /** 问题答案 */ answer: { option: string; }; }; } } declare module '@polyv/interactions-receive-sdk/apps/answer-card/message' { /** * 答题卡模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 答题卡题目大类 */ export enum QuestionItemTypes { /** 普通 */ Normal = 0, /** 快速问答 */ QuickAnswerCard = 1 } /** 答题卡普通题目类型 */ export enum QuestionTypes { /** 多选 */ CheckBox = "C", /** 单选 */ Radio = "R", /** 评分题 */ Score = "S", /** 投票题 */ Vote = "V" } /** 答题卡开始消息,基本内容字段 */ export interface QuestionContentMsg extends Message { /** 是否默认开启限时答题(复旦) */ defaultLimitTimeAnswer: boolean; /** 答题限时(单位秒) */ duration: number; /** 答题卡类型(快速问答、普通) */ itemType: QuestionItemTypes; /** 题目文字 */ name: string; /** 题目 ID */ questionId: string; /** 题目类型 */ type: QuestionTypes; } /** 聊天室消息题目选项及提示字段 */ interface QuestionContentOptionsTips { option1: string | null; option2: string | null; option3?: string | null; option4?: string | null; option5?: string | null; option6?: string | null; option7?: string | null; option8?: string | null; option9?: string | null; option10?: string | null; option11?: string | null; option12?: string | null; option13?: string | null; option14?: string | null; option15?: string | null; tips1: string | null; tips2: string | null; tips3?: string | null; tips4?: string | null; tips5?: string | null; } /** 开始答题消息(聊天室广播) */ export interface WsQuestionContentMsg extends QuestionContentMsg, QuestionContentOptionsTips { /** 问题答案 */ answer: string; } /** * @privateRemarks * * 隐藏了 answer 字段,并整理了选项及选项提示为数组 */ export interface SDKQuestionContentMsg extends QuestionContentMsg { /** 选项数组 */ options: string[]; /** 提示数组(评分题特有,分值提示) */ tips: string[]; } /** 结束答题消息(SDK 对外触发) */ export interface StopQuestionMsg extends Message { /** 答题卡类型 */ itemType: QuestionItemTypes; /** 答题卡 ID */ questionId: string; /** 题目类型 */ type: QuestionTypes; } /** 提交题目答案回调信息 */ export interface AnswerQuestionRes { code: AnswerQuestionResCode; } /** 提交答题响应状态码 */ export enum AnswerQuestionResCode { /** 答题成功 */ SubmitSuccess = 200, /** 头像非法,回答被忽略 */ Ignore = 301, /** 提交时答题已结束 */ End = 302, /** 已回答过 */ Success = 303 } /** 答题结果消息(聊天室广播) */ export interface WsQuestionResultMsg extends Message { /** 题目详细内容 */ content: WsQuestionContentMsg; /** 题目 ID */ questionId: string; /** 题目结果详情 */ result: WsQuestionResult; /** 答对用户列表 */ rightRank: RightUser[]; } /** 答对用户 */ export interface RightUser { /** 用户昵称 */ nick: string; /** 用户头像 */ pic: string; /** 用户id */ userid: string; /** 答题时间戳 */ timestamp: number; } /** 题目结果详情 */ export interface WsQuestionResult { /** 答案 */ answer: string; /** 答题卡类型 */ itemType: QuestionItemTypes; /** 总回答人数 */ total: number; /** 题目类型 */ type: QuestionTypes; /** 题目各选项人数 */ singleResult: number[]; } /** 题目结果详情(封装) */ export interface SDKQuestionResult extends WsQuestionResult { /** 个人正误情况 */ selfCorrection?: SDKQuestionResultCorrection; /** 平均分(封装), 评分题特有 */ avgScore?: number; /** 个人提交答案(封装) */ selfAnswer?: string; } /** 个人答题正误情况(单选、多选) */ export enum SDKQuestionResultCorrection { SELF_RIGHT = "selfRight", SELF_WRONG = "selfWrong", NOT_SUBMIT = "notSubmit" } /** 答题结果消息(SDK 对外触发) */ export interface SDKQuestionResultMsg { /** 题目详细内容 */ content: SDKQuestionContentMsg; /** 题目 ID */ questionId: string; /** 题目结果详情 */ result: SDKQuestionResult; /** 答对用户列表 */ rightRank: RightUser[]; } /** 服务器返回答题剩余时间信息 */ export interface WsQuestionDurationRes { data: { /** 剩余时间(单位秒) */ time: number; }; } /** 答题剩余时间数据 */ export interface SDKQuestionDurationRes { /** 剩余时间(单位秒) */ time: number; } export interface AnswerData { userId: string; questionId: string; roomId: string; sign: string; timestamp: number; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/push-card/events' { /** * 卡片推送模块相关事件 * @packageDocumentation */ import { PushCardMsg, ResidueTimeMsg } from '@polyv/interactions-receive-sdk/apps/push-card/message'; export enum PushCardEvents { /** * 开始消息推送 */ START = "start", /** * 取消消息推送 */ CANCEL = "cancel", /** * 获取剩余时间 */ GET_RESIDUE_TIME = "getResidueTime" } /** * 卡片推送模块事件数据限定 */ export type PushCardETypeParams = { [PushCardEvents.START]: PushCardMsg; [PushCardEvents.CANCEL]: PushCardMsg | undefined; [PushCardEvents.GET_RESIDUE_TIME]: ResidueTimeMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/push-card/message' { /** * 卡片推送模块相关消息体接口 * @packageDocumentation */ import { ApiResponseData } from '@polyv/interactions-receive-sdk/types'; import { Message } from '@polyv/interactions-receive-sdk/types/message'; export enum imageType { REDPACK = "redpack", GIFTBOX = "giftbox", CUSTOM = "custom" } export interface Time { /** 剩余时间 */ time: number; } /** 卡片推送开始消息数据内容 */ export interface PushCardMsg extends Message { /** 房间号 */ roomId: string; /** 卡片ID */ id: string; /** 剩余显示时长(单位秒) */ time: number; /** 卡片显示总时长 */ total: number; /** 是否有卡片入口,Y表示有入口,N表示没有 */ entrance: string; /** 等待多久后显示(秒) */ lookTime: number; /** * 是否只显示入口 * @desc 当前只是前端自定义的字段,只用在卡片推送重放中 */ onlyShowEntrance?: boolean; } /** 获取剩余时间返回数据内容 */ export interface ResidueTimeMsg extends ApiResponseData { /** 时间 */ data: Time; } /** 卡片数据 */ export interface CardPushJson { /** 等待多久后显示(秒) */ conditionValue: number; /** 卡片推送总时长(秒) */ duration: number; /** 倒计时文案 */ countdownMsg: string; /** 是否有卡片入口,Y表示有入口,N表示没有 */ enterEnabled: string; /** 封面类型 */ imageType: imageType; /** 当封面类型为custom(自定义)时,封面图片链接 */ cardImage?: string; /** 当封面类型为custom(自定义)时,入口图片链接 */ enterImage?: string; /** 跳转链接 */ link: string; /** 打开链接的方式,不存在时表示新开页面,默认为tab(新开页面) */ redirectType?: 'tab' | 'iframe' | 'current'; /** 弹出方式:PUSH(马上)/WATCH(观看conditionValue后弹出) */ showCondition: string; /** 卡片标题 */ title: string; /** 是否有配置链接,Y表示有,N表示没有 */ linkEnabled: string; /** * 是否只显示入口 * @desc 当前只是前端自定义的字段,只用在卡片推送重放中 */ onlyShowEntrance?: boolean; } /** 获取卡片内容返回的数据内容 */ export interface SdkGetPushCardDataRes extends ApiResponseData { data: CardPushJson; } } declare module '@polyv/interactions-receive-sdk/apps/popup-ad/types' { import { CardPushJson, imageType } from '@polyv/interactions-receive-sdk/apps/push-card/message'; export interface LabelItem { id: number; label: string; } /** 弹窗广告 */ export interface PopImageAdItem { advertise: { id: string; userId: string; name: string; startTime: number; endTime: number; imageUrl: string; deliveryPage: string; jumpType: string; liveDetail: { channelId: number; sessionId: string; }; jumpLinkDetail: { jumpWay: 'POP_UP' | 'CURRENT_WINDOW' | 'NEW_WINDOW'; pcLink: string; mobileLink: string; wxMiniprogramOriginalId: string; wxMiniprogramAppId: string; wxMiniprogramLink: string; linkType: string; link: string; linkEnabled: string; androidLink: string; iosLink: string; mobileAppLink: string; otherLink: string; mobileAppLinkJumpWay?: 'POP_UP' | 'CURRENT_WINDOW' | 'NEW_WINDOW'; pcLinkJumpWay?: 'POP_UP' | 'CURRENT_WINDOW' | 'NEW_WINDOW'; }; popupRule: string; targetAudience: 'all' | 'specific'; userTags: LabelItem[]; status: string; createTime: string; updateTime: string; }; } export interface PopImageAd extends CardPushJson { /** 等待多久后显示(秒) */ conditionValue: number; /** 卡片推送总时长(秒) */ duration: number; /** 倒计时文案 */ countdownMsg: string; /** 是否有卡片入口,Y表示有入口,N表示没有 */ enterEnabled: string; /** 封面类型 */ imageType: imageType; /** 当封面类型为custom(自定义)时,封面图片链接 */ cardImage?: string; /** 当封面类型为custom(自定义)时,入口图片链接 */ enterImage?: string; /** 跳转链接 */ link: string; /** 打开链接的方式,不存在时表示新开页面,默认为tab(新开页面) */ redirectType?: 'tab' | 'iframe' | 'current'; /** 弹出方式:PUSH(马上)/WATCH(观看conditionValue后弹出) */ showCondition: string; /** 卡片标题 */ title: string; pcLink: string; pcLinkJumpWay: 'tab' | 'iframe' | 'current'; mobileLink: string; wxMiniprogramOriginalId: string; wxMiniprogramAppId: string; wxMiniprogramLink: string; linkType: string; adType: string; hrefType: string; androidLink: string; iosLink: string; mobileAppLink: string; mobileAppLinkJumpWay: 'tab' | 'iframe' | 'current'; otherLink: string; type: string; scene: string; liveDetail: { channelId: number; } | null; popupRule: string; id: string; userTags: LabelItem[]; targetAudience: 'all' | 'specific'; } } declare module '@polyv/interactions-receive-sdk/apps/popup-ad/enums' { export enum PopupJumpType { /** 跳转直播间 */ Live = "live", /** 跳转链接 */ Link = "link" } } declare module '@polyv/interactions-receive-sdk/apps/lottery/events' { /** * 抽奖模块相关事件 * @packageDocumentation */ import { LotteryStartMsg, SdkLotteryEndMsg, InLotteryMsg, DelayLotteryStartMsg, OnLotteryMsg, AnXinLottery, DelayLotteryOverMsg, DelayLotteryEndMsg } from '@polyv/interactions-receive-sdk/apps/lottery/message'; /** * 抽奖模块相关事件 */ export enum LotteryEvents { /** * 开始抽奖。 * 事件参数: {@link LotteryStartMsg} * @event */ LotteryStart = "LotteryStart", /** * 抽奖正在进行(抽奖中途进入房间)。 * 事件参数: {@link InLotteryMsg} * @event */ InLottery = "IN_LOTTERY", /** * 停止抽奖。 * 事件参数: {@link SdkLotteryEndMsg} * @event */ LotteryEnd = "LotteryEnd", /** * 延时抽奖开始。 * 事件参数: {@link DelayLotteryStartMsg} * @event */ DelayLotteryStart = "delayLotteryStart", /** * 延时抽奖结束。 * 事件参数: null * @event */ DelayLotteryOver = "delayLotteryOver", /** * 延时抽奖关闭。 * 事件参数: null * @event */ DelayLotteryEnd = "delayLotteryEnd", /** * 提交中奖人联系信息成功。 * 事件参数: null * @event */ SubmitInfoSuccess = "SubmitInfoSuccess", /** * 旧版抽奖进行中(旧版抽奖中途进入房间)。 * 事件参数: {@link OnLotteryMsg} * @event */ OnLottery = "ON_LOTTERY", /** * updateLotteryList * @event */ UpdateLotteryList = "UPDATE_LOTTERY_LIST" } /** * 抽奖模块事件数据限定 */ export type LotteryETypeParams = { [LotteryEvents.LotteryStart]: LotteryStartMsg; [LotteryEvents.LotteryEnd]: SdkLotteryEndMsg; [LotteryEvents.InLottery]: InLotteryMsg; [LotteryEvents.DelayLotteryStart]: DelayLotteryStartMsg; [LotteryEvents.DelayLotteryOver]: DelayLotteryOverMsg; [LotteryEvents.DelayLotteryEnd]: DelayLotteryEndMsg; [LotteryEvents.OnLottery]: OnLotteryMsg; [LotteryEvents.SubmitInfoSuccess]: null; [LotteryEvents.UpdateLotteryList]: { lotteryList: Array; awaitLotteryList: Array; }; }; } declare module '@polyv/interactions-receive-sdk/apps/lottery/message' { /** * 抽奖模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 房间初始化状态消息 */ export interface OnSliceIDMsg extends Message { /** 是否有未关闭的抽奖 */ inLottery: InLotteryData; } /** 抽奖状态枚举 */ export enum LotteryStatus { /** 正在抽奖 */ running = "running", /** 计时中 */ timing = "timing", /** 抽奖结束(未关闭) */ over = "over", /** 抽奖结束(已结束) */ end = "end" } /** 初始化消息抽奖状态数据 */ interface InLotteryData { /** 当前抽奖状态 */ status: LotteryStatus; /** 抽奖ID */ lotteryId?: string; /** 奖品名称 */ prize: string; /** 是否点击过领奖(调用过查看中奖接口) */ acquired: boolean; } /** 抽奖开始消息 */ export interface LotteryStartMsg extends Message { /** 频道号 */ channelId: string; /** 抽奖ID */ lotteryId: string; /** 场次ID */ sessionId: string; /** 问卷ID,若有该值代表有条件抽奖问卷开奖 */ questionnaireId?: string; } /** (新版)正在抽奖消息(封装) */ export interface InLotteryMsg { /** 抽奖ID */ lotteryId?: string; /** 奖品名称 */ prize: string; /** 是否点击过领奖(调用过查看中奖接口) */ acquired: boolean; /** 抽奖进行状态 */ status: string; } /** (旧版)正在抽奖消息 */ export interface OnLotteryMsg extends Message { data: null; } /** 中奖人信息字段 */ export interface CollectInfo { /** 字段名 */ field: string; /** 值 */ value?: string; } /** 聊天室抽奖结束消息 */ export interface LotteryEndMsg extends Message { /** 频道号 */ channelId: string; /** 抽奖ID */ lotteryId: string; /** 场次ID */ sessionId: string; /** 奖品名称 */ prize: string; /** 是否高并发抽奖 */ forHighConcurrency?: boolean; /** 中奖用户情况(自己是否中奖) */ data: Winner[]; /** 信息收集,截止时间 */ overTime: number; /** 是否信息收集 */ hasCollect: string; /** 是否隐藏中奖名单 */ hideResult: string; /** 是否隐藏中奖码 */ showWinnerCode: string; /** 是否隐藏中奖名单入口 */ showWinners: string; /** 问卷ID, 若有该字段代表是条件抽奖-问卷结束开奖 */ questionnaireId?: string; } export interface WsLotteryEndMsg extends LotteryEndMsg { /** 信息采集(JSON字符串) */ collectInfo: string; } /** SDK 抽奖结束消息 */ export interface SdkLotteryEndMsg extends LotteryEndMsg { /** 信息采集(JSON字符串) */ collectInfo: CollectInfo[]; /** 用户是否为中奖者 */ isWinner: boolean; /** 兑换码(自己为中奖者时存在) */ winnerCode?: string; } /** 中奖用户 */ interface Winner { /** 频道号 */ channelId: string; /** 抽奖ID */ lotteryId: string; /** 昵称 */ nick: string; /** 头像 */ pic: string; /** 房间号 */ roomId: string; /** 用户 socketID */ uid: string; /** 用户ID */ userId: string; /** 用户类型 */ userType: string; /** 用户中奖兑换码 */ winnerCode: string; } /** 延时抽奖开始 */ export interface DelayLotteryStartMsg extends Message { /** 奖品名称 */ prize: string; } /** 延时抽奖Over */ export interface DelayLotteryOverMsg extends Message { /** 抽奖id */ lotteryId: string; } /** 延时抽奖End */ export interface DelayLotteryEndMsg extends Message { /** 抽奖id */ lotteryId: string; } /** 抽奖列表 */ export interface LotteryListRes { /** 响应码 */ code: number; data: { lotterys: Array; }; } /** 安信抽奖列表 */ export interface AnXinLotteryListRes { /** 响应码 */ code: number; data: { /** 服务器时间 */ currentTimestamp: number; lotterys: Array; }; } export interface Lottery { /** 抽奖ID */ lotteryId: string; /** 是否为手动结束抽奖 */ lotteryManualEndEnabled: 'Y' | 'N'; /** 原价 */ price?: string; /** 奖品名称 */ prizeName: string; /** prizeUrl */ prizeUrl: string; /** 原价 */ realPrice: string; /** 开始事件 */ startTime: number; /** 抽奖状态, wait未开奖,lottery抽奖中 end已开奖 */ status: string; /** 奖品缩略图 */ thumbnail: null; } export interface AnXinLottery { /** 抽奖ID */ lotteryId: string; /** 父抽奖ID */ masterLotteryId?: string; /** 原价 */ price?: string; /** 奖品名称 */ prizeName: string; /** prizeUrl */ prizeUrl?: string; /** 奖品缩略图 */ thumbnail?: string; /** 是否领取 */ received: boolean; /** 抽奖开始时间 */ startTime: number; /** 抽奖状态, wait未开奖,end已开奖 */ status: string; /** winner */ winner: string; /** 抽奖倒计时 */ lotteryCountdown?: number; receiveInfo: Array; receiveInfoDeadline: number; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/welfare-lottery/message' { /** * 条件抽奖模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { ApiResponseData, UniversalParams, EnabledType } from '@polyv/interactions-receive-sdk/types'; /** 抽奖活动开始消息 */ export interface WelfareLotteryStartMsg extends Message { /** 抽奖ID */ lotteryId: string; /** 抽奖次数 */ times: number; /** 抽奖活动名称 */ name: string; } /** 奖品信息 */ export interface prizeInfo { /** 奖品ID */ lotteryId: string; /** 奖品名称 */ name: string; /** 奖品数量 */ lotteryCount: number; } /** 抽奖活动信息 */ export interface QuestionnaireLotteryMessage { /** 抽奖ID */ lotteryId: string; /** 奖品信息 */ lotterys: prizeInfo[]; /** 抽奖活动名称 */ name: string; } /** 问卷类型: survery 调查 、lottery 抽奖 */ type QuestionnaireType = 'survery' | 'lottery'; /** 问卷信息 */ export interface QuestionnaireContent { /** 问卷名称 */ name: string; /** 问卷ID */ questionnaireId: string; /** 问卷名称 */ questionnaireTitle: string; /** 问卷类型 */ questionnaireType: QuestionnaireType; } /** 问卷抽奖活动开始 - 聊天室消息 */ export interface WelfareLotteryQuestionnaireStartMsg { /** 问卷ID */ questionnaireId: string; /** 问卷信息 */ content?: QuestionnaireContent; /** 问卷抽奖信息 */ questionnaireLotteryMessage?: QuestionnaireLotteryMessage; } export interface WelfareLotteryQuestionnaireStartSocketMsg extends WelfareLotteryQuestionnaireStartMsg, Message { } export interface QuestionMsg extends Message { /** 题目内容 */ name: string; /** 题目id */ questionId: string; /** 题目选项 */ options: Array; /** 题目类型,R表示单选,C表示多选,J表示判断题 */ type: string; } /** 抽奖活动结束消息 */ export interface WelfareLotterytEndMsg extends Message { /** 抽奖ID */ lotteryId: string; /** 抽奖次数 */ times: number; /** 抽奖活动名称 */ name: string; } interface Condition { /** 频道ID */ channelId: string; /** 条件类型,邀请:invite */ condition: string; /** 已邀请人数 */ inviteCount?: number; /** 邀请方式,poster:邀请海报,external:外部邀请 */ inviteType?: 'poster' | 'external'; /** 抽奖ID */ lotteryId: string; /** 参与人数 */ viewerSize: number; /** 已观看时长 */ duration: number; /** 评论抽奖是否达成 */ hasComment: 'Y' | 'N'; } export interface TaskConditionResData extends ApiResponseData { /** 任务详情 */ data: Condition; } export enum AcceptType { /** 表单 */ FORM = "from", /** 外链 */ LINK = "link", /** 识别二维码 */ QRCODE = "qrCode" } interface FormList { /** 字段名 */ field: string; /** 提示内容 */ tips: string; /** 默认值 */ value: string; } export interface Prize { /** 领奖方式 */ acceptType: AcceptType; /** 频道ID */ channelId: string; /** 领奖表单 */ formList: FormList[]; /** 是否已领奖,当acceptType为form时有效 */ hasObtain?: boolean; /** 抽奖ID */ lotteryId: string; /** 领奖url */ prizeUrl?: string; /** 中奖ID */ recordId: string; /** 领奖二维码 */ qrCode?: string; /** 领奖二维码提示语 */ qrCodeTips?: string; /** 中奖码 */ winnerCode: string; /** 是否展示兑换码 */ showWinnerCode: EnabledType; } export interface LotteryPrizeResData extends ApiResponseData { /** 奖品详情 */ data: Prize; } export interface LotteryGroupItem { id: string; title: string; count: number | null; } export interface LotteryResGroupData extends ApiResponseData { /** 分组列表 */ data: LotteryGroupItem[]; } export interface LotteryWinListParams extends UniversalParams { /** 关键字 */ keyword?: string; /** 每页条数 */ pageSize?: number; /** 页码 */ pageNumber?: number; } interface PrizeDetail { /** 频道ID */ channelId: string; /** 抽奖ID */ lotteryId: string; /** 奖品图片 */ prizeImage: string; /** 奖品名称 */ prizeName: string; recordId: string; /** 中奖时间 */ winTime: string; /** 兑换码 */ winnerCode: string; /** 是否展示兑换码 */ showWinnerCode: EnabledType; } /** 扩展字段,不方便放在列表中的可以放在此结构中 */ interface EXT { [key: string]: never; } interface WinList { /** 奖品列表 */ contents: PrizeDetail[]; ext?: EXT; /** 当前页码 */ pageNumber: number; /** 每页条数 */ pageSize: number; /** 总条数 */ totalItems: number; /** 总页数 */ totalPages: number; } export interface LotteryWinListResData extends ApiResponseData { data: WinList; } export enum CommentStatus { NO_LOTTERY = "noLottery", HIT_COMMENT_FAIL = "commentFail" } export enum LotteryCondition { /** 无条件 */ NONE = "none", /** 邀请 */ INVITE = "invite", /** 观看时长 */ DURATION = "duration", /** 评论 */ COMMENT = "comment", /** 答题 */ QUESTION = "question", /** 问卷 */ QUESTIONNAIRE = "questionnaire" } export enum LotteryStatus { WAIT = "wait", /** 开始抽奖 */ START = "start", LOTTERY = "lottery", /** 结束抽奖 */ END = "end", FINISH = "finish", CANCEL = "cancel" } interface LotteryDetail { /** 奖品名称 */ prizeName: string; /** 优惠价 */ realPrice: number; /** 原价 */ price: number; /** 缩略图 */ thumbnail: string; /** 中奖人数 */ amount: number; /** 参与条件 */ lotteryCondition: LotteryCondition; /** 开奖时间 */ endTime: string; /** 抽奖状态 */ status: LotteryStatus; /** 中奖用户id列表 */ winnerIds: []; /** 邀请人数 */ inviteNum: number; /** 邀请类型,poster:邀请海报,external:外部邀请 */ inviteType: 'poster' | 'external'; /** 评论抽奖关键字 */ comment: string; /** 答题抽奖-子抽奖列表 */ lotterys: LotteryQuestionChildren; /** 答题抽奖-最小答题数 */ lotteryLimit: number; /** 答题抽奖-总答题数 */ questionCount: number; /** 隐藏奖品数量 */ hiddenWinnerAmount?: 'Y' | 'N'; /** 隐藏参与人数 */ hiddenAttendeeNumber?: 'Y' | 'N'; /** 问卷抽奖 - 问卷ID */ questionnaireId?: string; } export interface LotteryDetailResData extends ApiResponseData { data: LotteryDetail; } /** 获取中奖名单方法参数 */ export interface GetWinnersParams { /** 抽奖ID */ lotteryId: string; /** 页码 */ pageNumber: number; } /** 中奖人信息 */ export interface Winner { /** 中奖人名称 */ viewerName: string; } /** * @internal * 获取中奖名单响应 */ export interface WinnerRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; data: WinnerResData; } export interface WinnerResData { /** 中奖人列表 */ contents: Winner[]; /** 每页条数 */ pageSize: number; /** 总页数 */ totalPages: number; /** 页码 */ pageNumber: number; /** 是否为第一页 */ firstPage: boolean; /** 是否为最后一页 */ lastPage: boolean; /** 下一页页码 */ nextPageNumber: number; /** 上一页页码 */ prePageNumber: number; /** 总记录数 */ totalItems: number; } /** 中奖人信息字段 */ export interface CollectInfo { /** 字段名 */ field: string; /** 值 */ value?: string; } /** 提交中奖人信息接口参数 */ export interface SubmitInfo { /** 抽奖ID */ lotteryId: string; /** 兑换码 */ winnerCode: string; /** 场次ID(可选,不传则从配置中获取) */ sessionId?: string; /** 中奖人信息字段 */ receiveInfo: CollectInfo[]; } /** 提交中奖人信息接口响应 */ export interface SubmitInfoRes { code: number; data: string; message: string; status: string; } /** 保存观看时长接口参数 */ export interface WatchTimeParams { duration: number; lotteryId?: string; } /** 问卷抽奖信息 */ export interface LotteryQuestionStatus { /** 抽奖id */ lotteryId: string; /** 抽奖次数 */ times: number; /** 抽奖名称 */ name: string; /** 如果在答题中,则表示剩余时间 */ currentTime: number; /** 已经回答题目数 */ answeredCount: number; /** 如果在答题中表示正在回答的题目id */ answeringQuestionId: string; questionnaireContent: QuestionnaireContent; joinCount: string; } /** 问卷内容 */ export interface QuestionnaireContent { /** 问卷名称 */ name: string; /** 问卷id */ questionnaireId: string; questions: Questions; } export interface Questions { /** 题目内容 */ name: string; /** 题目id */ questionId: string; /** 题目选项 */ options: Array; /** 题目类型,R表示单选,C表示多选,J表示判断题 */ type: string; } export interface AnsweredResult { /** 答题结果 */ result: boolean; /** 正确答案 */ rightAnswer: string; /** 已回答的用户数量 */ answeredCount: number; /** 回答正确的用户数量 */ rightCount: number; /** 回答题目结果, Y表示正确, N表示错误 */ allQuestionResult: string[]; } export interface LotteryQuestionChildren { /** 抽奖id */ lotteryId: string; /** 该奖项需要答对的题目数量 */ questionCount: number; /** 抽奖名称 */ name: string; /** 问卷内容 */ questionnaireContent: QuestionnaireContent; } /** 答題抽奖活动开始消息 */ export interface WelfareLotteryQuestionStartMsg extends WelfareLotteryStartMsg { /** 抽奖ID */ lotteryId: string; /** 抽奖列表,json字符串 */ lotterys: LotteryQuestionChildren; } /** 抽奖 - 问卷 填写完成情况 */ export interface QuestionnaireCompletionStatus { /** 参与人数(已完成问卷填写人数) */ joinCount: number; /** 是否已经答过问卷 */ isAnswered: boolean; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/questionnaire/events' { /** * 问卷模块相关事件 * @packageDocumentation */ import { QuestionItem, AnswerItem, QuestionContent, RankItem, RankContent, QuestionEndMsg } from '@polyv/interactions-receive-sdk/apps/questionnaire/message'; /** * 问卷模块相关事件 */ export enum QuestionnaireEvents { START_QUESTIONNAIRE = "START_QUESTIONNAIRE", STOP_QUESTIONNAIRE = "STOP_QUESTIONNAIRE", SEND_QUESTIONNAIRE_RESULT = "SEND_QUESTIONNAIRE_RESULT", QUESTIONNAIRE_ACHIEVEMENT = "QUESTIONNAIRE_ACHIEVEMENT", GET_ANSWER = "GET_ANSWER", QUESTIONNAIRE_RANK = "QUESTIONNAIRE_RESULT_OSS" } /** * 问卷模块事件数据限定 * SDK可调用方法的参数限制 */ export type QuestionnaireETypeParams = { [QuestionnaireEvents.START_QUESTIONNAIRE]: QuestionContent; [QuestionnaireEvents.STOP_QUESTIONNAIRE]: QuestionEndMsg; [QuestionnaireEvents.SEND_QUESTIONNAIRE_RESULT]: QuestionContent; [QuestionnaireEvents.QUESTIONNAIRE_ACHIEVEMENT]: QuestionContent; [QuestionnaireEvents.QUESTIONNAIRE_RANK]: RankContent; }; } declare module '@polyv/interactions-receive-sdk/apps/questionnaire/message' { /** * 问卷模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { ApiResponseData, EnabledType } from '@polyv/interactions-receive-sdk/types'; import { QuestionnaireLotteryMessage } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/message'; /** 题目类型 */ export enum QuestionItemTypes { /** 多选题 */ CheckBox = "C", /** 单选题 */ Radio = "R", /** 问答题 */ Question = "Q", /** 评星题 */ Star = "X", /** 评分题 */ Scor = "S", /** 判断题 */ Judgement = "J" } /** 答题卡发送状态。 draft:未答 send:已发送 */ export type QuestionStatus = 'draft' | 'send'; /** 选项最多个数 */ export const MAX_OPTION_COUNT = 20; /** 问卷类型 'survey' 调研收集 | 'exam' 随堂考试 */ export type QuestionnaireType = 'survey' | 'exam'; /** Socket获取题目信息 */ export interface SocketStartMsg extends Message { ossUrl: string; content: { questionnaireId: string; questionnaireTitle: string; questionnaireType: QuestionnaireType; createTime: number; endTime: number; lastModified: number; questions: Array; privacy?: PrivacyModel; /** 问卷描述 */ desc?: string; /** 计时答题 */ keepTime?: number; }; leftTime: number; } export interface SocketEndMsg extends Message { questionnaireId: string; } /** Socket获取题目结果 */ export interface SocketResultMsg extends Message, QuestionnaireAttr { total: number; ossUrl: string; data: Array; } /** Socket统计数据 */ export interface SocketAchievementMsg extends Message, QuestionnaireAttr { rank: number; rightAnswer: Array<{ questionId: string; answer: string; }>; answer: Array<{ questionId: string; answer: string; }>; } /** Socket排行榜数据 */ export interface SocketRankResultMsg extends Message { ossUrl: string; } /** SDK 返回题目信息 */ export interface QuestionContent extends QuestionnaireAttr { questions?: Array; /** 是否自动结束的问卷 */ isAutoEnd?: boolean; total?: number; /** 存放在OSS的题目详情 */ ossUrl?: string; } /** 问卷结束socket消息 */ export interface QuestionEndMsg { /** 问卷ID */ questionnaireId: string; /** 问卷抽奖相关信息 */ questionnaireLotteryMessage?: QuestionnaireLotteryMessage; } /** SDK 返回排行榜信息 */ export interface RankContent { rankResult: Array; questionnaireId: string; } export interface RankItem { nickname: string; answerCount: number; correctCount: number; correctRatio: number; costTime: number; score: number; rank: number; createTime: string; } export interface UserRankResData extends ApiResponseData { data: RankItem; } interface QuestionnaireAttr { questionnaireId: string; questionnaireTitle?: string; questionnaireType?: QuestionnaireType; privacy?: PrivacyModel; desc?: string; keepTime?: number; } /** 回答选项基本属性 */ interface AnswerItemAttr { /** 题目正确答案,可以多个答案。均为大写字母。 */ rightAnswer?: string; /** 总人数 */ total?: number; /** 选择人数 */ num?: number; /** 选择占比率 */ ratio?: number; } /** 题目选项基本属性 */ interface QuestionItemAttr { /** 题目Id */ questionId: string; /** 题目标题 */ name: string; /** 题目回答,可以多个答案。均为大写字母。 */ answer: string; /** 题目分值 */ score: number; /** 必填 Y / N */ required: null; /** 是否计分 Y / N */ scoreEnabled: null; /** 题目类型 */ type: QuestionItemTypes; /** 题目发送类型 */ status: QuestionStatus; /** 选项人数数组 */ answerResult?: number[]; /** 问题描述 */ desc?: string; } /** socket接收问题列表项 */ export type SocketQuestionItem = QuestionItemAttr & OptionsAndTips; /** 展示问卷列表项 */ export type QuestionItem = QuestionItemAttr & Pick; /** 回答问卷列表项 */ export type AnswerItem = QuestionItemAttr & AnswerItemAttr & Pick; export interface OptionItem { id: string; name: string; } /** 题目选项和提示 */ export interface OptionsAndTips extends Message { option1: string; option2: string; option3?: string | null; option4?: string | null; option5?: string | null; option6?: string | null; option7?: string | null; option8?: string | null; option9?: string | null; option10?: string | null; option11?: string | null; option12?: string | null; option13?: string | null; option14?: string | null; option15?: string | null; tips1: string | null; tips2: string | null; tips3: string | null; tips4: string | null; tips5: string | null; /** 选项数组 */ options?: string[]; /** 提示数组 */ tips?: string[]; optionList?: OptionItem[]; } /** 提交题目答案回调信息 */ export interface AnswerQuestionRes { code: AnswerQuestionResCode; } /** 提交答题响应状态码 */ export enum AnswerQuestionResCode { /** 答题成功 */ SubmitSuccess = 200, /** 问卷已结束,回答被忽略 */ Stop = 301, /** 该学生已提交过答案 */ Submitted = 302 } export interface PrivacyModel { required: EnabledType; content: string; } export interface PersonAnswer { /** 题目Id */ questionId: string; /** 题目回答,可以多个答案。均为大写字母。 */ answer: string; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/questionnaire/evaluation' { /** * 风险测评模块相关接口 * @packageDocumentation */ import { QuestionItem, SocketQuestionItem } from '@polyv/interactions-receive-sdk/apps/questionnaire/message'; export interface AnswerRecords { questionId: string; type: string; answer: string; } export interface EvaluationQuestionRes { code: number; status: string; requestId: string; data: T; success: boolean; } export interface EvaluationQuestionData { questionnaireId: string | null; score: number | null; scoreLabel: string | null; labelRemark: string | null; passEvaluation: number | null; } export interface EvaluationQuestionnaireResData { questionnaire: QuestionnaireData; questions: Array; } export interface EvaluationQuestionnaireData { questionnaireId: string; questionnaireTitle: string; desc: string; type: string; questions: Array; } export interface QuestionnaireData { channelId: number; createdTime: number; customQuestionnaireId: null; desc: string; endTime: number; lastModified: number; name: string; privacyContent: string; privacyEnabled: string; questionnaireId: string; status: string; total: number; type: string; userId: string; } export type EvaluationQuestionMockOptions = { getEvaluationContentUrl: string; commitEvaluationAnswerUrl: string; } | null; } declare module '@polyv/interactions-receive-sdk/apps/announcement/events' { /** * 公告模块相关事件 * @packageDocumentation */ import { AnnounceContent, SocketRemoveBulletinMsg } from '@polyv/interactions-receive-sdk/apps/announcement/message'; /** * 公告模块相关事件 */ export enum AnnouncementEvents { BULLETIN = "BULLETIN", REMOVE_BULLETIN = "REMOVE_BULLETIN" } /** * 公告模块事件数据限定 * SDK可调用方法的参数限制 */ export type AnnouncementETypeParams = { [AnnouncementEvents.BULLETIN]: AnnounceContent; [AnnouncementEvents.REMOVE_BULLETIN]: SocketRemoveBulletinMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/announcement/message' { import { Message } from '@polyv/interactions-receive-sdk/types/message'; type Status = 0 | 1; export interface AnnounceContent { /** 公告ID */ id: string; /** 公告内容 */ content: string; /** 是否置顶 */ isTop?: Status; /** 是否弹窗 */ isPop?: Status; /** 是否可以关闭 */ canClose?: Status; /** 公告发布时间 */ createTime: number; /** 发送该公告的用户昵称 */ nick?: string; /** 发送该公告的用户头像 */ pic?: string; /** 发送该公告的用户头衔 */ actor?: string; /** 发送该公告的用户ID */ userId?: string; /** 房间号 */ roomId: string; } export interface SocketAnnounceMsg extends AnnounceContent, Message { } export interface SocketRemoveBulletinMsg extends Message { /** 公告ID */ id: string; } export interface BulletinListResList { list: AnnounceContent[]; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/red-envelope/events' { /** * 红包模块相关事件 * @packageDocumentation */ import { RedEnvelopeMsg, RedEnvelopeDelayMsg } from '@polyv/interactions-receive-sdk/apps/red-envelope/message'; /** * 红包模块相关事件 */ export enum RedEnvelopeEvents { /** * 发起红包 * 事件参数:{@link RedEnvelopeMsg} * @event */ REDPAPER = "REDPAPER", /** * 延时红包 * 事件参数:{@link RedEnvelopeDelayMsg} */ REDPAPER_FOR_DELAY = "REDPAPER_FOR_DELAY" } /** * 红包模块事件数据限定 */ export type RedEnvelopeETypeParams = { [RedEnvelopeEvents.REDPAPER]: RedEnvelopeMsg; [RedEnvelopeEvents.REDPAPER_FOR_DELAY]: RedEnvelopeDelayMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/red-envelope/message' { /** * 红包模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { OptionsAndTips } from '@polyv/interactions-receive-sdk/apps/questionnaire/message'; interface UserData { /** 昵称 */ nick: string; /** 微信ID */ openid: string; /** 头像 */ pic: string; /** 房间号 */ roomId: string; } /** 红包消息数据内容 */ interface RedEnvelopeData { /** 祝福语 */ content: string; /** 消息来源 */ msgSource: string; /** 总数 */ number: number; /** 缓存的ID */ redCacheId: string; /** 红包ID */ redpackId: string; /** 为红包雨时,返回当前时间戳 */ timestamp?: number; /** 总金额 */ totalAmount: number; /** 类型:普通红包/红包雨 */ type: string; /** 用户信息 */ user: UserData; } /** 红包消息 */ export interface RedEnvelopeMsg extends Message { /** 红包详细信息 */ data: RedEnvelopeData; } /** 延时红包信息 */ export interface RedEnvelopeDelayMsg extends Message { /** 延时时间(秒) */ delayTime: number; /** 祝福语 */ blessing: string; /** 红包发送者昵称 */ nick: string; /** 红包发送者头像 */ pic: string; } export interface RedQuestionnaireRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; data: RedQuestionnaireData; } export interface RedQuestionnaireData { title: string; questions: Array<{ id: string; title: string; description: string; type: string; answer: string; } & OptionsAndTips>; } export interface RedQuestionnaireProcessData { questionId: string; viewerId: string; answer: string; correctAnswer: string; } export interface RedQuestionnaireProcessRes { /** 响应码 */ code: number; /** 状态 */ status: string; /** 状态提示 */ message: string; data: Array; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/redpack-rain/events' { import { RedEnvelopeMsg } from '@polyv/interactions-receive-sdk/apps/red-envelope/message'; import { RedpackRainJoinedParams } from '@polyv/interactions-receive-sdk/apps/redpack-rain/types'; /** * 红包雨事件 */ export enum RedpackRainEvents { /** 收到红包雨事件 */ REDPAPER_RAIN = "REDPAPER_RAIN", /** 参与红包事件 */ REDPAPER_RAIN_JOINED = "REDPAPER_RAIN_JOINED" } /** * 红包雨模块事件数据限定 */ export type RedpackRainETypeParams = { [RedpackRainEvents.REDPAPER_RAIN]: RedEnvelopeMsg; [RedpackRainEvents.REDPAPER_RAIN_JOINED]: RedpackRainJoinedParams; }; } declare module '@polyv/interactions-receive-sdk/apps/redpack-rain/types' { import { ApiResponseData } from '@polyv/interactions-receive-sdk/types'; /** * 红包雨领取信息对象 */ export interface RedPackReceiveType { /** 金额 */ amount: number; /** 头像图片地址 */ avatar: string; /** 频道场次 ID */ channelSessionId: string; /** 领取 id */ logId: string; /** 昵称 */ nickname: string; /** 微信观众 openid */ openid: string; /** 红包 id */ redpackSendId: string; /** 微信观众 unionId */ unionId: string; /** 红包类型 */ redPackType?: string; } /** * 红包雨领取状态 */ export enum RedpackRainReceiveStatus { /** 已领取 */ Received = "received", /** 没抢到,调用过参与接口,但未抢到(不允许二次打开) */ NonReceived = "nonReceived", /** 首次加入,可以打开红包雨 */ Joined = "joined" } /** * joinRedpackRain 方法参数类型 */ export interface JoinRedpackRainParams { /** 红包结构id */ redCacheId: string; /** 红包id */ redpackId: string; /** 加入来源 */ source: string; /** 加入成功回调 */ success?: (data: JoinRedpackRainResult) => unknown; /** 加入失败回调 */ error?: (err: ApiResponseData) => unknown; } /** * 加入红包雨接口返回类型 */ export interface JoinRedpackRainResult { /** 红包雨领取状态 */ receiveStatus: RedpackRainReceiveStatus; /** 红包雨领取信息 */ receiveData?: RedPackReceiveType; } export interface RedpackRainJoinedParams { redpackId: string; redCacheId: string; } /** * receive 接口返回数据 */ export interface ReceiveRedpackRainResult { /** 领取到的金额 */ amount: number; rType?: string; union?: string; } export interface ReceiveRedpackData { receiveData: ReceiveRedpackRainResult; } /** * grabRedpack 方法参数类型 */ export interface GrabRedpackParams { redpackId: string; redCacheId: string; } } declare module '@polyv/interactions-receive-sdk/apps/seat-table/events' { import { AddSeatTableMsg, SeatLike } from '@polyv/interactions-receive-sdk/apps/seat-table/message'; /** * 座位事件 */ export enum SeatTableEvents { /** 新增座位 */ ADD_SEATING = "SEAT_ADD_SEATING", /** 更新座位列表 */ UPDATE_SETTING = "SEAT_UPDATE_SETTING", /** vip点赞 */ VIP_LIKE = "SEAT_VIP_LIKE" } /** * 座位表模块事件数据绑定 */ export type SeatTableETypeParams = { [SeatTableEvents.ADD_SEATING]: AddSeatTableMsg; [SeatTableEvents.UPDATE_SETTING]: AddSeatTableMsg; [SeatTableEvents.VIP_LIKE]: Array; }; } declare module '@polyv/interactions-receive-sdk/apps/seat-table/message' { import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { AppConfig } from '@polyv/interactions-receive-sdk/types'; /** 座位新增事件类型 */ export interface AddSeatTableMsg extends Message { /** 座位号 */ site: number; /** userId */ userId: string; /** 昵称 */ nick: string; /** 头像地址 */ pic: string; } export interface SeatLikeMsg extends Message { list: SeatLike[]; } export interface SeatLike { /** userId */ userId: string; /** 点赞次数 */ times: number; } export interface ViewerSeatInfo { /** 介绍 */ intro: string; /** 职级 */ position: string; /** 坐席Id */ seatId: string; /** 座位号 */ seatNumber: number; /** 坐席类型: vip vip嘉宾 viewer 普通嘉宾 */ type: string; } export interface Config extends AppConfig { viewerSeat: ViewerSeatInfo; } } declare module '@polyv/interactions-receive-sdk/apps/seat-table/types' { import { EnabledType, UniversalParams } from '@polyv/interactions-receive-sdk/types'; import { ViewerSeatInfo } from '@polyv/interactions-receive-sdk/apps/seat-table/message'; export type GetSeatListRes = { list: SeatInfo[]; }; /** * 坐席模板 */ export enum SeatTemplate { /** 模拟会场 */ MEETING = "meeting", /** 竖向列表 */ VERTICAL = "vertical" } /** * 座位信息 */ export interface SeatInfo { /** 头像地址 */ avatar: string; /** 用户昵称 */ nickName: string; /** 用户id */ viewerId: string; /** 座位id */ seatId: string; } export interface SeatList { guestList: Array; list: Array; vipList: Array; } export interface SaveSeatInfoData extends SeatInfo { /** 作为数 */ seatNumber: number; } /** * 某个用户的坐席信息 */ export interface UserSeatInfo { /** 最大座位数 */ seatMaxNumber: number; /** 该用户是否已入座 */ viewerSeatEnabled: EnabledType; } export interface SeatTableRes { code: number; data: D; } export type YN = 'Y' | 'N'; export interface ChannelConfig { /** 观众海报 */ seatCustomText: string; /** 观众海报开关 */ seatCustomTextEnabled: YN; seatEnabled: YN; seatGuestCardEnabled: YN; seatGuestEnabled: YN; /** 普通观众最大人数 */ seatMaxNumber: number; /** 云席模板 meeting模拟会场 vertical 竖向列表 */ seatTemplate: SeatTemplate; /** vip 观看方式: none 无条件 noVip 无vip phone白名单 pay 付费观看 code验证码 */ seatVipAuthType: string; /** vip最大人数 */ seatVipMaxNumber: 18; } export interface EntryParams extends UniversalParams { /** 坐席类型: vip vip嘉宾 viewer 普通嘉宾 */ seatType: string; /** 观众昵称 */ nickName: string; /** 观众头像 */ avatar: string; /** 观众 职级 或 头衔 */ position: string; /** 观众介绍语 */ intro: string; } export interface ExtViewerSeatInfo extends ViewerSeatInfo { /** 坐席id */ id: string; /** 扩展字段 */ ext: { position?: string; intro?: string; }; } } declare module '@polyv/interactions-receive-sdk/apps/vote/events' { /** * 投票模块相关事件 * @packageDocumentation */ import { VoteStartMsg, VoteStopMsg, VoteResultMsg, VoteDeleteAllMsg, VoteDeleteMsg, UpdateVoteOrderMsg, CurVotedList } from '@polyv/interactions-receive-sdk/apps/vote/message'; /** * 投票模块相关事件 */ export enum VoteEvents { /** * 更新已投票列表 */ UPDATE_VOTED_LIST = "UPDATE_VOTED_LIST", /** * 发起投票 * 事件参数:{@link VoteStartMsg} */ START = "START", /** * 结束投票 * 事件参数:{@link VoteStopMsg} */ STOP = "STOP", /** * 投票结果 * 事件参数:{@link VoteResultMsg} */ VOTE_RESULT = "VOTE_RESULT", /** * 清空投票 * 事件参数:{@link VoteDeleteAllMsg} */ DELETE_ALL = "DELETE_ALL", /** * 删除投票 * 事件参数:{@link VoteDeleteMsg} */ DELETE = "DELETE", /** * 更改投票顺序 * 事件参数:{@link UpdateVoteOrderMsg} */ UPDATE_VOTE_ORDER = "UPDATE_VOTE_ORDER" } /** * 投票模块事件数据限定 */ export type VoteETypeParams = { [VoteEvents.UPDATE_VOTED_LIST]: CurVotedList; [VoteEvents.START]: VoteStartMsg; [VoteEvents.STOP]: VoteStopMsg; [VoteEvents.VOTE_RESULT]: VoteResultMsg; [VoteEvents.DELETE_ALL]: VoteDeleteAllMsg; [VoteEvents.DELETE]: VoteDeleteMsg; [VoteEvents.UPDATE_VOTE_ORDER]: UpdateVoteOrderMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/vote/message' { /** * 投票模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { ApiResponseData } from '@polyv/interactions-receive-sdk/types'; /** 投票列表项 */ export interface VoteListItem { /** 投票ID */ id: string; /** 投票名称 */ name: string; /** 选项状态,Y表示在投票中,N表示投票已结束 */ status?: 'Y' | 'N'; /** 是否展示票数 */ showVoteCount?: boolean; /** 票数 */ voteCount?: number; /** 图片 */ voteCoverImage?: string; /** 顺序 */ voteOrder?: number; } /** 开始投票消息 */ export interface VoteStartMsg extends Message, VoteListItem { coverUrl?: string; } /** 停止投票 */ export interface VoteStopMsg extends Message { /** 投票ID */ id: string; } /** 每项投票的结果 */ interface VoteList { /** 投票ID */ id: string; /** 投票名称 */ name: string; /** 投票的数量 */ times: number; } /** 投票结果 */ export interface VoteResultMsg extends Message { list: VoteList[]; } /** 聊天室广播的投票信息 */ export interface ToVoteMsg extends Message { /** 投票ID */ id: string; /** 投票的数量 */ times: number; } export interface ToVoteRes extends ApiResponseData { } /** 清空投票 */ export interface VoteDeleteAllMsg extends Message { } /** 删除投票 */ export interface VoteDeleteMsg extends Message { /** 投票ID */ id: string; } /** 投票列表接口返回数据 */ export interface VoteListRes extends ApiResponseData { data: { list: VoteListItem[]; } | null; } export interface CurVotedList { curVotedList?: string[]; } export interface SliceIdData { voteList?: string[]; [key: string]: unknown; } /** onSliceID消息 */ export interface SliceIdMsg extends Message { data: SliceIdData; } /** 更改投票顺序 */ export interface UpdateVoteOrderMsg extends Message { id: string; oldOrder: number; newOrder: number; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/welfare-lottery/events' { import { WelfareLotteryStartMsg, WelfareLotteryQuestionnaireStartMsg, WelfareLotterytEndMsg, WelfareLotteryQuestionStartMsg, QuestionMsg } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/message'; import { LotteryStartMsg, LotteryEndMsg } from '@polyv/interactions-receive-sdk/apps/lottery/message'; export enum WelfareLotteryEvents { /** * 抽奖活动开始 * 事件参数: {@link WelfareLotteryStartMsg} * @event */ START = "startLotteryForCondition", /** * 抽奖开奖 * 事件参数: {@link WelfareLotterytEndMsg} * @event */ END = "endLotteryForCondition", /** * 答题抽奖活动开始,观看可开始回答问卷阶段 * @event */ START_FOR_LOTTERY = "START_FOR_LOTTERY", /** * 问卷抽奖活动开始 * 事件参数: {@link WelfareLotteryQuestionnaireStartMsg} * @event */ START_FOR_LOTTERY_QUESTIONNAIRE = "START_QUESTIONNAIRE", /** * 结束观众回答问卷阶段,准备奖品开奖阶段 * @event */ OVER_FOR_LOTTERY = "OVER_FOR_LOTTERY", /** * 开始奖品开奖阶段 * @event */ START_FOR_QUESTIONNAIRE = "START_FOR_QUESTIONNAIRE", /** * 问卷抽奖 - 单个奖品开始抽奖 * 事件参数: {@link LotteryStartMsg} */ START_LOTTERY_PRIZE_QUESTIONNAIRE = "LotteryStart", /** * 问卷抽奖 - 单个奖品开始抽奖 * 事件参数: {@link LotteryEndMsg} */ END_LOTTERY_PRIZE_QUESTIONNAIRE = "LotteryEnd", /** * 收到广播推送的题目 * @event */ ADD_QUESTION_FOR_LOTTERY = "ADD_QUESTION_FOR_LOTTERY", /** * 收到题目过期消息 * @event */ QUESTION_EXPIRE_FOR_LOTTERY = "QUESTION_EXPIRE_FOR_LOTTERY" } /** * 抽奖模块事件数据限定 */ export type WelfareLotteryETypeParams = { [WelfareLotteryEvents.START]: WelfareLotteryStartMsg; [WelfareLotteryEvents.END]: WelfareLotterytEndMsg; [WelfareLotteryEvents.START_FOR_LOTTERY]: WelfareLotteryQuestionStartMsg; [WelfareLotteryEvents.START_FOR_LOTTERY_QUESTIONNAIRE]: Omit; [WelfareLotteryEvents.OVER_FOR_LOTTERY]: WelfareLotteryQuestionStartMsg; [WelfareLotteryEvents.START_FOR_QUESTIONNAIRE]: WelfareLotteryQuestionStartMsg; [WelfareLotteryEvents.START_LOTTERY_PRIZE_QUESTIONNAIRE]: LotteryStartMsg; [WelfareLotteryEvents.END_LOTTERY_PRIZE_QUESTIONNAIRE]: LotteryEndMsg; [WelfareLotteryEvents.ADD_QUESTION_FOR_LOTTERY]: QuestionMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/question-answer/message' { import { UniversalParams } from '@polyv/interactions-receive-sdk/types'; import { Message } from '@polyv/interactions-receive-sdk/types/message'; export interface FiltersParams { /** 信息id: 从哪个id开始获取。如果没传,则表示获取最近的数据。 */ id: string; /** 每次获取多少条数据 */ size: number; /** 获取数据的顺序。0表示id从大到小(往下加载);1表示id从小到大(往上加载)。 */ order: 0 | 1; /** 是否只获取与自己相关的问答。1代表是,0代表不是。 */ getSelf: 0 | 1; /** 返回的列表是否包括所传id对应的数据。1表示包括,0表示不包括。 */ getCurrent: 0 | 1; } export interface MessageParams extends UniversalParams { /** 频道id */ roomId: string; /** 用户id */ userId: string; /** 当前时间戳 */ timestamp: number; /** 每次获取多少条数据。 */ size: number; /** 获取数据的顺序。0表示id从大到小(往下加载);1表示id从小到大(往上加载)。 */ order: number; /** 是否只获取与自己相关的问答。1代表是,0代表不是。 */ getSelf: number; /** 返回的列表是否包括所传id对应的数据。1表示包括,0表示不包括。 */ getCurrent: number; /** 从哪个id开始获取。如果没传,则表示获取最近的数据。 */ id?: number; } export interface QuestionAnswerData { data: { question: { id: string; sessionId: string; roomId: string; userId: string; }; answers: [answersItem]; }; } export interface answersItem { /** 用户 */ user: { /** 昵称 */ nick: string; /** 用户id */ userId: string; }; /** 回复时间 */ timestamp: number; /** 消息id */ id: string; /** 回复内容 */ content: string; /** 回复类型 */ msgType?: string; } export interface QuestionAnswerMsg extends Message { EVENT: string; /** 用户 */ user: { /** 昵称 */ nick: string; /** 用户id */ userId: string; }; /** 回复时间 */ timestamp: number; /** 消息id */ id: string; /** 消息类型 */ msgType: string; /** 回复内容 */ content: string; /** 回复id */ questionId: string; /** 问题ID */ questionerId: string; /** 场次好 */ sessionId: string; /** 房间号 */ roomId: string; } } declare module '@polyv/interactions-receive-sdk/apps/question-answer/events' { import { QuestionAnswerData, QuestionAnswerMsg } from '@polyv/interactions-receive-sdk/apps/question-answer/message'; export enum QuestionAnswerEvents { ANSWER = "LAUNCH_A", DELETE_ANSWER = "DELETE_QA_ANSWER", UPDATE_SESSIONID = "UPDATE_SESSIONID" } export type QuestionnaireAnswerETypeParams = { [QuestionAnswerEvents.ANSWER]: QuestionAnswerData; [QuestionAnswerEvents.DELETE_ANSWER]: QuestionAnswerMsg; [QuestionAnswerEvents.UPDATE_SESSIONID]: null; }; } declare module '@polyv/interactions-receive-sdk/apps/tuwen/message' { /** * 图文模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 基础个人信息 */ export interface UserInfoBase { avatar?: string /** 头像 */; nickname?: string /** 名字 */; actor?: string /** 职称 */; } /** 图文类型 Picture 纯图片 | Tuwen 图文 */ export enum MessageType { Tuwen = "N", Picture = "Y" } /** 单条图文数据类型 */ export interface MessageItem { id: number /** 唯一标识 */; images: string[] /** 图片列表 */; text: string /** 富文本内容 */; createTime: number /** 创建时间 */; type: MessageType /** 图文类型 */; top: 'Y' | 'N' /** 是否置顶 */; sort?: number /** 排序 */; isEdit?: boolean /** 是否为编辑 */; } /** 基础数据类型 */ export interface TuwenContent { code: number; data: { setting: UserInfoBase; contents: Array; topContents: Array; total: number; }; } /** Socket触发相关事件 */ export interface SocketEventTypes { UPDATE: string /** 添加消息/编辑消息 */; EDIT_STICKY: string /** 编辑置顶消息 */; DELETE: string /** 删除消息 */; SET_USER_INFO: string /** 设置用户信息 */; } /** Socket事件类型 */ export interface SocketUpdateEvent extends Message { data: MessageItem; } export interface SocketDeleteEvent extends Message { data: { id: number; total: number; }; } export interface SocketStickyEvent extends Message { data: { content: MessageItem; }; } export interface SocketUserEvent extends Message { data: UserInfoBase; } } declare module '@polyv/interactions-receive-sdk/apps/product/events' { import { ProductClickTimesType, ProductMessageType } from '@polyv/interactions-receive-sdk/apps/product/types'; export enum ProductEvents { PRODUCT_MESSAGE = "PRODUCT_MESSAGE", CloseProductBubble = "CloseProductBubble", ProductClickTimes = "PRODUCT_CLICK_TIMES", REFRESH_PRODUCT_LIST = "REFRESH_PRODUCT_LIST", RefreshProductList = "RefreshProductList" } /** * 商品库模块事件数据限定 */ export type ProductETypeParams = { [ProductEvents.PRODUCT_MESSAGE]: ProductMessageType; [ProductEvents.CloseProductBubble]: void; [ProductEvents.ProductClickTimes]: ProductClickTimesType; [ProductEvents.RefreshProductList]: void; }; } declare module '@polyv/interactions-receive-sdk/apps/product/types' { import { ProductEvents } from '@polyv/interactions-receive-sdk/apps/product/events'; /** * 商品链接类型 */ export enum ProductLinkType { /** 通用链接 */ Normal = 10, /** 多平台跳转 */ MultiPlatform = 11, /** 原生方法跳转 */ Native = 12 } export enum ProductType { /** 普通产品 */ Normal = "normal", /** 金融产品 */ Finance = "finance", /** 职业产品 */ Job = "position" } /** * 商品共用类型 */ export interface CommonProductData { /** 商品唯一标识 */ productId: number; /** 排序号,从 1 开始 */ rank: number; /** 显示的序列号 */ showId: number; /** 商品名称 */ name: string; /** 商品描述 */ productDesc: string; /** 商品标签,数组类型的 json 字符 */ features: string; /** 在架状态,0-下架,1-上架 */ status: 0 | 1; /** 按钮文案 */ btnShow: string; /** 链接类型 */ linkType: ProductLinkType; /** 通用平台跳转链接 */ link: string; /** PC 端跳转链接 */ pcLink: string; /** 移动端跳转链接 */ mobileLink: string; /** App 链接 */ mobileAppLink: string; /** 安卓端 app 跳转链接 */ androidLink: string; /** iOS app 跳转链接 */ iosLink: string; /** 其他链接 */ otherLink: string; /** 微信小程序原始 id */ wxMiniprogramOriginalId: string; /** 微信小程序内页面路径及参数 */ wxMiniprogramLink: string; /** 商品讲解状态 */ explainStatus: ProductExplainStatus; /** 讲解类型 */ explainType: 'live' | 'recordFile'; /** 跳转方式 */ jumpWay?: 'NEW_WINDOW' | 'POP_UP' | 'CURRENT_WINDOW'; /** 商品信息扩展字段 */ ext?: string; } /** * 普通商品类型 */ export interface NormalProductData extends CommonProductData { /** 商品类型 */ productType: ProductType.Normal; /** 商品封面 */ cover: string; /** 价格(普通产品) */ realPrice: number; /** 原价(普通产品) */ price: number; /** 秒杀活动 */ seckillActivities?: { /** 秒杀价类型 */ seckillPriceType?: string; /** 秒杀价(金额类商品) */ seckillPrice?: number | null; /** 自定义秒杀价(自定义价格商品) */ customSeckillPrice?: string; startTime: number; endTime: number; }[]; } /** * 金融商品类型 */ export interface FinanceProductData extends CommonProductData { /** 商品类型 */ productType: ProductType.Finance; /** 收益率(金融产品) */ yield: string; /** 商品封面 */ cover: string; } export interface JobProductData extends CommonProductData { /** 商品类型 */ productType: ProductType.Job; /** 自定义参数json格式 */ params: string; } /** * 商品数据 */ export type ProductData = NormalProductData | FinanceProductData | JobProductData; /** * 获取商品列表参数 */ export type GetProductListParams = { /** 排序号,获取排序号之后靠前的商品 rank,不传默认从最后获取 */ rank?: number; showId?: number; /** 获取数量,默认:10 */ count?: number; }; export type GetProductListByTagParams = { tagId: number; pageNumber?: number; pageSize?: number; keyword?: string; }; export type GetProductLabelListParams = { pageNumber?: number; pageSize?: number; keyword?: string; }; /** * 商品列表信息 */ export type ProductListData = { /** 商品总数 */ total: number; /** 列表 */ content: ProductData[]; }; export type ProductListPageData = { pageNumber: number; pageSize: number; contents: ProductData[]; totalPages: number; totalItems: number; }; export interface ProductLabelItem { id: number; name: string; } export type ProductLabelListData = { pageNumber: number; pageSize: number; totalPages: number; totalItems: number; contents: ProductLabelItem[]; }; /** * 商品库消息的类型 */ export enum ProductMessageStatus { /** 上架商品 */ OnShelf = "1", /** 下架商品 */ OffShelf = "2", /** 删除商品 */ DeleteProduct = "3", /** 添加商品 */ AddProduct = "4", /** 修改商品 */ ChangeProduct = "5", /** 上移商品 */ MoveUp = "6", /** 下移商品 */ MoveDown = "7", /** 商品推送 */ PushProduct = "9", /** 商品库开关 */ ProductSwitch = "10", /** 修改排序 */ ChangeRank = "15", /** 商品取消推送 */ CancelPushProduct = "11", /** 商品售罄 */ ProductSoldOut = "12" } export type ProductMessageType = { EVENT: ProductEvents.PRODUCT_MESSAGE; /** 涉及的商品信息 */ content: ProductData | ProductData[]; /** 消息类型 */ status: ProductMessageStatus; }; export type ProductClickTimesType = { EVENT: ProductEvents.ProductClickTimes; type: typeof ProductType; positionName: string; times: number; }; /** 商品讲解状态 */ export enum ProductExplainStatus { /** 待讲解 */ notExplained = "notExplained", /** 讲解中 */ explaining = "explaining", /** 已讲解 */ explained = "explained" } } declare module '@polyv/interactions-receive-sdk/apps/enroll-lottery/events' { import { EnrollLotteryDetail, LotteryForDataMsg } from '@polyv/interactions-receive-sdk/apps/enroll-lottery/message'; export enum EnrollLotteryEvents { UpdateLotteryDetail = "updateLotteryDetail", StartLotteryForSignUp = "startLotteryForSignUp", EndLotteryForSignUp = "endLotteryForSignUp" } export interface EnrollLotteryETypeParams { [EnrollLotteryEvents.UpdateLotteryDetail]: EnrollLotteryDetail; [EnrollLotteryEvents.StartLotteryForSignUp]: LotteryForDataMsg; [EnrollLotteryEvents.EndLotteryForSignUp]: LotteryForDataMsg; } } declare module '@polyv/interactions-receive-sdk/apps/enroll-lottery/message' { import { Message } from '@polyv/interactions-receive-sdk/types/message'; import { UniversalParams } from '@polyv/interactions-receive-sdk/types'; import { Winner } from '@polyv/interactions-receive-sdk/apps/lottery/lottery'; /** 抽奖开始消息 */ export interface UpdateLotteryDetailMsg extends Message { /** 抽奖ID */ lotteryId: string; } export interface LotteryForDataMsg extends Message { /** 抽奖ID */ lotteryId: string; /** 抽奖名称 */ name: string; /** 抽奖次数 */ times: number; } /** 提交中奖人信息接口响应 */ export interface SubmitInfoRes { code: number; data: string; message: string; status: string; } export interface SubmitInfoParams extends UniversalParams { enrollLotteryName: string; channelId: string; lotteryId: string; mobile: string; name: string; } export interface WinnerListParams extends UniversalParams { lotteryId: string; channelId: string; times: number; page: number; search: string; pageSize: number; } export interface EnrollLotteryDetail { amount: number; channelId: number; createdTime: number; endTime: number; enrollNum: null; filterWinner: 'Y' | 'N'; lastModified: number; lotteryId: string; lotteryType: string; name: string; serverTime: number; sessionId: string; sourceRange: string; startTime: number; times: number; userId: string; } export interface WinnerResData { /** 中奖人列表 */ contents: Winner[]; /** 每页条数 */ pageSize: number; /** 总页数 */ totalPages: number; /** 页码 */ pageNumber: number; /** 是否为第一页 */ firstPage: boolean; /** 是否为最后一页 */ lastPage: boolean; /** 下一页页码 */ nextPageNumber: number; /** 上一页页码 */ prePageNumber: number; /** 总记录数 */ totalItems: number; } } declare module '@polyv/interactions-receive-sdk/apps/topic/events' { import { EntranceStatus, TopicData, TopicMessage, DeleteTopicMsg } from '@polyv/interactions-receive-sdk/apps/topic/message'; /** * 话题SDK事件 */ export enum TopicEvents { /** 开始话题 */ TOPIC_START = "TOPIC_START", /** 结束话题 */ TOPIC_OVER = "TOPIC_OVER", /** 改变话题入口图标状态 */ TOPIC_CHANGE_ENTRANCE = "TOPIC_CHANGE_ENTRANCE", /** 更新话题数据 */ TOPIC_UPDATE_DATA = "TOPIC_UPDATE_DATA", /** 删除话题 */ TOPIC_DELETE = "TOPIC_DELETE" } /** * 话题模块事件数据绑定 */ export type TopicETypeParams = { [TopicEvents.TOPIC_START]: TopicData; [TopicEvents.TOPIC_OVER]: TopicMessage; [TopicEvents.TOPIC_CHANGE_ENTRANCE]: EntranceStatus; [TopicEvents.TOPIC_UPDATE_DATA]: TopicData; [TopicEvents.TOPIC_DELETE]: DeleteTopicMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/topic/message' { import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 话题数据 */ export interface TopicData extends Message { /** pk的id */ id: number; /** 话题名称 */ name: string; /** 左观点 */ left: string; /** 右观点 */ right: string; /** pk状态,running表示正在进行中,over表示已结束 */ status: string; /** 左观点数量 */ leftNumber: number; /** 右观点数量 */ rightNumber: number; /** status为running时存在,true表示自己是否已经回答过 */ userIsAnswered: boolean; /** 自己提交的答案 */ answer: string; } export interface TopicMessage extends Message { /** pk的id */ id: number; /** 话题名称 */ name: string; /** 左观点 */ left: string; /** 右观点 */ right: string; } export interface EntranceStatus extends Message { /** imageStatus: show 表示展示 hide 表示隐藏 */ imageStatus: string; /** 图标入口是否展示 */ entranceEnable?: boolean; } export interface DeleteTopicMsg extends Message { /** 话题id */ id: number; } } declare module '@polyv/interactions-receive-sdk/apps/rush-answer/events' { /** * 抢答模块相关事件 * @packageDocumentation */ import { StartAnswerQuicklyMsg, StopAnswerQuicklyMsg, AnswerQuicklyRemainingMsg, AnswerQuicklyStatusMsg } from '@polyv/interactions-receive-sdk/apps/rush-answer/message'; /** * 投票模块相关事件 */ export enum RushAnswerEvents { ON_SLICE_ID = "onSliceID", /** * 抢答开始 * 事件参数:{@link StartAnswerQuicklyMsg} */ START_ANSWER_QUICKLY = "START_ANSWER_QUICKLY", /** * 抢答结束 * 事件参数:{@link StopAnswerQuicklyMsg} */ STOP_ANSWER_QUICKLY = "STOP_ANSWER_QUICKLY", /** * 抢答剩余人数 * 事件参数:{@link AnswerQuicklyRemainingMsg} */ ANSWER_QUICKLY_REMAINING = "ANSWER_QUICKLY_REMAINING", /** * 抢答状态 * 事件参数:{@link AnswerQuicklyStatusMsg} */ GET_ANSWER_QUICKLY_STATUS = "GET_ANSWER_QUICKLY_STATUS" } /** * 投票模块事件数据限定 */ export type RushAnswerETypeParams = { [RushAnswerEvents.START_ANSWER_QUICKLY]: StartAnswerQuicklyMsg; [RushAnswerEvents.STOP_ANSWER_QUICKLY]: StopAnswerQuicklyMsg; [RushAnswerEvents.ANSWER_QUICKLY_REMAINING]: AnswerQuicklyRemainingMsg; [RushAnswerEvents.GET_ANSWER_QUICKLY_STATUS]: AnswerQuicklyStatusMsg; }; } declare module '@polyv/interactions-receive-sdk/apps/rush-answer/message' { /** * 抢答模块相关消息体接口 * @packageDocumentation */ import { Message } from '@polyv/interactions-receive-sdk/types/message'; /** 抢答开始消息 */ export interface StartAnswerQuicklyMsg extends Message { limitTime: number; maxNumber: number; overTime: number; quicklyId: string; remark?: string; sessionId: string; timestamp: number; } /** 抢答结束消息 */ export interface StopAnswerQuicklyMsg extends Message { quicklyId: string; } export interface AnswerQuicklyRemainingMsg extends Message { /** 剩余抢答人数 */ remainingNumber: number; } export interface AnswerQuicklyStatusMsg extends Message { limitTime: number; maxNumber: number; overTime: number; quicklyId: string; remark?: string; sessionId: string; timestamp: number; answerNum: number; roomId: string; status?: boolean; } } declare module '@polyv/interactions-receive-sdk/apps/address-management/types' { /** 请求用户地址列表参数 */ export interface GetAddressListOfUserParams { channelId?: string; keyword?: string; needPage?: string; pageNumber?: number; pageSize?: number; userId?: string; viewerId?: string; } /** 地址列表返回 */ export interface GetAddressListOfUserResponse { list: AddressDetailResponse[]; pageNumber: number; pageSize: number; totalItem: number; totalPages: number; } export interface AddressBasicParams { address?: string; area?: string; mobile?: string; name?: string; viewerId?: string; } /** 添加地址参数 */ export type AddAddressParams = AddressBasicParams; /** 修改地址参数 */ export interface UpdateAddressParams extends AddressBasicParams { id: string; } /** 删除地址参数 */ export interface DeleteAddressParams { id: string; viewerId?: string; } /** 地址详情 */ export interface AddressDetailResponse { id: string; address: string; area: string; mobile: string; name: string; } } declare module '@polyv/interactions-receive-sdk/apps/order/type' { import { OrderStatus, DeliveryType } from '@polyv/interactions-receive-sdk/apps/order/message'; /** 获取订单列表参数 */ export interface GetOrderListParams { /** 订单状态 */ orderStatus?: OrderStatus; /** 页码 */ pageNumber?: number; } /** 订单中的商品 */ export interface OrderProductData { /** 商品金额 */ amount: number; /** 客服联系方式(二维码图片地址), 渠道码被删除则没有值 */ customerServiceContact?: string; /** 客服方式: 渠道码wxWorkCode、自定义custom */ customerServiceType?: 'wxWorkCode' | 'custom'; /** 履约方式,物流express、虚拟(无物流)virtual */ deliveryType: DeliveryType; /** 商品封面 */ productCover: string; /** 商品名称 */ productName: string; /** 购买数量 */ quantity: number; /** 商品总金额 */ totalAmount: number; } /** 订单详情 */ export interface OrderContentsData { /** 订单金额 */ amount: number; /** 商品列表 */ products: OrderProductData[]; /** 订单过期时间 */ expireTime: string; /** 订单号 */ orderNo: string; /** 订单状态 */ status: OrderStatus; } /** 订单列表接口返回数据 */ export interface OrderListPageData { pageNumber: number; pageSize: number; contents: OrderContentsData[]; totalPages: number; totalItems: number; } /** 获取订单详情参数 */ export interface GetOrderDetailParams { /** 订单号 */ orderNo: string; /** 是否主动同步订单状态 Y|N */ syncPayStatus: string; } /** 物流信息 */ export interface AddressExt { /** 详细地址 */ address: string; /** 地区 */ area: string; /** 手机号 */ mobile: string; /** 用户姓名 */ name: string; } /** 订单详情接口返回数据 */ export interface OrderDetailData { /** 物流信息 */ addressExt?: AddressExt; /** 订单金额 */ amount: number; /** 创建时间 */ createTime: string; /** 订单过期时间 */ expireTime: string; /** 订单支付时间 */ payTime: string; /** 商品列表 */ products: OrderProductData[]; /** 订单状态 */ status: string; } /** 订单确认收货参数 */ export interface SetOrderFinishParams { /** 订单号 */ orderNo: string; } } declare module '@polyv/interactions-receive-sdk/apps/order/message' { /** 订单状态 */ export enum OrderStatus { /** 待支付 */ WAIT_PAY = "wait_pay", /** 待发货 */ WAIT_DELIVERY = "wait_delivery", /** 待收货 */ DELIVERING = "delivering", /** 已完成 */ FINISH = "finish", /** 已关闭 */ CLOSE = "close" } /** 履约方式 */ export enum DeliveryType { /** 物流 */ Express = "express", /** 无物流 */ Virtual = "virtual" } } declare module '@polyv/interactions-receive-sdk/types/message' { /** 消息基础接口 */ export interface Message { /** * 聊天室业务原事件名 */ EVENT: string; [key: string]: unknown; } /** 消息发送者 */ export interface MessageUser { /** 发送者 id */ userId: string; /** 发送者昵称 */ nick: string; /** 发送者头像 */ pic: string; /** 发送者身份 */ userType: string; /** socketId */ uid?: string; /** 用户头衔 */ actor?: string; } } declare module '@polyv/interactions-receive-sdk/constants/events' { /** * 互动功能接收端 SDK 事件 * @packageDocumentation */ import { feedBackETypeParams, feedBackEvents } from '@polyv/interactions-receive-sdk/apps/feedback/events'; import { CheckInETypeParams, CheckInEvents } from '@polyv/interactions-receive-sdk/apps/check-in/events'; import { LotteryEvents, LotteryETypeParams } from '@polyv/interactions-receive-sdk/apps/lottery/events'; import { TuwenEvents, TuwenETypeParams } from '@polyv/interactions-receive-sdk/apps/tuwen/events'; import { AnswerCardETypeParams, AnswerCardEvents } from '@polyv/interactions-receive-sdk/apps/answer-card/events'; import { QuestionnaireEvents, QuestionnaireETypeParams } from '@polyv/interactions-receive-sdk/apps/questionnaire/events'; import { AnnouncementEvents, AnnouncementETypeParams } from '@polyv/interactions-receive-sdk/apps/announcement/events'; import { RedEnvelopeEvents, RedEnvelopeETypeParams } from '@polyv/interactions-receive-sdk/apps/red-envelope/events'; import { RedpackRainEvents, RedpackRainETypeParams } from '@polyv/interactions-receive-sdk/apps/redpack-rain/events'; import { PushCardEvents, PushCardETypeParams } from '@polyv/interactions-receive-sdk/apps/push-card/events'; import { VoteEvents, VoteETypeParams } from '@polyv/interactions-receive-sdk/apps/vote/events'; import { WelfareLotteryEvents, WelfareLotteryETypeParams } from '@polyv/interactions-receive-sdk/apps/welfare-lottery/events'; import { SeatTableETypeParams, SeatTableEvents } from '@polyv/interactions-receive-sdk/apps/seat-table/events'; import { ProductETypeParams, ProductEvents } from '@polyv/interactions-receive-sdk/apps/product/events'; import { SocketIOEvents } from '@polyv/interactions-receive-sdk/types'; import { EnrollLotteryETypeParams, EnrollLotteryEvents } from '@polyv/interactions-receive-sdk/apps/enroll-lottery/events'; import { QuestionAnswerEvents, QuestionnaireAnswerETypeParams } from '@polyv/interactions-receive-sdk/apps/question-answer/events'; import { TopicETypeParams, TopicEvents } from '@polyv/interactions-receive-sdk/apps/topic/events'; import { RushAnswerETypeParams, RushAnswerEvents } from '@polyv/interactions-receive-sdk/apps/rush-answer/events'; /** 互动功能接收端 SDK 事件 */ export enum SdkEvents { /** 聊天室 SDK 更新(互动应用将需要重新监听相关事件) */ CHAT_UPDATED = "CHAT_UPDATED", /** 聊天室 SDK 更新(互动应用将需要重新监听相关事件) */ CHANGE_CHAT_STATUS = "CHANGE_CHAT_STATUS", /** 频道信息更新 */ CHANGE_CHANNEL_INFO = "CHANGE_CHANNEL_INFO" } /** SDK 内部事件 */ export type SdkETypeParams = { /** SDK 更新配置时检测到聊天室实例变化 */ [SdkEvents.CHAT_UPDATED]: null; }; export type EType = TopicEvents | SdkEvents | feedBackEvents | CheckInEvents | AnswerCardEvents | LotteryEvents | QuestionnaireEvents | AnnouncementEvents | RedEnvelopeEvents | RedpackRainEvents | PushCardEvents | WelfareLotteryEvents | TuwenEvents | VoteEvents | SeatTableEvents | ProductEvents | QuestionAnswerEvents | EnrollLotteryEvents | RushAnswerEvents; /** SDK 触发事件消息体限定 */ export type ETypeParam = TopicETypeParams & SdkETypeParams & feedBackETypeParams & CheckInETypeParams & AnswerCardETypeParams & LotteryETypeParams & QuestionnaireETypeParams & AnnouncementETypeParams & RedEnvelopeETypeParams & RedpackRainETypeParams & PushCardETypeParams & VoteETypeParams & WelfareLotteryETypeParams & TuwenETypeParams & SeatTableETypeParams & ProductETypeParams & QuestionnaireAnswerETypeParams & EnrollLotteryETypeParams & RushAnswerETypeParams & { [key: string]: null; }; /** event emitter 事件处理器 */ export interface Listener { (args: unknown): unknown; } export const SocketStatusEvent: SocketIOEvents[]; } declare module '@polyv/interactions-receive-sdk/utils/ajax' { /** * @internal * api 请求封装 * @packageDocumentation */ import { IAJAXOptions } from '@just4/ajax/interfaces'; import { UniversalParams } from '@polyv/interactions-receive-sdk/types'; import { DecryptOptions } from '@polyv/interactions-receive-sdk/types/encryption'; /** ajax 请求库构造函数参数 */ interface APIQueryConfig { /** 请求前缀 */ baseURL: string; /** 超时数值 */ timeout?: number; } /** * API 请求封装 * @class */ export default class APIQuery { constructor(options: APIQueryConfig); /** * 修改请求前缀 * @param baseURL 新的请求前缀 * @returns this */ setBaseURL(baseURL: string): this; _addBaseURL(url: string): string; _request(url: string, options: IAJAXOptions, decryptOptions?: DecryptOptions): Promise; get(url: string, params?: UniversalParams, options?: IAJAXOptions, decryptOptions?: DecryptOptions): Promise; post(url: string, data?: UniversalParams, options?: IAJAXOptions, decryptOptions?: DecryptOptions): Promise; } export {}; } declare module '@polyv/interactions-receive-sdk/apps/tuwen/events' { /** * 图文模块相关事件 * @packageDocumentation */ import { MessageItem, UserInfoBase } from '@polyv/interactions-receive-sdk/apps/tuwen/message'; /** * 图文发布emit相关事件 */ export enum TuwenEvents { CREATE = "CREATE_IMAGE_TEXT", UPDATE = "UPDATE_IMAGE_TEXT", EDIT_STICKY = "SET_TOP_IMAGE_TEXT", DELETE = "DELETE_IMAGE_TEXT", SET_USER_INFO = "SET_IMAGE_TEXT_MSG" } /** 图文socket接收相关事件 */ export enum TuwenSocketMessage { UPDATE = "CREATE_IMAGE_TEXT", EDIT_STICKY = "SET_TOP_IMAGE_TEXT", DELETE = "DELETE_IMAGE_TEXT", SET_USER_INFO = "SET_IMAGE_TEXT_MSG" } export type EVENT_TYPES = TuwenEvents; export enum API { GET_MESSAGE_LIST = "/live/v3/sdk/watch/interactive/tuwen/list" } /** * 答题卡模块事件数据限定 */ export type TuwenETypeParams = { [TuwenEvents.CREATE]: { data: MessageItem; }; [TuwenEvents.UPDATE]: { editIndex: number; editList: Array; }; [TuwenEvents.EDIT_STICKY]: { topMessageIndex: number; messageIndex: number; content: MessageItem; }; [TuwenEvents.DELETE]: { topMessageIndex: number; messageIndex: number; }; [TuwenEvents.SET_USER_INFO]: { data: UserInfoBase; }; }; }