Skip to content

Commit

Permalink
feat(docs): add examples for new permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alotor committed Sep 24, 2024
1 parent 1c1f6f3 commit 2df4999
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/create-angular-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Next, create a `manifest.json` file inside the `/src/assets` directory. This fil
"code": "/assets/plugin.js",
"icon": "/assets/icon.png",
"permissions": [
"content:read",
"content:write",
"library:read",
"library:write",
"user:read"
"user:read",
"comment:read",
"allow:downloads"
]
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/create-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Next, create a `manifest.json` file inside the `/public` directory. This file is
"code": "/plugin.js",
"icon": "/icon.png",
"permissions": [
"content:read",
"content:write",
"library:read",
"library:write",
"user:read"
"user:read",
"comment:read",
"allow:downloads"
]
}
```
Expand Down
9 changes: 8 additions & 1 deletion libs/plugin-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ export interface Comment {

/**
* Remove the current comment from its comment thread. Only the owner can remove their comments.
* Requires the `comment:write` permission.
*/
remove(): void;
}
Expand Down Expand Up @@ -535,18 +536,21 @@ export interface CommentThread {

/**
* List of `comments` ordered by creation date.
* Requires the `comment:read` o `comment:write` permission.
*/
findComments(): Promise<Comment[]>;

/**
* Creates a new comment after the last one in the thread. The current user will
* be used as the creation user.
* Requires the `comment:write` permission.
*/
reply(content: string): Promise<Comment>;

/**
* Removes the current comment thread. Only the user that created the thread can
* remove it.
* Requires the `comment:write` permission.
*/
remove(): void;
}
Expand Down Expand Up @@ -2840,11 +2844,13 @@ export interface Page extends PluginData {
* Creates a new comment thread in the `position`. Optionaly adds
* it into the `board`.
* Returns the thread created.
* Requires the `comment:write` permission.
*/
addCommentThread(content: string, position: Point): Promise<CommentThread>;

/**
* Removes the comment thread.
* Requires the `comment:read` or `comment:write` permission.
*/
removeCommentThread(commentThread: CommentThread): Promise<void>;

Expand All @@ -2854,8 +2860,9 @@ export interface Page extends PluginData {
* user has engaged.
* - `showResolved`: by default resolved comments will be hidden. If `true`
* the resolved will be returned.
* Requires the `comment:read` or `comment:write` permission.
*/
findCommentThreads(criteria: {
findCommentThreads(criteria?: {
onlyYours: boolean;
showResolved: boolean;
}): Promise<CommentThread[]>;
Expand Down

0 comments on commit 2df4999

Please sign in to comment.