Files
toutoukan_front/typings/index.d.ts
JACKYMYPERSON eae49c76bd 基本成型
2025-09-27 17:24:52 +08:00

39 lines
848 B
TypeScript

/// <reference path="./types/index.d.ts" />
export interface VoteOption {
id: number;
name: string;
votes: number;
is_voted: boolean;
percentage?: number;
isSelected?: boolean;
}
export interface CardData {
article_id: number;
article_title: string;
vote_type: 'single' | 'multiple';
total_voters: number;
end_time: string;
is_ended: boolean;
publisher_id: string;
create_time: string;
options: VoteOption[];
user_has_voted: boolean;
user_voted_option_ids: number[] | null;
}
interface IAppOption {
globalData: {
userInfo?: WechatMiniprogram.CustomUserInfo | null,
token: string,
rawCardData:CardData[],
processedCardsData:CardData[]
}
userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback,
processVoteData(rawData: CardData[]): CardData[],
fetchRawCardData():void,
}