@stackend/api
Version:
JS bindings to api.stackend.com
70 lines • 2.43 kB
TypeScript
import { Event, RsvpResult, RSVPStatus, CurrentUserRsvpStatuses } from './index';
import { PaginatedCollection } from '../api/PaginatedCollection';
export declare const EVENT_RSVP_UPDATED = "EVENT_RSVP_UPDATED";
export declare const EVENT_RSVP_RECEIVED = "EVENT_RSVP_RECEIVED";
export declare const EVENTS_RECEIVED = "EVENTS_RECEIVED";
export declare const RESET_EVENTS = "RESET_EVENTS";
export declare const CLEAR_EVENT = "CLEAR_EVENT";
export interface EventsReceivedAction {
type: typeof EVENTS_RECEIVED;
context: string;
events: Array<Event>;
}
export interface ResetEventsAction {
type: typeof RESET_EVENTS;
context?: string;
}
export interface ClearEventAction {
type: typeof CLEAR_EVENT;
context: string;
eventId: number;
}
export interface EventRsvpUpdatedAction {
type: typeof EVENT_RSVP_UPDATED;
context: string;
result: RsvpResult;
extraData: any;
}
export interface EventRsvpUserResponses {
interested: PaginatedCollection<number>;
accepted: PaginatedCollection<number>;
declined: PaginatedCollection<number>;
}
export interface RsvpUserResponses {
[eventId: string]: EventRsvpUserResponses;
}
export interface EventRsvpReceivedAction {
type: typeof EVENT_RSVP_RECEIVED;
context: string;
currentUserRsvpStatuses?: CurrentUserRsvpStatuses;
rsvpUserIds?: RsvpUserResponses;
extraData: any;
}
export declare type RsvpUsersState = PaginatedCollection<number>;
export interface RsvpUserLists {
/** List of interested users, if loaded */
interested: RsvpUsersState | null;
/** List of attending users, if loaded */
accepted: RsvpUsersState | null;
/** List of declining users, if loaded */
declined: RsvpUsersState | null;
}
export declare function newRsvpUserLists(): RsvpUserLists;
export interface EventState {
/** The event */
event: Event | null;
/** The current users response */
currentUserRsvp: RSVPStatus;
/** Rsvp responses */
rsvpUserLists: RsvpUserLists;
}
export declare function newEventState(event?: Event | null, currentUserRsvp?: RSVPStatus | null, rsvpUserLists?: RsvpUserLists | null): EventState;
export interface EventContextState {
[eventId: number]: EventState;
}
export interface EventsState {
[context: string]: EventContextState;
}
export declare const events: (S: any, A: any) => EventsState;
export default events;
//# sourceMappingURL=eventReducer.d.ts.map