UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

85 lines 3.21 kB
import * as forumApi from './index'; import { ForumThreadEntry, ListThreadsResult } from './index'; import * as api from '../api'; import { Thunk, XcapJsonResult } from '../api'; import { ForumThreadActions } from './forumThreadReducer'; import { PaginatedCollection } from '../api/PaginatedCollection'; export interface EditForumThread { subject: string; text: string; categoryId?: Array<number>; forumThreadPermalink?: any; forumPermalink: string; isAI: boolean; } export declare function editForumThread({ subject, text, categoryId, forumThreadPermalink, forumPermalink, isAI }: EditForumThread): Thunk<Promise<XcapJsonResult | { error: string; }>>; export interface FetchForumThreads { forumPermalink: string; pageSize?: number; page?: number; } /** * Requests and receive forumThreads and store them in redux-state */ export declare function fetchForumThreads({ forumPermalink, page, pageSize }: FetchForumThreads): Thunk<Promise<ListThreadsResult | { error: string; }>>; export interface FetchForumThreadEntries { forumPermalink: string; forumThreadPermalink: string; entryId?: number; pageSize?: number; p?: number; } /** * Requests and receive forumThreads and store them in redux-state * if entryId is specified we fetch the page that this entry is located on */ export declare function fetchForumThreadEntries({ forumPermalink, forumThreadPermalink, entryId, pageSize, p }: FetchForumThreadEntries): Thunk<Promise<PaginatedCollection<ForumThreadEntry> | { error: string; }>>; export declare function requestForumThreads(): ForumThreadActions; export declare function receiveForumThreads({ entries, forumPermalink, pageSize }: { entries: Array<forumApi.ForumThreadEntry>; forumPermalink: string; pageSize: number; }): ForumThreadActions; export declare function updateForumThreadEntry({ entry, forumPermalink }: { entry: forumApi.ForumThreadEntry; forumPermalink: string; }): ForumThreadActions; /** * Requests and receive comments and store them in redux-state */ export declare function rateForumThreadEntry({ forumThreadEntry, score }: { /**1 for thumbs down, 2 for thumbs up*/ score: number; /**Id of the forum thread entry to be liked, can also be a forumEntry*/ forumThreadEntry: forumApi.ForumThreadEntry; }): Thunk<any>; export declare function receiveVoteForumThread({ voteJson, forumPermalink }: { voteJson: forumApi.VoteReturn; forumPermalink: string; }): ForumThreadActions; export interface LikeForumThreadEntry { referenceId: number; likedByCurrentUser: boolean; context: string; } export declare function likeForumThreadEntry({ referenceId, likedByCurrentUser, context }: LikeForumThreadEntry): Thunk<any>; export interface ReceiveLikeForumThreadEntry { receivedLikes: any; referenceId: number; forumPermalink: string; } export interface DeleteForumThreadEntry { forumThreadEntryId: number; modalName: string; } /** * Delete forum thread entries and update state */ export declare function deleteForumThreadEntry({ forumThreadEntryId, modalName }: DeleteForumThreadEntry): api.Thunk<void>; //# sourceMappingURL=forumThreadActions.d.ts.map