import { Observable } from 'rxjs'; import { Service } from '../../services/service'; import { Poll } from '../../models/poll.model'; import { Bubble } from '../../models/bubble.model'; export declare const POLLS_SVC = "PollsService"; export interface PollsService { /** * Get the polls array observable * @param bubbleRef - The concerned Bubble * @returns an array observable of Polls */ getRoomPolls(bubbleRef: Bubble | string): Observable; /** * Retrieve Poll object already cached from Poll Id and Room Id * @param roomId - id of the room * @param pollId - id of the poll * @returns a Poll Object if found */ getRoomPollById(roomId: string, pollId: string): Poll | undefined; /** * Create a Poll server side from a Poll object * @param poll - the Poll to create server side * @returns the updated Poll object */ createPoll(poll: Poll): Promise; /** * Update a Poll server side from a Poll object * @param poll - the Poll to update * @returns the updated Poll */ updatePoll(poll: Poll): Promise; /** * Get Poll info from server * @param poll - the Poll you want info form * @param format - the format of the Poll you want (small, medium, full) * @returns the updated Poll */ updatePollFromServer(poll: Poll, format?: string): Promise; /** * Get the Poll from its identifier * @param pollId - the Poll identifier * @returns the wanted Poll */ getPoll(pollId: string): Promise; /** * Publish the Poll (changing its state to 'published', people will be able to vote, you won't be able to edit the Poll) * @param poll - the Poll to publish * @returns the updated Poll */ publishPoll(poll: Poll): Promise; /** * Unpublish the Poll (changing its state to 'unpublished', people won't be able to vote but you will be able to edit the Poll) * @param poll - the Poll to unpublish * @returns the updated Poll */ unpublishPoll(poll: Poll): Promise; /** * Delete the Poll * @param poll - the Poll to delete */ deletePoll(poll: Poll): Promise; /** * Vote for a Poll * @param poll - the Poll to vote for * @returns the updated Poll */ votePoll(poll: Poll): Promise; /** * Terminate a Poll (changing its state to 'terminated', no one will be able to vote anymore) * @param poll - the Poll to terminate * @returns the updated Poll */ terminatePoll(poll: Poll): Promise; /** * Export a poll in CSV format file * @param poll - the poll to export * @param filename - the export filename */ exportAsCSV(poll: Poll, filename: string): Promise; } /** * @module * This service manages polls in Rainbow. */ export declare class PollsServiceRB extends Service implements PollsService { private mainService; private contactService; private logger; private authService; private xmppService; private bubbleService; private errorHelperService; private eventService; private xmppSubscription; private xmppListeners; private pollsObs; private started; /** * Get the pollsService singleton * @returns the pollsService singleton */ static getInstance(): PollsServiceRB; static build(): PollsServiceRB; start(): Promise; stop(): Promise; reconnect(): Promise; private constructor(); attachListeners(): void; getRoomPolls(bubbleRef: Bubble | string): Observable; getRoomPollsList(roomId: string): Promise; getPoll(pollId: string): Promise; getRoomPollById(roomId: string, pollId: string): Poll | undefined; updatePollFromServer(poll: Poll, format?: string): Promise; publishPoll(poll: Poll): Promise; unpublishPoll(poll: Poll): Promise; terminatePoll(poll: Poll): Promise; deletePoll(poll: Poll): Promise; createPoll(poll: Poll): Promise; updatePoll(poll: Poll): Promise; votePoll(poll: Poll): Promise; private onAdminMessage; private onEventMessage; private onRoomMessage; exportAsCSV(poll: Poll, filename: string): Promise; private getPollStats; private getPollUsersStat; private getPollQuestionStats; } //# sourceMappingURL=polls.service.d.ts.map