comments.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930
  1. import { BaseCollection } from "./base_collection";
  2. import { Comment } from "../models/comment";
  3. import { PaginatedResult } from "../interfaces/paginated_result";
  4. import { ProjectWithPagination } from "../interfaces/project_with_pagination";
  5. import { ProjectOnly } from "../interfaces/project_only";
  6. interface ParamsWithPagination extends ProjectWithPagination {
  7. key_id: number | string;
  8. }
  9. interface ProjectAndKey extends ProjectOnly {
  10. key_id: number | string;
  11. }
  12. type CommentData = {
  13. comment: string;
  14. };
  15. type CommentDeleted = {
  16. project_id: string;
  17. comment_deleted: boolean;
  18. };
  19. export declare class Comments extends BaseCollection {
  20. protected static rootElementName: string;
  21. protected static rootElementNameSingular: string;
  22. protected static prefixURI: string;
  23. protected static elementClass: typeof Comment;
  24. list(request_params: ParamsWithPagination): Promise<PaginatedResult<Comment>>;
  25. create(comment_params: CommentData | CommentData[], request_params: ProjectAndKey): Promise<Comment[]>;
  26. get(comment_id: string | number, request_params: ProjectAndKey): Promise<Comment>;
  27. delete(comment_id: string | number, request_params: ProjectAndKey): Promise<CommentDeleted>;
  28. list_project_comments(params: ProjectWithPagination): Promise<PaginatedResult<Comment>>;
  29. }
  30. export {};