UNPKG

2.86 kBTypeScriptView Raw
1import { _SPCollection, _SPInstance } from "../spqueryable.js";
2export declare class _Comments extends _SPCollection<ICommentInfo[]> {
3 /**
4 * Adds a new comment to this collection
5 *
6 * @param info Comment information to add
7 */
8 add(info: string | ICommentInfo): Promise<IComment & ICommentInfo>;
9 /**
10 * Gets a comment by id
11 *
12 * @param id Id of the comment to load
13 */
14 getById(id: string | number): IComment;
15 /**
16 * Deletes all the comments in this collection
17 */
18 clear(): Promise<boolean>;
19}
20export interface IComments extends _Comments {
21}
22export declare const Comments: import("../spqueryable.js").ISPInvokableFactory<IComments>;
23export declare class _Comment extends _SPInstance<ICommentInfo> {
24 /**
25 * A comment's replies
26 */
27 get replies(): IReplies;
28 /**
29 * Likes the comment as the current user
30 */
31 like(): Promise<void>;
32 /**
33 * Unlikes the comment as the current user
34 */
35 unlike(): Promise<void>;
36 /**
37 * Deletes this comment
38 */
39 delete(): Promise<void>;
40}
41export interface IComment extends _Comment {
42}
43export declare const Comment: import("../spqueryable.js").ISPInvokableFactory<IComment>;
44export declare class _Replies extends _SPCollection<ICommentInfo[]> {
45 /**
46 * Adds a new reply to this collection
47 *
48 * @param info Comment information to add
49 */
50 add(info: string | Partial<ICommentInfo>): Promise<IComment & ICommentInfo>;
51}
52export interface IReplies extends _Replies {
53}
54export declare const Replies: import("../spqueryable.js").ISPInvokableFactory<IReplies>;
55/**
56 * Defines the information for a comment author
57 */
58export interface ICommentAuthorData {
59 email: string;
60 id: number;
61 isActive: boolean;
62 isExternal: boolean;
63 jobTitle: string | null;
64 loginName: string;
65 name: string;
66 principalType: number;
67 userId: any | null;
68}
69/**
70 * Defines the information for a comment
71 */
72export interface ICommentInfo {
73 author: ICommentAuthorData;
74 createdDate: string;
75 id: string;
76 isLikedByUser: boolean;
77 isReply: boolean;
78 itemId: number;
79 likeCount: number;
80 listId: string;
81 mentions: [
82 {
83 loginName: string;
84 email: string;
85 name: string;
86 }
87 ] | null;
88 parentId: string;
89 replyCount: number;
90 text: string;
91}
92export interface ILikeData {
93 name: string;
94 loginName: string;
95 id: number;
96 email: string;
97 creationDate: string;
98}
99export interface ILikedByInformation {
100 likedBy: {
101 creationDate: string;
102 email: string;
103 id: number;
104 loginName: string;
105 name: string;
106 }[];
107 isLikedByUser: boolean;
108 likeCount: number;
109}
110export declare type RatingValues = 1 | 2 | 3 | 4 | 5;
111//# sourceMappingURL=types.d.ts.map
\No newline at end of file