@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
61 lines (60 loc) • 1.86 kB
TypeScript
import { CommentThread } from '../AdaptableState/CommentState';
import { AdaptableComment, CellAddress } from '../types';
/**
* Provides run-time access to Comment Module and related State
*/
export interface CommentApi {
/**
* Add a Comment to a Comment Thread
*
* @param comment comment
* @param cellAddress cell where comment is added
*/
addComment(commentText: string, cellAddress: CellAddress): void;
/**
* Edit a Comment
*
* @param comment Comment to edit
* @param cellAddress Location of the comment, if not provided all comments will be traversed to find the comment
*/
editComment(comment: AdaptableComment, cellAddress?: CellAddress): void;
/**
* Delete a Comment
* @param address Location of the comment, if not provided all comments will be traversed to find the comment
*/
deleteComment(comment: AdaptableComment, cellAddress: CellAddress): void;
/**
* Create a new Comment Thread
*
* @param commentThread
*/
addCommentThread(commentThread: CommentThread): void;
/**
* Delete all Comments for a particular cell
* @param cellAddress
*/
deleteCommentThread(cellAddress: CellAddress): void;
/**
* Return the Comment Thread for a particular cell
* @param cellAddress
*/
getCommentThreadForCell(cellAddress: CellAddress): CommentThread | undefined;
/**
* Return all Comment Threads in the grid
*/
getAllComments(): CommentThread[];
/**
* Sets the Comment Threads in the grid
*
* @param commentThreads new cell comments
*/
setComments(commentThreads: CommentThread[]): void;
/**
* Clear all Comment Threads in the grid
*/
clearComments(): void;
/**
* Close the Comment Popup
*/
hideCommentsPopup(): void;
}