UNPKG

2.03 kBTypeScriptView Raw
1import { ICommentInfo, IComment, ILikedByInformation } from "./types.js";
2import { IItemUpdateResult } from "../items/index.js";
3declare module "../clientside-pages/types" {
4 interface _ClientsidePage {
5 addComment(info: string | ICommentInfo): Promise<IComment & ICommentInfo>;
6 getCommentById(id: string | number): Promise<IComment & ICommentInfo>;
7 clearComments(): Promise<boolean>;
8 getComments(): Promise<ICommentInfo[]>;
9 like(): Promise<void>;
10 unlike(): Promise<void>;
11 getLikedByInformation(): Promise<ILikedByInformation>;
12 enableComments(): Promise<IItemUpdateResult>;
13 disableComments(): Promise<IItemUpdateResult>;
14 setCommentsOn(on: boolean): Promise<IItemUpdateResult>;
15 }
16 interface IClientsidePage {
17 /**
18 * Adds a comment to this page
19 *
20 * @param info The comment information
21 */
22 addComment(info: string | Partial<ICommentInfo>): Promise<IComment & ICommentInfo>;
23 /**
24 *
25 * @param id gets a comment by id
26 */
27 getCommentById(id: string | number): Promise<IComment & ICommentInfo>;
28 /**
29 * Deletes all comments for this page
30 */
31 clearComments(): Promise<boolean>;
32 /**
33 * Gets all the comments for this page
34 */
35 getComments(): Promise<ICommentInfo[]>;
36 /**
37 * Like this page
38 */
39 like(): Promise<void>;
40 /**
41 * Unlike this page
42 */
43 unlike(): Promise<void>;
44 /**
45 * gets list of who likes the page, current user's status, a few other details
46 */
47 getLikedByInformation(): Promise<ILikedByInformation>;
48 /**
49 * Enables comments for this page
50 */
51 enableComments(): Promise<IItemUpdateResult>;
52 /**
53 * Disables comments for this page
54 */
55 disableComments(): Promise<IItemUpdateResult>;
56 }
57}
58//# sourceMappingURL=clientside-page.d.ts.map
\No newline at end of file