import { ViewType } from './ViewSwitcher'; import { ListViewSchema } from '@object-ui/types'; /** * ObjectUI * Copyright (c) 2024-present ObjectStack Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import * as React from 'react'; export interface ListViewProps { schema: ListViewSchema; className?: string; onViewChange?: (view: ViewType) => void; onFilterChange?: (filters: any) => void; onSortChange?: (sort: any) => void; onSearchChange?: (search: string) => void; /** Called when the user toggles fields via the Hide Fields popover. */ onHiddenFieldsChange?: (hidden: string[]) => void; /** Called when the user resizes/reorders columns in the underlying grid. */ onColumnStateChange?: (state: { order?: string[]; widths?: Record; }) => void; /** Callback when a row/item is clicked (overrides NavigationConfig) */ onRowClick?: (record: Record) => void; /** Show view type switcher (Grid/Kanban/etc). Default: false (view type is fixed) */ showViewSwitcher?: boolean; /** Initial user-filter selections to restore (field → values; `_tab` for the active preset). */ userFilterSelections?: Record>; /** Fires with the raw user-filter selections whenever the user changes them. */ onUserFilterSelectionsChange?: (selections: Record>) => void; [key: string]: any; } /** * Normalize a single filter condition: convert `in`/`not in` operators * into backend-compatible `or`/`and` of equality conditions. * E.g., ['status', 'in', ['a','b']] → ['or', ['status','=','a'], ['status','=','b']] */ export declare function normalizeFilterCondition(condition: any[]): any[]; /** * Normalize an array of filter conditions, expanding `in`/`not in` operators * and ensuring consistent AST structure. */ export declare function normalizeFilters(filters: any[]): any[]; /** * Evaluate conditional formatting rules against a record. * Returns a CSSProperties object for the first matching rule, or empty object. * Supports both field/operator/value rules and expression-based rules. * * Exported for use by child view renderers (e.g., ObjectGrid) and consumers * who need to evaluate formatting rules outside the ListView component. */ export declare function evaluateConditionalFormatting(record: Record, rules?: ListViewSchema['conditionalFormatting']): React.CSSProperties; /** * Imperative handle exposed by ListView via React.forwardRef. * Allows parent components to trigger a data refresh programmatically. * * @example * ```tsx * const listRef = React.useRef(null); * * // After a mutation: * listRef.current?.refresh(); * ``` */ export interface ListViewHandle { /** Force the ListView to re-fetch data from the DataSource */ refresh(): void; } export declare const ListView: React.ForwardRefExoticComponent & React.RefAttributes>; //# sourceMappingURL=ListView.d.ts.map