UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

55 lines 1.68 kB
import { Poll, VoteResult, GetPollResult } from './index'; import { Thunk } from '../api'; import { PollsState } from './pollReducer'; export declare const DEFAULT_POLL_CONTEXT = "newspoll"; /** * Cast a poll vote * @param referenceId * @param answerId * @param context (optional. for future use) */ export declare function castPollVote({ referenceId, answerId, context }: { referenceId: number; answerId: number; context: string; }): Thunk<Promise<VoteResult>>; /** * Fetch a poll and add it to the store * @param referenceId * @param context (optional. for future use) */ export declare function fetchPoll({ referenceId, context }: { referenceId: number; context: string; }): Thunk<Promise<GetPollResult>>; /** * Add a poll to the state * @param poll * @param context (optional. for future use) */ export declare function updatePoll(poll: Poll | null | undefined, context?: string): Thunk<void>; /** * Add multiple polls to the state * @param polls * @param context */ export declare function updatePolls(polls: Array<Poll> | null | undefined, context?: string): Thunk<void>; /** * Get a poll from the store * @param state * @param referenceId * @param context */ export declare function getPollFromStore(state: PollsState, referenceId: number, context?: string): Poll | null; /** * Clear a poll from the store * @param referenceId * @param context */ export declare function clearPoll(referenceId: number, context?: string): (dispatch: any) => void; /** * Clear all polls from the store * @param context */ export declare function clearPolls(context?: string): (dispatch: any) => void; //# sourceMappingURL=pollActions.d.ts.map