UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

152 lines 4.33 kB
import { XcapJsonResult, Thunk, XcapOptionalParameters } from '../api'; import { Request } from '../request'; /** * Xcap QNA API constants and methods. * * @since 2 mar 2017 */ /** * Community context used for QNA */ export declare const CONTEXT = "question"; /** * Permalink of the question forum */ export declare const QUESTION_FORUM_PERMALINK = "question"; export declare type ContentType = 'askQuestion' | 'tags' | 'searchSearchInput'; export declare enum QnaSearchType { All = "All", Trending = "Trending", Solved = "Solved", Answered = "Answered", Recent = "Recent", Posted = "Posted", Search = "search" } export declare const COMPONENT_NAME = "forum"; export declare function QnaTypeConverter(type: QnaSearchType): string; export declare function getQnaSearchSortOrders(): Array<string>; /** * returns the url to view the Qnas. */ export declare function getQnaUrl({ request, section, article }: { request: Request; section?: string; article?: string; }): string; /** * returns the url to Ask a question in the Qnas. */ export declare function getQnaAskUrl({ request }: { request: Request; }): string; /** * returns the url to view the Qnas. */ export declare function getQnaQuestionUrl({ request, permalink, absolute }: { request: Request; permalink: string; absolute?: boolean; }): string; /** * List trending questions * * @param p Page number (optional) * @param pageSize Page size (optional) * @returns {Promise} */ export declare function listTrendingQuestions({ p, pageSize }: { p: number; pageSize: number; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * List solved questions * * @param p Page number (optional) * @param pageSize Page size (optional) * @returns {Promise} */ export declare function listSolvedQuestions({ p, pageSize }: { p: number; pageSize: number; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * List answered questions * * @param p Page number (optional) * @param pageSize Page size (optional) */ export declare function listAnsweredQuestions({ p, pageSize }: { p: number; pageSize: number; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * List posted questions * * @param p Page number (optional) * @param pageSize Page size (optional) */ export declare function listPostedQuestions({ p, pageSize }: { p: number; pageSize: number; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * Get a question */ export declare function getQuestion({ id, forumThreadPermalink }: { id?: number; forumThreadPermalink?: string; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * Ask a question */ export declare function askQuestion({ subject, text, categoryId, recaptchaSolved, recpatchaAnswer, gamePermalink, entryId, forumThreadPermalink, forumPermalink }: { subject: string; text: string; categoryId?: Array<number>; recaptchaSolved?: boolean; recpatchaAnswer?: string; gamePermalink?: string; entryId?: string; forumThreadPermalink?: any; forumPermalink?: string; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * Submit an answer */ export declare function submitAnswer({ subject, text, categoryId, gamePermalink, entryId, forumThreadPermalink, forumPermalink }: { text: string; subject?: string; categoryId?: Array<number>; gamePermalink?: string; entryId?: number; forumThreadPermalink?: any; forumPermalink?: string; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * Solve question * * @param answerId {int} Id. */ export declare function solveQuestion({ answerId }: { answerId: number; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * Get question categories * @returns {Thunk.<*>} */ export declare function getCategories({}: XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; /** * Search */ export declare function search({ searchType, q, issue, p, pageSize, game }: { searchType: QnaSearchType; q: string; p?: number; pageSize?: number; issue?: string; platform?: number; game?: string; device?: string; } & XcapOptionalParameters): Thunk<Promise<XcapJsonResult>>; //# sourceMappingURL=index.d.ts.map