UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

86 lines 2.85 kB
import { XcapJsonErrors } from '../api'; import { BlogEntry, GetEntriesResult } from './index'; import { LikeDataMap } from '../like'; import { PaginatedCollection } from '../api/PaginatedCollection'; export declare const REQUEST_GROUP_BLOG_ENTRIES = "REQUEST_GROUP_BLOG_ENTRIES"; export declare const RECEIVE_GROUP_BLOG_ENTRIES = "RECEIVE_GROUP_BLOG_ENTRIES"; export declare const INVALIDATE_GROUP_BLOG_ENTRIES = "INVALIDATE_GROUP_BLOG_ENTRIES"; export declare const UPDATE_GROUP_BLOG_ENTRY = "UPDATE_GROUP_BLOG_ENTRY"; export declare const UPDATE_AUTH_BLOG = "UPDATE_AUTH_BLOG"; export declare type GroupBlogEntriesActions = Receive | Update | Request | Invalidate | UpdateAuthBlog; declare type BlogKey = string; export interface GroupBlogState { isFetching: boolean; didInvalidate: boolean; lastUpdated: number; error?: XcapJsonErrors; json: { resultPaginated: PaginatedCollection<BlogEntry>; likesByCurrentUser: any; likes: LikeDataMap; blogId: number; }; } export interface GroupBlogEntriesState { [blogKey: string]: GroupBlogState; } /** * Get the state for a given blogKey * @param groupBlogEntriesState * @param blogKey */ export declare function getGroupBlogState(groupBlogEntriesState: GroupBlogEntriesState, blogKey: string): GroupBlogState | null; /** * Get the blog entries * @param groupBlogEntriesState * @param blogKey */ export declare function getBlogEntries(groupBlogEntriesState: GroupBlogEntriesState, blogKey: string): PaginatedCollection<BlogEntry> | null; /** * Check if relevant blog entries exists in store * @param groupBlogEntriesState * @param blogKey * @param pageSize * @param p * @param categoryId */ export declare function hasBlogEntries(groupBlogEntriesState: GroupBlogEntriesState, blogKey: string, pageSize: number, p: number, categoryId?: number, goToBlogEntry?: string): boolean; interface Receive { type: typeof RECEIVE_GROUP_BLOG_ENTRIES; blogKey: BlogKey; receivedAt: number; json: GetEntriesResult; } export declare type UpdateBlogEntry = { blogId?: number; resultPaginated: { entries: Array<BlogEntry>; }; userRsvpStatuses?: any; likesByCurrentUser?: any; }; interface Update { type: typeof UPDATE_GROUP_BLOG_ENTRY; blogKey: BlogKey; receivedAt: number; json: UpdateBlogEntry; } interface Request { type: typeof REQUEST_GROUP_BLOG_ENTRIES; blogKey: BlogKey; } interface Invalidate { type: typeof INVALIDATE_GROUP_BLOG_ENTRIES; blogKey: BlogKey; } interface UpdateAuthBlog { type: typeof UPDATE_AUTH_BLOG; blogKey: BlogKey; } export declare const groupBlogEntries: (S: any, A: any) => { [x: string]: GroupBlogState | { didInvalidate: boolean; }; }; export default groupBlogEntries; //# sourceMappingURL=groupBlogEntriesReducer.d.ts.map