export function createSampleDiscussionContextValue({ t, isModerator, actions, userWaitUntil }: { t: any; isModerator?: boolean; actions?: {}; userWaitUntil?: any; }): { /** * Moderator users have elevated priviledges, they can for example unpublish * any comment. */ isModerator: boolean; /** * The Discussion object, straight from the GraphQL server. */ discussion: { id: string; title: string; /** * This controls whether long comments can be collapsed. */ collapsable: boolean; /** * The display author is optional, only provided if the user is * logged in. */ displayAuthor: { name: string; profilePicture: string; }; /** * ISO 8601 string. If set then the user must wait until that time before * they can write another comment. */ userWaitUntil: any; rules: { maxLength: any; }; tags: any[]; tagRequired: boolean; }; /** * The ID of the comment that should be highlighted. It is optional. */ highlightedCommentId: string; /** * All the actions the user can do. These functions correspond mostly * to GraphQL mutations, though some are implemented purely in the * client-side JavaScript code. * * To allow them to be asynchronous, they all return a promise. Upon success * the promise resolves with `{ ok: true }`. Otherwise the promise resolves * with `{ error: string }`. The promise must not reject. */ actions: { /** * Submit a new comment to the discussion. The parent comment can be null, * in which case a new top-level comment will be created. Otherwise it'll * be a reply to the given comment. */ submitComment: (parent: any, text: any, tags: any) => Promise<{ ok: boolean; }>; editComment: (comment: any, content: any, tags: any) => Promise<{ ok: boolean; }>; upvoteComment: (comment: any) => Promise<{ ok: boolean; }>; downvoteComment: (comment: any) => Promise<{ ok: boolean; }>; unvoteComment: (comment: any) => Promise<{ ok: boolean; }>; unpublishComment: (comment: any) => Promise<{ ok: boolean; }>; /** * Fetch more comments. */ fetchMoreComments: ({ parentId, after, appendAfter }: { parentId: any; after: any; appendAfter: any; }) => Promise<{ ok: boolean; }>; shareComment: (commentId: any) => Promise<{ ok: boolean; }>; openDiscussionPreferences: () => Promise<{ ok: boolean; }>; }; /** * The current time, isDesktop and a translate function for timeahead, timeago and timeduration. */ clock: { isDesktop: boolean; t: any; }; /** * When components need to create links to other parts of the website, they can use this component. */ CommentLink: ({ displayAuthor, discussion, comment, passHref, ...props }: { [x: string]: any; displayAuthor: any; discussion: any; comment: any; passHref: any; }) => JSX.Element; /** * Array of functions run while typing in the comment box. Hints are rendered above secondary * actions slot of the composer. */ composerHints: any[]; /** * React Element that will be placed into the secondary actions slot of the * composer. Can be null to not show anything. */ composerSecondaryActions: any; };