Skip to content

Commit 30fcc29

Browse files
committed
add type for actions
1 parent 49a1434 commit 30fcc29

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

adminforth/types/Back.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,19 @@ interface AdminForthInputConfigCustomization {
720720
}
721721
}
722722

723+
export interface AdminForthActionInput {
724+
name: string,
725+
action: (params: {
726+
resource: AdminForthResource,
727+
recordId: string,
728+
adminUser: AdminUser,
729+
extra?: HttpExtra,
730+
tr: Function,
731+
}) => Promise<{ok: boolean, error?: string}>,
732+
icon?: string,
733+
id?: string,
734+
}
735+
723736

724737
export interface AdminForthResourceInput extends Omit<AdminForthResourceInputCommon, 'columns' | 'hooks' | 'options'> {
725738

@@ -1124,6 +1137,8 @@ export interface ResourceOptionsInput extends Omit<AdminForthResourceCommon['opt
11241137
*/
11251138
bulkActions?: Array<AdminForthBulkAction>,
11261139

1140+
actions?: Array<AdminForthActionInput>,
1141+
11271142
/**
11281143
* Allowed actions for resource.
11291144
*

0 commit comments

Comments
 (0)