Skip to content

Commit 2356d0c

Browse files
committed
fix(actions): rename content to contents
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 55ae6a1 commit 2356d0c

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ For example:
2424
+ import { defaultRemoteURL } from '@nextcloud/files/dav'
2525
```
2626

27+
#### File Actions API changes
28+
The `FileAction` API has been changed to provide a more consistent
29+
set of context to the action handlers.
30+
We're now using destructuring objects for the context parameters.
31+
For example:
32+
33+
```diff
34+
type ActionContext = {
35+
nodes: Node[],
36+
view: View,
37+
folder: Folder,
38+
contents: Node[],
39+
}
40+
41+
- action.exec(view: View, folder: Folder, dir: string): Promise<boolean>
42+
+ action.exec({ nodes, view, folder, contents }): Promise<boolean>
43+
```
44+
45+
2746
## 4.0.0-beta.1 - 2025-11-27
2847
### 🐛 Fixed bugs
2948
* fix: actions type exports by @skjnldsv in https://github.com/nextcloud-libraries/nextcloud-files/pull/1381

lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type ActionContextBase = {
1313

1414
export type ActionContext = {
1515
folder: Folder,
16-
content: Node[],
16+
contents: Node[],
1717
} & ActionContextBase
1818

1919
export type ActionContextSingle = {

0 commit comments

Comments
 (0)