UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

54 lines 1.87 kB
import { Community } from './index'; import { PaginatedCollection } from '../api/PaginatedCollection'; import { ReceiveCommunities, ResourceUsage } from './communityAction'; export declare const KEY = "COMMUNITIES"; export declare const REQUEST_COMMUNITIES = "REQUEST_COMMUNITIES"; export declare const RECEIVE_COMMUNITIES = "RECEIVE_COMMUNITIES"; export declare const UPDATE_COMMUNITY = "UPDATE_COMMUNITY"; export declare const SET_COMMUNITY_SETTINGS = "SET_COMMUNITY_SETTINGS"; export declare const REMOVE_COMMUNITIES = "REMOVE_COMMUNITIES"; export declare const REMOVE_COMMUNITY = "REMOVE_COMMUNITY"; export declare const RECEIVE_RESOURCE_USAGE = "RECEIVE_RESOURCE_USAGE"; export interface CommunityState { /** * Current community, if any */ community?: Community | null; /** * List of users communities */ communities?: PaginatedCollection<Community>; resourceUsage?: ResourceUsage; isFetching?: boolean; didInvalidate?: boolean; lastUpdated?: number; /** * Number of objects requiring moderation */ objectsRequiringModeration: { [communityId: number]: number; }; } export declare type CommunityActions = { type: typeof REQUEST_COMMUNITIES; } | { type: typeof RECEIVE_COMMUNITIES; json: ReceiveCommunities; receivedAt: number; } | { type: typeof UPDATE_COMMUNITY; community: Community; receivedAt: number; } | { type: typeof SET_COMMUNITY_SETTINGS; community: Community | null | undefined; objectsRequiringModeration?: number; } | { type: typeof REMOVE_COMMUNITIES; } | { type: typeof REMOVE_COMMUNITY; } | (ResourceUsage & { type: typeof RECEIVE_RESOURCE_USAGE; }); export default function communityReducer(state: CommunityState | undefined, action: CommunityActions): CommunityState; //# sourceMappingURL=communityReducer.d.ts.map