Appearance
Home > @liquidrazor/list-display > UseListCoreResult
UseListCoreResult interface
Contract returned by useListCore(). It aggregates the current list state as well as callbacks to mutate filters, sorting, pagination, and selection. Action-oriented handlers are also exposed to keep the UI layer thin and declarative.
Signature:
typescript
export interface UseListCoreResult<TRow = any, TRowId extends RowId = RowId>Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
() => void | Cancels the currently active action modal. | ||
() => void | Clears all selections regardless of mode. | ||
(payload?: unknown) => Promise<void> | Confirms the currently active action modal. | ||
() => ListSnapshot<TRow, TRowId> | Exports the current state into a serializable snapshot. | ||
Array<FieldSchema<TRow>> | Field schema definitions used to interpret rows. | ||
Array<GeneralAction<TRow, TRowId>> | (Optional) General actions configured for the list. | ||
() => Promise<void> | Refreshes the data source and recomputes derived state. | ||
Array<RowAction<TRow, TRowId>> | (Optional) Row-level actions configured for the list. | ||
() => void | Selects all rows currently visible in the paginated slice. | ||
(updater: (prev: ListState<TRow>["filters"]) => ListState<TRow>["filters"]) => void | Updates the active filters map. | ||
(pageIndex: number) => void | Moves to the specified page index. | ||
(pageSize: number) => void | Updates the number of rows per page. | ||
(sort: ListState<TRow>["sort"] | undefined) => void | Sets the active sort descriptor. | ||
ListState<TRow> | Latest list state produced by the hook. | ||
(actionId: string) => Promise<void> | Triggers the handler for a general action by id. | ||
(actionId: string, rowIndex: number) => Promise<void> | Triggers the handler for a row action by id and row index. |