1+ import type { FormResponse } from '../../../types' ;
12import type { StoreDescriptor } from '@wordpress/data' ;
23
34/**
@@ -14,7 +15,7 @@ export type QueryParams = {
1415/**
1516 * Store actions
1617 */
17- type Registry = {
18+ export type Registry = {
1819 dispatch : ( store : StoreDescriptor ) => {
1920 // Notices store actions
2021 createSuccessNotice : (
@@ -35,14 +36,14 @@ type Registry = {
3536 deleteEntityRecord : (
3637 kind : string ,
3738 name : string ,
38- recordId : string ,
39+ recordId : number ,
3940 query : Record < string , unknown > ,
4041 options ?: { throwOnError ?: boolean }
4142 ) => Promise < void > ;
4243 editEntityRecord : (
4344 kind : string ,
4445 name : string ,
45- recordId : string ,
46+ recordId : number ,
4647 edits : Record < string , unknown >
4748 ) => Promise < void > ;
4849
@@ -56,7 +57,7 @@ type Registry = {
5657 doBulkAction : ( ids : string [ ] , action : string ) => void ;
5758 invalidateFilters : ( ) => void ;
5859 invalidateCounts : ( ) => void ;
59- markRecordsAsInvalid : ( ids : string [ ] ) => void ;
60+ markRecordsAsInvalid : ( ids : number [ ] ) => void ;
6061 } ;
6162 select : ( store : StoreDescriptor ) => {
6263 // Dashboard store select actions
@@ -66,25 +67,18 @@ type Registry = {
6667 getEntityRecord : (
6768 kind : string ,
6869 name : string ,
69- recordId : string
70+ recordId : number
7071 ) => Record < string , unknown > | undefined ;
7172 } ;
7273} ;
7374
74- type Item = {
75- id : string ;
76- status : string ;
77- edit_form_url : string ;
78- is_unread : boolean ;
79- } ;
80-
8175export type Action = {
8276 id : string ;
8377 isPrimary : boolean ;
8478 icon : React . ReactNode ;
8579 label : string ;
8680 modalHeader ?: string ;
87- isEligible ?: ( item : Item ) => boolean ;
81+ isEligible ?: ( item : FormResponse ) => boolean ;
8882 supportsBulk ?: boolean ;
89- callback ?: ( items : Item [ ] , { registry } : { registry : Registry } ) => Promise < void > ;
83+ callback ?: ( items : FormResponse [ ] , { registry } : { registry : Registry } ) => Promise < void > ;
9084} ;
0 commit comments