Skip to content

Commit

Permalink
fix(fileActions): improve typing and add silent actions
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Apr 19, 2023
1 parent 2114236 commit 8be3f21
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/fileAction.ts
Expand Up @@ -34,16 +34,18 @@ interface FileActionData {
enabled?: (files: Node[], view) => boolean
/**
* Function executed on single file action
* @returns true if the action was executed, false otherwise
* @returns true if the action was executed successfully,
* false otherwise and null if the action is silent/undefined.
* @throws Error if the action failed
*/
exec: (file: Node, view) => Promise<boolean>,
exec: (file: Node, view, dir: string) => Promise<boolean|null>,
/**
* Function executed on multiple files action
* @returns true if the action was executed, false otherwise
* @returns true if the action was executed successfully,
* false otherwise and null if the action is silent/undefined.
* @throws Error if the action failed
*/
execBatch?: (files: Node[], view) => Promise<boolean[]>
execBatch?: (files: Node[], view, dir: string) => Promise<(boolean|null)[]>
/** This action order in the list */
order?: number,
/** Make this action the default */
Expand Down

0 comments on commit 8be3f21

Please sign in to comment.