import { BehaviorSubject, Subject } from "rxjs"; import { Contact } from "./contact.model"; export interface PollVoter { /** * Id of the voter */ userId: string; /** * Email of the voter */ email: string; /** * Firstname of the voter */ firstName: string; /** * Lastname of the voter */ lastName: string; } export declare class PollAnswer { /** * Text content of the answer */ text: string; /** * If the poll is not anonymous and if we are mods, we store the index of a person's vote (index matching poll.voters) * This helps matching a vote to the voter's info */ votes: number[]; /** * The number of people who voted for this answer */ nbVotes: number; /** * true if I have choosen this answer */ voted: boolean; _selected: boolean; _details: boolean; static create(text: string): PollAnswer; static createFromData(data: any): PollAnswer; getData(): any; reset(): void; getPercent(nbTotalVoters: number): number; } export declare class PollQuestion { /** * Text content of the question */ text: string; /** * True if you can select multiple answers for this question */ multipleChoice: boolean; /** * List of possible answers */ answers: PollAnswer[]; nbVotes: number; valueChanges?: Subject; _edit: boolean; static create(text: string, answers: PollAnswer[], multipleChoice?: boolean): PollQuestion; static createEmpty(): PollQuestion; static createFromData(poll: Poll, data: any): PollQuestion; update(text: string, answers: PollAnswer[], multipleChoice: boolean): void; getData(): any; reset(): void; } export declare class Poll { /** * Id of the Poll in db */ id?: string; /** * Title of the Poll */ title: string; /** * State can be 'unpublished', 'published' or 'terminated' */ state: string; /** * Id of the associated Bubble/Webinar */ roomId: string; /** * Contact object of the creator */ creator: Contact; /** * Id of the creator */ creatorId: string; /** * True if the Poll is anonymous. The mods when have access to the voter's info, only the number of votes for each answer */ anonymous: boolean; /** * True if people can modify their vote */ modifyVote: boolean; /** * List of questions */ questions: PollQuestion[]; /** * Duration of the Poll. If duration is 0, then there is no limit */ duration: number; /** * True if the user has already voted */ voted: boolean; created: boolean; creationDate: Date | null; publicationDate: Date | null; /** * Number of people who answered the Poll */ nbVotes: number; /** * List of voters with their personal info (see PollVoter) */ private _voters; valueChanges: BehaviorSubject | undefined; _durationTimeout: any; get voters(): PollVoter[]; set voters(newVoters: PollVoter[]); static create(roomId: string, questions: PollQuestion[]): Poll; static createFromData(data: any): Poll; updateFromData(data: any): void; getVoteData(): string; getData(): string; reset(): void; updateNbVotes(): void; } //# sourceMappingURL=poll.model.d.ts.map