import React, { ReactElement } from 'react'; import { EntityConfigAny, EntityModelType, RelationModelType } from './EntityModel'; import { BaseFilter } from './EntityModel'; export declare type EntityTableProps = { model?: EntityModelType; relation?: RelationModelType; fieldName?: string; canDeleteAll?: boolean; /** * Called to generate actions for an item in the table. The Delete action is provided imlicitly, other actions * via eg. buttons can be provided here * @param item */ actionGenerator?: (config: EntityConfigAny, item: ModelType) => ReactElement; }; /** * Common filter, sort and paging support for EntityModel based components. * * @param model * @param initialPageSize */ export declare function useEntityModel(model: EntityModelType, initialPageSize?: number): { page: number; setPage: React.Dispatch>; itemsFrom: number; itemsTo: number; filter: string; setFilter: React.Dispatch>; simpleFilters: BaseFilter[]; setSimpleFilters: React.Dispatch[]>>; sortField: string; setSortField: React.Dispatch>; sortDirection: "ascending" | "descending"; setSortDirection: React.Dispatch>; stringFields: any; numFields: any; updateSort: (field: string) => void; loadingOpacity: number; }; export declare function useLoadedItem(model: EntityModelType): { loadingOpacity: number; }; /** * Creates an entity listing, editing component based on a ViewConfig. * * This factory is used so that we can properly type the component with a ModelType * */ export declare function createEntityTable(defaultProps?: EntityTableProps | null): React.FC>; export declare type EntityTableType = ReturnType;