UNPKG

react-playmakers

Version:

React wrapper providing utilities for PlayMakers integration

42 lines (41 loc) 1.8 kB
import { CommentExtendedType, CommentStateEnum, CommentType } from "../types"; type CommentFetchMethod = (quiet?: boolean) => Promise<CommentType>; type CommentCreateMethod = (submissionId: string, body: string, state?: CommentStateEnum) => Promise<CommentType>; type CommentCreateStudioMethod = (submissionId: string, body: string) => Promise<CommentType>; type CommentDeleteMethod = (id: string) => Promise<void>; type CommentEditMethod = (body: string) => Promise<CommentType>; type CommentHideMethod = (body: string) => Promise<CommentType>; interface UseCommentReturn extends Partial<CommentType> { comment: CommentType | null; fetched: boolean; refresh: CommentFetchMethod; createApproveComment: CommentCreateStudioMethod; createComment: CommentCreateMethod; createRejectComment: CommentCreateStudioMethod; deleteComment: CommentDeleteMethod; editComment: CommentEditMethod; hideComment: CommentHideMethod; moderateComment: Function; commentBody: string; commentId: string; commentOwnerId: string; commentState: string; } export declare const useComment: (commentId?: string) => UseCommentReturn; type CommentsFetchMethod = (quiet?: boolean) => Promise<CommentExtendedType[]>; type CommentsFetchMoreMethod = (refresh?: boolean) => Promise<void>; interface UseCommentsReturn { comments: CommentExtendedType[]; fetched: boolean; hasMore: boolean; fetchMore: CommentsFetchMoreMethod; refresh: CommentsFetchMethod; currentPage?: number; } export declare const useCommentsByOwner: (id: string, params: { [key: string]: any; }) => UseCommentsReturn; export declare const useCommentsBySubmission: (id: string, params: { [key: string]: any; }) => UseCommentsReturn; export {};