import type {SearchParams} from "./searchParams.ts"; export type BreadcrumbItem = { label: string; url?: string; }; export type Option = { value: string; label: string; }; export type HeaderModel = { title: string; breadcrumb: BreadcrumbItem[]; homeUrl?: string; }; export type StatusModel = { isLoading: boolean; error: unknown; successMessage?: string; }; export type SearchModel = { totalItems: number; searchParams: TSearchParams; onChange: (params: TSearchParams) => void; searchOptions?: Option[]; pageSizeOptions?: Option[]; }; export type PaginationModel = { totalItems: number; totalPages: number; currentPage: number; size: number; onPageChange: (pageIndex: number) => void; }; export type TableCheckModel = { isAllChecked: boolean; isPartiallyChecked: boolean; isChecked: (id: TId) => boolean; onCheck: (id: TId, checked: boolean) => void; onCheckAll: (checked: boolean) => void; }; export type TablePaginationModel = Pick< PaginationModel, "totalItems" | "currentPage" | "totalPages" >; export type ListTableModel = { items: TItem[]; params: TSearchParams; onChange: (params: TSearchParams) => void; pagination: TablePaginationModel; }; export type CheckableTableModel< TItem, TSearchParams extends SearchParams, TId extends string | number = string > = ListTableModel & { check: TableCheckModel; }; export type RowActionsModel = { rowActions: TActions; }; export type ListActionsModel = { disabled?: boolean; onDelete?: () => void | Promise; onCreate?: () => void; }; export type FormActionsModel = { mode: TMode; disabled?: boolean; onCreate?: () => void | Promise; onUpdate?: () => void | Promise; onDelete?: () => void | Promise; onList?: () => void; };