import { PlDataTableGridStateCore, PlDataTableStateV2CacheEntry, PlTableColumnIdJson, PTableSorting } from '@platforma-sdk/model'; /** The fields of a cache entry that the grid's state report determines. */ export type PlDataTableGridFields = Pick; /** * Read what a grid state report means for the entry of the source the grid * shows. The report itself is kept as it came, to restore the grid from; the * sorting and hidden columns the table is built with are taken out of it. * * AG Grid leaves out what carries no information — no `sort` while nothing is * sorted, no `columnVisibility` while every column is shown — so a missing part * means "cleared" once the user has set it before, and "untouched" otherwise. * Untouched sorting keeps the block's default; untouched visibility hides the * optional columns, which the grid does hide, so an untouched report names them. */ export declare function readGridReport(reported: PlDataTableGridStateCore, previous: undefined | Pick, defaultHiddenColIds: () => PlTableColumnIdJson[]): PlDataTableGridFields; /** * The state to restore the grid from: the stored report, with the user's * choices that a report leaves out spelled out. AG Grid omits a cleared sorting * and an all-shown column set from its reports; without them, a grid still * showing an older choice, such as one open in another view, would keep it and * report it back. */ export declare function createGridRestoreState(fields: PlDataTableGridFields): PlDataTableGridStateCore; /** AG Grid's sort model as table sorting; the least values are the NA ones when ascending. */ export declare function convertAgSortingToPTableSorting(sort: NonNullable): PTableSorting[]; /** * Whether the grid already shows everything the stored state asks for that it * could possibly show. * * The answer decides whether to destroy and rebuild the grid around the stored * state, so it must only ever ask for things a rebuild can deliver. Two kinds of * request cannot be delivered, and asking anyway is how this comparison became an * engine for endless rebuilds: * * - a field the stored state does not express. AG Grid always reports its whole * state, and a state saved while the grid had no columns carries no * `columnOrder` at all; demanding equality there asks the grid to unreport * something. * - an id the grid does not have. State outlives column sets — a sort on a * column a later run dropped, hidden ids saved against different columns — and * no rebuild brings those columns back. * * Both are dropped before comparing rather than guarded against afterwards. */ export declare function isStoredStateApplied(desired: PlDataTableGridStateCore, actual: PlDataTableGridStateCore, gridColIds: ReadonlySet): boolean; //# sourceMappingURL=grid-state.d.ts.map