Hiyve Components - v1.0.0
    Preparing search index...

    Represents a poll in the system.

    A poll can be in draft, active, or ended status. Only the owner can manage poll lifecycle (create, start, end, delete).

    const poll: Poll = {
    id: 'poll-123',
    question: 'What should we discuss next?',
    type: 'multiple-choice',
    options: [
    { id: 'opt-1', text: 'Architecture', votes: [] },
    { id: 'opt-2', text: 'Testing', votes: [] },
    ],
    createdBy: 'user-owner',
    createdAt: Date.now(),
    status: 'active',
    startedAt: Date.now(),
    settings: {
    anonymous: false,
    multiSelect: false,
    showResultsWhileVoting: true,
    autoShareResults: true,
    },
    results: {
    totalVotes: 0,
    totalVoters: 0,
    isShared: false,
    },
    };
    interface Poll {
        createdAt: number;
        createdBy: string;
        createdByName?: string;
        endedAt?: number;
        id: string;
        options: PollOptionType[];
        question: string;
        results: PollResults;
        settings: PollSettings;
        startedAt?: number;
        status: PollStatus;
        textResponses?: TextResponse[];
        type: PollType;
    }
    Index

    Properties

    createdAt: number

    Timestamp when poll was created

    createdBy: string

    User ID of the poll creator

    createdByName?: string

    Display name of creator

    endedAt?: number

    Timestamp when poll was ended

    id: string

    Unique identifier for the poll

    options: PollOptionType[]

    Options for the poll (empty for text type)

    question: string

    Poll question text

    results: PollResults

    Aggregated results

    settings: PollSettings

    Poll settings

    startedAt?: number

    Timestamp when poll was started (made active)

    status: PollStatus

    Current poll status

    textResponses?: TextResponse[]

    Text responses for text-type polls

    type: PollType

    Type of poll