decent-sdk
Version:
SDK for the Decent API
47 lines (46 loc) • 2.24 kB
TypeScript
import { Comment } from '../types/Discussion';
import { GetAllCommentsParams, CreateCommentParams, UpdateCommentParams, DeleteCommentParams } from './common/params';
/**
* Fetches all comments for a specific proposal.
* @param params - The parameters for fetching comments.
* @param params.chainId - The ID of the chain.
* @param params.address - The address of the DAO.
* @param params.slug - The slug of the proposal.
* @param params.apiUrl - Optional API URL override.
* @returns {Promise<Comment[]>} A promise with an array of comments.
*/
export declare const getAllComments: (params: GetAllCommentsParams) => Promise<Comment[]>;
/**
* Creates a new comment for a specific proposal.
* @param params - The parameters for creating a comment.
* @param params.chainId - The ID of the chain.
* @param params.address - The address of the DAO.
* @param params.slug - The slug of the proposal.
* @param params.comment - The new comment data.
* @param params.apiUrl - Optional API URL override.
* @returns {Promise<Comment>} A promise with the created comment.
*/
export declare const createComment: (params: CreateCommentParams) => Promise<Comment>;
/**
* Updates an existing comment.
* @param params - The parameters for updating a comment.
* @param params.chainId - The ID of the chain.
* @param params.address - The address of the DAO.
* @param params.slug - The slug of the proposal.
* @param params.commentId - The ID of the comment to update.
* @param params.comment - The updated comment data.
* @param params.apiUrl - Optional API URL override.
* @returns {Promise<Comment>} A promise with the updated comment.
*/
export declare const updateComment: (params: UpdateCommentParams) => Promise<Comment>;
/**
* Deletes a comment.
* @param params - The parameters for deleting a comment.
* @param params.chainId - The ID of the chain.
* @param params.address - The address of the DAO.
* @param params.slug - The slug of the proposal.
* @param params.commentId - The ID of the comment to delete.
* @param params.apiUrl - Optional API URL override.
* @returns {Promise<Comment>} A promise with the deleted comment.
*/
export declare const deleteComment: (params: DeleteCommentParams) => Promise<void>;