Skip to content

Commit

Permalink
Improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed May 13, 2024
1 parent 249d86e commit adf56e2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/dataviews/src/view-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* External dependencies
*/
import clsx from 'clsx';
// Import CompositeStore type, which is not exported from @wordpress/components.
// eslint-disable-next-line no-restricted-imports
import type { CompositeStore } from '@ariakit/react';

/**
* WordPress dependencies
Expand Down Expand Up @@ -40,15 +43,14 @@ import { ActionsDropdownMenuGroup, ActionModal } from './item-actions';

interface Action {
callback: ( items: Item[] ) => void;
hideModalHeader: any;
icon: any;
id: string;
isDestructive: boolean | undefined;
isEligible: any;
isPrimary: boolean;
isEligible: ( item: Item ) => boolean | undefined;
isPrimary: boolean | undefined;
label: string;
modalHeader: string;
RenderModal: any;
RenderModal: ( props: any ) => JSX.Element;
}

interface ListViewProps {
Expand All @@ -71,7 +73,7 @@ interface ListViewItemProps {
mediaField?: NormalizedField;
onSelect: ( item: Item ) => void;
primaryField?: NormalizedField;
store: any;
store: CompositeStore;
visibleFields: NormalizedField[];
}

Expand Down Expand Up @@ -281,7 +283,7 @@ function ListItem( {
className="dataviews-all-actions-button"
onKeyDown={ ( event: {
key: string;
preventDefault: () => any;
preventDefault: () => void;
} ) => {
if (
event.key ===
Expand Down

0 comments on commit adf56e2

Please sign in to comment.