import { RuleExpression } from '../core/index.js'; import { RecordFilter, SavedViewRow } from '../core/index.js'; export { i as isRuleFilter } from '../subscription-DSnIFqdB.js'; import { RecordsClient } from '../core/index.js'; import { Uuid, RecordsResult } from '../core/index.js'; export { r as readersTimeZone, s as setReadersTimeZone } from '../relativeDays-CFZpGUdI.js'; import '../relation-B00lR6BX.js'; import '../ports-uIDHLgZN.js'; import '../field-IlJ97y8H.js'; import '../doors-DZzgZBEf.js'; import '../pickListDoors-DcCN4k-W.js'; import '../portal-CHEQEjS7.js'; import '../table-kind/index.js'; /** A view's look as the store keeps it: one JSON object under `definition.presentation`. */ type ViewPresentationDocument = Record; /** * HOW A VIEW'S LOOK IS READ AND WRITTEN โ€” a PORT. The store keeps the look as one JSON object; what it * means (colors, formats, frozen columns) belongs to the screens that draw it, so the screens hand their * codec in (`@ai-matrx/records-ui` binds its grid presentation). Left out, the look stays the plain * document the store keeps โ€” a headless host reads and writes it untouched. */ interface ViewPresentationCodec

{ parse(raw: unknown): P; isEmpty(presentation: P): boolean; /** The look as the JSON object the store keeps. */ toDocument(presentation: P): Record; } /** The look as the plain JSON document the store keeps (no screen's meaning applied). */ declare const plainPresentation: ViewPresentationCodec; /** Every surface a saved view is drawn by. */ type ViewKeyLayout = "grid" | "kanban" | "calendar" | "gallery" | "timeline" | "list" | "chart" | "map" | "orgchart" | "pivot" | "swipe"; /** * ๐Ÿšฉ THE ONE SWITCH FOR THE TIMELINE'S STORE KEYS (lane VIEWS-AND-FIELDS, sublane TL). * * `vk_a_calendar_keeps_where_a_record_ends_and_a_timeline_is_a_view.sql` (sublane VK) teaches * `custom.view_keys()` the layout `timeline`, the keys `start_field` and `end_field` (calendar + * timeline), and `group_field` for the timeline. Until that migration is on production this stays * `false`, and: * ยท `timeline` is not a layout the store keeps (`STORE_KEPT_LAYOUTS`), so it is drawn for the visit; * ยท `start_field` / `end_field` are held for the visit, never sent (`viewSettingsPatch`), and the * Start also rides `date_field`, which the store already keeps; * ยท the timeline's toolbar says "Kept for this visit only". * Flipped to `true`, VIEW_KEYS below mirrors the migrated registry row for row (the live walk * compares them) and every one of those is kept on the view. */ declare const STORE_KEEPS_TIMELINE = true; /** * ๐Ÿšฉ THE ONE SWITCH FOR THE SWIPE DECK'S STORE KEYS (2026-10-22). The swipe layout (a table asked one * record at a time, `answer_field` written by each answer, `condition_field` deciding when a card is * asked). `custom.view_keys()` and `custom._view_key_value('kind')` admit it (applied to Matrx Main * 2026-10-22), so it is `true`: the layout and its two keys are kept on the view. Turned `false`, the * layout is drawn for the visit and its keys are held for the visit, as the timeline once was. */ declare const STORE_KEEPS_SWIPE = true; /** Who may write a key: anyone who may save the view, an input the door rewrites, or the server only. */ type ViewKeyWriter = "caller" | "input" | "server"; interface ViewKeyDeclaration { /** Where it lives in `platform.saved_view.definition` (dotted under `presentation`). */ path: string; /** What the store's guard checks (`custom._view_key_value`). */ shape: string; /** The layouts that read it. */ layouts: readonly ViewKeyLayout[]; writer: ViewKeyWriter; } /** * THE REGISTRY, as `custom.view_keys()` declares it (uichamp_s1_a_view_keeps_every_setting_it_is_given.sql). * Order and content are compared with the store by the live walk. */ declare const VIEW_KEYS: readonly ViewKeyDeclaration[]; /** * THE LAYOUTS THE STORE KEEPS ON A VIEW. `custom.view_keys()` judges a view's `layout` against its * own list (grid, kanban, calendar, gallery) and refuses any other word by name. A layout this * package draws before the store keeps it โ€” the timeline, 2026-10-02 โ€” is never sent as a view's or a * look's layout (`viewSettingsPatch`, `viewDocument`): it is drawn for this visit and says so. When the * store's registry admits it, add it here and nothing else changes. */ declare const STORE_KEPT_LAYOUTS: readonly string[]; /** Whether the store keeps this layout on a saved view. */ declare function storeKeepsLayout(layout: string): boolean; /** The keys one layout reads, by path. */ declare function viewKeysFor(layout: ViewKeyLayout): string[]; /** One sort clause: a Field key and a direction. */ interface ViewSortKey { field: string; direction: "asc" | "desc"; } /** * EVERY DECLARED KEY OF A VIEW, TYPED. Absent keys are `null` / empty, never guessed. * `presentation` is the parsed look (color field, pinned fields, row height, grouping with its * sub-groups and shut sections, hidden fields, gallery size, summaries). */ interface ViewSettings

{ layout: "grid" | "kanban" | "calendar" | "gallery" | "timeline" | "list" | "chart" | "map" | "orgchart" | "pivot" | "swipe"; filters: RecordFilter | null; where: RuleExpression | null; groupField: string | null; swimlaneField: string | null; collapsedColumns: string[]; measure: string | null; /** Chart: how it draws (`chart_kind`): bar, line, donut, area, pie, stacked or scatter. */ chartKind: string | null; /** Chart: what it measures per group (`chart_measure`): count, sum or avg. */ chartMeasure: string | null; /** Pivot: the Field whose values are the columns; chart: the Field whose values are a stacked bar's series (`column_field`). */ columnField: string | null; /** Pivot: what each cell measures (`pivot_measure`): count, sum, avg, min or max. */ pivotMeasure: string | null; /** Scatter chart: the number Field along the bottom (`x_field`). */ xField: string | null; dateField: string | null; /** Timeline: where a record's bar starts (`start_field`). */ startField: string | null; /** Calendar and timeline: where a record ends (`end_field`). */ endField: string | null; imageField: string | null; /** Map: the address, place or latitude Field that puts a record on the map (`map_field`). */ mapField: string | null; /** Map: the longitude Field, when `mapField` is a latitude Field (`map_lng_field`). */ mapLngField: string | null; /** Org chart: the link Field to the same table that says who a record reports to (`parent_field`). */ parentField: string | null; /** Swipe: the Field each answer is written to (`answer_field`). */ answerField: string | null; /** Swipe: the Field holding when a card is asked (`condition_field`). */ conditionField: string | null; sorts: ViewSortKey[]; ruleId: string | null; isDefault: boolean; /** Personal: only the person who made the view lists it. False = collaborative (everyone with the table). */ personal: boolean; /** The named section of the view list this view sits under, or null. */ section: string | null; /** Where the view sits in the view list among its section's views (lowest first), or null = unplaced. */ position: number | null; presentation: P; movedFrom: Record | null; } /** THE READER. A stored `definition` (and the row's flat `filters`) in, every declared key out. */ declare function viewSettings

(definition: Record | null | undefined, rowFilters?: RecordFilter | null, codec?: ViewPresentationCodec

): ViewSettings

; /** The settings as the spec names them โ€” what `viewSettingsPatch` takes. */ type ViewSettingsPatch

= Partial, "movedFrom" | "layout">> & { /** Any layout the package draws; one the store does not keep is not sent. */ layout?: string; }; /** * THE KEYS ONE LAYOUT READS, and nothing else. A layout that does not use a key never sees it: * a calendar is not told the board's swimlanes, a board is not told the grid's pinned fields. */ declare function viewSettingsFor

(settings: ViewSettings

, layout: ViewKeyLayout): Partial>; /** * THE WRITER'S SHAPE. Only the keys a press changed; a cleared Field is `null` (the door removes * it); lists are sent whole. `presentation` is sent whole because the door judges it as one key. */ declare function viewSettingsPatch

(patch: ViewSettingsPatch

, codec?: ViewPresentationCodec

): Record; /** The ways one saved view can be looked at (SCR-6; the timeline, lane VIEWS-AND-FIELDS TL). */ declare const VIEW_LAYOUTS: readonly ["grid", "kanban", "calendar", "gallery", "timeline", "list", "chart", "map", "orgchart", "pivot", "swipe"]; type ViewLayout = (typeof VIEW_LAYOUTS)[number]; declare const LAYOUT_LABEL: Record; /** * โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ * WHAT EACH LAYOUT NEEDS FROM THE TABLE, AND HOW THE SCREEN SUPPLIES IT * (lane DATA-V2-VIEWS-1, Arman 2026-09-28). * * THE DEFECT. A plain table opened as a Kanban said "A kanban board needs a Field to make its * columns from โ€ฆ Add column, then Select โ€” and it appears here." It told the person what to do * instead of doing it, and on an AI platform it offered no AI. The ruling: ONE primitive, used by * every view (`ViewNeeds`) โ€” the empty state says in one plain sentence what is missing and what * pressing will do, offers "Make it work" (the column is declared through the store's * `custom.field_declare`, its key minted by the store, its name and choices editable before the * press) and "Ask AI" (the agent does it through the same door, held for the person's approval by * the organization's "Agent changes to this organization's data" setting). * * THE CENSUS โ€” every layout this package draws, and what it reads: * ยท grid nothing. * ยท kanban a CHOICE column (its options become the board's columns). Blocking. * ยท calendar a DATE column (it places each record on a day). Blocking. * ยท gallery a FILE column for the card's picture. NOT blocking: the cards draw without one, * so the offer sits above them instead of in place of them. * ยท timeline a DATE column each bar starts on (the calendar's `dateField`). Blocking. * `PAGE_VIEWS`' two extra values (dashboards, archived) read * nothing a table can lack. This package ships no map layout; the day it does, * `Record` below refuses to compile until the new layout names what it needs. */ type ViewNeedKind = "choice" | "date" | "file"; interface ViewNeed { /** What the layout reads, as a kind a column declares (`offerableFields`). */ kind: ViewNeedKind; /** The view key the made column is written onto, so the layout opens drawn by it. */ viewKey: "groupField" | "dateField" | "imageField"; /** True when the layout cannot draw at all without it (kanban, calendar). */ blocking: boolean; /** The column the press makes, before the person edits it: its name, the store's word, its choices. */ starter: { label: string; type: "select" | "datetime" | "attachment"; options?: readonly string[]; }; /** The table HAS columns this layout can use and none is chosen: the sentence over the picker. */ pick: string; /** One plain sentence: what the table is missing (all a person who may not change it is told). */ missing: string; /** One plain sentence: what pressing Make it work will do, with the column's name. */ does: (label: string) => string; /** The sentence an agent is asked with โ€” the same act, said in words. */ ask: (label: string, options: readonly string[]) => string; } /** A list of words as a person says it: "To do, In progress and Done". */ declare function wordsList(words: readonly string[]): string; declare const VIEW_NEEDS: Record; /** * A NAME NO COLUMN OF THIS TABLE ALREADY HAS: the starter's own, else "Status 2", "Status 3"โ€ฆ * A table that already holds a text column called Status must not be refused the board. */ declare function freeColumnName(wanted: string, taken: readonly string[]): string; /** One sort clause. The Field's key and a direction; nothing else is a sort. */ interface ViewSort { field: string; direction: "asc" | "desc"; } /** How a saved view is ordered: by hand, by its sort, or it never said (the same as sorted). */ type ViewOrder = "manual" | "sorted" | null; /** The order word a stored definition carries. Only the two words the store writes are read. */ declare function viewOrderOf(definition: Record | null | undefined): ViewOrder; /** * THE DECLARATIVE SPEC. An agent writes this whole object; a person tweaks it. * Every builder component in this package takes one of these as a prop. */ interface SavedViewSpec

{ name: string; /** The Table this view looks at. */ subject: Uuid; layout: ViewLayout; /** Kanban: the Field whose value becomes a column. */ groupField?: string | null; /** * Kanban: a number Field to TOTAL under each column heading. It lives on the VIEW for * the same reason the colors do โ€” two people read one board two ways and neither * reading is a fact about the records. */ measure?: string | null; /** Chart: how it draws: bar, line, donut, area, pie, stacked or scatter (`chart_kind`). */ chartKind?: string | null; /** Chart: what it measures per group, `count`, `sum` or `avg` (`chart_measure`). */ chartMeasure?: string | null; /** Pivot: the Field whose values are the columns; chart: a stacked bar's series (`column_field`). */ columnField?: string | null; /** Pivot: what each cell measures: count, sum, avg, min or max (`pivot_measure`). */ pivotMeasure?: string | null; /** Scatter chart: the number Field along the bottom (`x_field`). */ xField?: string | null; /** * Kanban: the Field whose values cut the board into SWIMLANES across the columns โ€” a * dispatcher's board by Status, one lane per Technician (S1-PRIME VIEW-KEYS). Never the * column Field itself; the store refuses that. */ swimlaneField?: string | null; /** Kanban: the columns this view keeps shut to a strip, by the column's stored value. */ collapsedColumns?: string[]; /** Calendar: the Field that places a record in the month. */ dateField?: string | null; /** Timeline: the Field a record's bar starts on (`start_field`). */ startField?: string | null; /** Calendar and timeline: the Field a record ends on (`end_field`). */ endField?: string | null; /** Gallery: the Field shown large on the card. */ imageField?: string | null; /** Map: the address, place or latitude Field that puts a record on the map (`map_field`). */ mapField?: string | null; /** Map: the longitude Field when `mapField` is a latitude Field (`map_lng_field`). */ mapLngField?: string | null; /** Org chart: the link Field (to this same table) that says who a record reports to (`parent_field`). */ parentField?: string | null; /** Swipe: the Field each answer is written to; a choice column's options are the answers (`answer_field`). */ answerField?: string | null; /** Swipe: the Field holding when a card is asked โ€” a condition over earlier cards (`condition_field`). */ conditionField?: string | null; sorts?: ViewSort[]; /** * HOW THE VIEW IS ORDERED (ORDER-FIX): `"manual"` โ€” the positions a person set by hand ARE the * view's sort, and it carries no `sorts`; `"sorted"` or null โ€” by `sorts`. READ ONLY: the store * writes "manual" only when the rows are placed (`custom.view_record_order_set`) and turns it * off itself when a sort is saved, so no patch ever sends it (`viewSettingsPatch` does not). */ order?: ViewOrder; /** * The membership Rule. The STORE decides who is in this view; this is a * reference to its Rule record, never a predicate this package evaluates. */ ruleId?: Uuid | null; /** * THE FLAT FILTER a digest or a notify rule wrote the view with โ€” the one shape * `custom.record_filter_sql` compiles, by Field KEY. A view saved in the bar has * none; a view saved by `DigestScheduler` ("where Status is Open") does, and the * grid and the board show exactly the records it names. */ filters?: RecordFilter; /** * S2-PRIME โ€” THE VIEW'S OWN QUESTION, as the condition builder writes it: the store's Rule * shape `{op, args}`, ALL / ANY / NOT groups nested to any depth, Fields by id. Kept in the * definition as `where` and asked of the store unchanged โ€” the grid's list door, the board's * headings and the dashboard's numbers compile it into the one WHERE clause * (`custom.record_filter_sql`). Never stored under `filters`: that key is the flat map the * digests and the notifier read, and they would refuse it by name. */ where?: RuleExpression | null; isDefault?: boolean; /** PERSONAL (Airtable): only the person who made the view lists it. Absent/false = collaborative. */ personal?: boolean; /** The named section of the view list this view sits under (VIEWS-AIRTABLE). Null/absent = unsectioned. */ section?: string | null; /** Where the view sits in the view list among its section's views, lowest first (VIEWS-AIRTABLE). */ position?: number | null; /** * HOW THIS VIEW LOOKS โ€” its colors, its per-column formats and its frozen * column (`presentation.ts`). * * It lives on the VIEW and not on the Fields because two people read one * table two ways and neither reading is a fact about the records; it lives on * a RECORD, not a new column, because that is what makes it something an * agent writes with the same `records` tool as everything else. */ presentation?: P; } /** * A saved view as it comes back out of the store, with its row's own id. * * It carries no version: `custom.view_declare` MERGES one key at a time, so two * tabs pressing two different controls on one view both stand, and one control * pressed in both keeps the latest โ€” how Airtable and Notion keep a view change. */ interface SavedView

extends SavedViewSpec

{ id: Uuid; /** Where the view came from when it was moved in (the mover, the S0 repair), else null. */ movedFrom: Record | null; } /** THE TABLE'S DEFAULT VIEW: the first view that says it is. */ declare function defaultViewOf>(views: readonly V[]): V | undefined; /** * WHICH FIELD EACH LAYOUT CAN BE DRAWN FROM, decided from the FIELD'S OWN * DECLARATION and never from the values it happens to hold. * * A kanban makes columns from a choice: the Field whose value is one of a * closed set (FLD-5 / FLD-6 โ€” a pick-list is a Table, and a select stores the * id of one of its records). Grouping by a free-text Field produces one column * per record, which is not a board. A calendar places a record in time, so it * needs a Field that holds a date. * * These two answers are here, beside the layouts, because the picker on the * screen and any agent writing a view spec must agree about what is offerable. */ declare const LAYOUT_FIELD_KIND: Record; /** * โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ * WHICH VIEW A LINK NAMES โ€” the address bar as a first-class control. * * ๐Ÿšจ THE DEFECT THIS CLOSES (lane FRONT-DOOR, 2026-09-21; VERIFIER-8 HIGH-2). * `/data/?view=kanban` returned 200 and rendered THE GRID. The * switcher was there, the four buttons worked, and the parameter was read by * nobody โ€” so a person who bookmarked a board, or sent one to a colleague, got * a grid, and nothing on the screen said the view had been dropped. A link that * does not land is the inbox-link defect (`activeRecordId`) and the dashboard * defect (`activeDashboardId`) for the third time, so this is the same shape of * fix: the URL names it, the page opens on it, and the URL FOLLOWS the person * when they pick another. * * The dashboards are a fifth value and not a special case: to the person, "the * dashboard" is one of the ways to look at this table, and a link to it has to * work like a link to the board. */ /** * ๐Ÿšจ `archived` IS THE SIXTH VALUE, AND IT IS NOT A SPECIAL CASE EITHER (lane * FIX-10A-ARCHIVE, 2026-09-22; VERIFIER-10 F4). * * Archiving a record used to be a ONE-WAY DOOR: the grid's row action soft- * deletes correctly โ€” `deleted_at` set, version bumped, nothing removed โ€” and * then no screen anywhere in the platform could bring it back. The store's * `custom.record_restore` was there the whole time and did exactly the right * thing; nothing reached it, because every read door answers live rows only. * * So the archive is a WAY OF LOOKING AT THIS TABLE, like the board and the * dashboards, reached by the same row of buttons and named by the same * `?view=` parameter โ€” never a Trash area of the app somebody has to know * exists, and never a per-table screen. Every Table inherits it the moment it * is in this list. */ declare const PAGE_VIEWS: readonly ["grid", "kanban", "calendar", "gallery", "timeline", "list", "chart", "map", "orgchart", "pivot", "swipe", "dashboards", "archived"]; type PageView = (typeof PAGE_VIEWS)[number]; declare const PAGE_VIEW_LABEL: Record; /** * What a `?view=` value means, or `null` when it means nothing here. * * `null` is NOT "show the grid": the caller is expected to say that the link * named something this table has no view for, because silently substituting a * different view is exactly the defect above wearing a parser. */ declare function pageViewFromParam(raw: string | null | undefined): PageView | null; /** The sentence a link that named a view nobody has says. Never silent. */ declare function unknownViewLine(raw: string): string; /** * THE SPEC AS THE ONE DEFINITION `platform.saved_view` HOLDS โ€” the keys * `custom.view_declare` documents, by Field KEY. `subject` is not in it: the door * takes the Table as its own argument and writes `table_id` itself. */ declare function viewDocument

(spec: SavedViewSpec

, codec?: ViewPresentationCodec

): Record; /** * One row of `custom.views` back into the spec a screen and an agent both read โ€” THROUGH THE ONE * ACCESSOR (`viewSettings`, viewKeys.ts), so every layout sees every declared key the same way. */ declare function viewFromRow

(row: SavedViewRow, codec?: ViewPresentationCodec

): SavedView

; /** * SAVE ONE NEW VIEW of a Table โ€” the bar's "New view" and an agent's seed spec. * One `view_declare` with no `view_id`; the answer is the new view's id. */ declare function declareView

(client: Pick, spec: SavedViewSpec

, codec?: ViewPresentationCodec

): Promise>; /** * WRITE A CHANGE ONTO A SAVED VIEW, AND KEEP IT. * * `custom.view_declare` with the view's id MERGES: only the keys in `patch` are * written, a key cleared to null is removed, and everything the patch did not * name โ€” the grid's own choices, a hand-set order, where the view was moved from, * a color set in another tab โ€” stays exactly as it was (S0, 2026-09-23: the door * used to rebuild the whole definition from what one press sent). * * There is no version to be stale against (VERIFIER-15 M4 is closed by the shape, * not by a retry): a saved view is a person's own arrangement of a table, and * their latest press on a control is the one that stands. A refusal โ€” the view * was removed, or belongs to a table this person cannot open โ€” is handed back for * the page to say through the one notice. */ declare function saveViewPatch

(client: Pick, tableId: Uuid, viewId: Uuid, patch: Partial>, codec?: ViewPresentationCodec

): Promise>; /** * A PARTIAL change to a saved view, as the definition keys the door merges. Only * the keys the caller actually changed are sent; a Field cleared (a board with no * "Group by") is sent as `null`, which the door removes. */ declare function viewPatchDocument

(patch: Partial>, codec?: ViewPresentationCodec

): Record; /** * A LOOK AT A TABLE NEVER CHANGES HOW IT OPENS (lane VIEW-SWITCH-NOT-DESIGNATION, VERIFIER-21). * * On production the owner pressed Kanban, then Calendar, and the office member's table opened in * the Calendar: every layout press was saved onto the DEFAULT view, which is how the table opens * for everyone. The table's default view's `layout` and `isDefault` are its DESIGNATION, changed * only by an editor's deliberate "Make this the default" (`designateView`); the store refuses them * through `view_declare` by name. So a press on the default view carries every other key it * changed โ€” a board's grouping, a calendar's date, a color โ€” and never those two. */ declare function viewPatchFor(view: { isDefault?: boolean; }, patch: Partial): Partial; /** The one words for the explicit designation, with the layout it would make the default. */ declare function makeDefaultLabel(layoutLabel: string): string; /** * MAKE THIS THE DEFAULT โ€” the ONE designation door (`custom.view_designate`, editor on the table). * `layout` is the layout this table should open in for everyone: one of the layouts the store keeps. The view * becomes the table's only default. */ declare function designateView(client: Pick, tableId: Uuid, viewId: Uuid, layout: string | null): Promise>; /** A section of the view list with the views under it, in the list's order. `name` null = unsectioned. */ interface ViewSection = SavedView> { name: string | null; views: V[]; } /** * THE VIEW LIST, GROUPED. Unsectioned views come first (the table's default among them), then each * section in the order its first view appears. A section exists while a view is in it. */ declare function groupViewsBySection & { position?: number | null; }>(views: readonly V[]): ViewSection[]; /** The names of the sections the list has, in order. */ declare function sectionNames(views: readonly Pick[]): string[]; /** Whether a section name is one the store keeps: 1 to 60 characters after trimming. */ declare function sectionNameOk(raw: string): boolean; /** * RENAME OR DELETE A SECTION: one `view_declare` per view under it. `to` null deletes the section (its * views go back to the unsectioned list; no view is archived). Stops at the first refusal and hands it back. */ declare function reassignSection(client: Pick, tableId: Uuid, views: readonly Pick[], from: string, to: string | null): Promise>; /** One write of a drag: the view, and the keys that change (`section` null = out of every section). */ interface ViewDropWrite { id: Uuid; section?: string | null; position: number; } /** The droppable id of a section's empty space (the end of its list); "" is the unsectioned list. */ declare const sectionDropId: (name: string | null) => string; /** * WHAT DROPPING A VIEW WRITES. `overId` is a view (it takes that view's place) or a section's space * (`sectionDropId`; it goes to the end of that section). Every view in the target section is given its * place 0..n-1 so the list stays what the person saw; only views whose place or section changed are written. * Pure: the bar sends each write through `saveViewPatch`. */ declare function planViewDrop & { position?: number | null; }>(views: readonly V[], activeId: string, overId: string): ViewDropWrite[]; /** * WHAT A LOOK MAY HOLD โ€” how a person looks, never what the view is: not its name, not whether it is the default, * not its Rule, not the flat filters the digests read, not the order the store writes. */ type ViewLook

= Partial, "layout" | "groupField" | "swimlaneField" | "collapsedColumns" | "measure" | "dateField" | "startField" | "endField" | "imageField" | "mapField" | "mapLngField" | "parentField" | "answerField" | "conditionField" | "sorts" | "where" | "presentation">>; /** Only the look's own keys of a press โ€” a name, a default, a Rule or an order is never a look. */ declare function lookPart

(patch: Partial>): ViewLook

; /** The look as the definition keys the store keeps (`view_look_set`); a cleared key is null. */ declare function lookDocument

(look: ViewLook

, codec?: ViewPresentationCodec

): Record; /** A kept look back into the spec's words. Only the keys it holds; a null key is "none, for me". */ declare function lookFromDocument

(doc: Record | null | undefined, codec?: ViewPresentationCodec

): ViewLook

; /** THE VIEW AS THIS PERSON SEES IT: the saved view, with her look laid over it. */ declare function applyLook

(view: SavedView

, look: ViewLook

| null | undefined): SavedView

; /** Whether the look shows anything the view does not โ€” which is when "Save to view" means something. */ declare function lookDiffers

(view: SavedView

, look: ViewLook

| null | undefined): boolean; /** * WHAT "SAVE TO VIEW" SENDS, and what stays the person's own afterwards. The default view's layout is the table's * designation (`viewPatchFor`): it is never saved here, so a look's layout on the default view stays her look. */ declare function saveToViewPlan

(view: SavedView

, look: ViewLook

): { patch: Partial>; left: ViewLook

| null; }; /** The caller's own looks at every view of a table, by view id. */ declare function readLooks

(client: Pick, tableId: Uuid, codec?: ViewPresentationCodec

): Promise>>>; /** Keep the whole look (null: "Reset to view"). The shared view is never written. */ declare function keepLook

(client: Pick, tableId: Uuid, viewId: Uuid, look: ViewLook

| null, codec?: ViewPresentationCodec

): Promise | null>>; /** Every door of a saved view and a person's look, with the host's presentation codec bound. */ declare function bindViewCodec

(codec: ViewPresentationCodec

): { viewSettings: (definition: Record | null | undefined, rowFilters?: RecordFilter | null) => ViewSettings

; viewSettingsPatch: (patch: ViewSettingsPatch

) => Record; viewDocument: (spec: SavedViewSpec

) => Record; viewFromRow: (row: SavedViewRow) => SavedView

; declareView: (client: Pick, spec: SavedViewSpec

) => Promise>; saveViewPatch: (client: Pick, tableId: Uuid, viewId: Uuid, patch: Partial>) => Promise>; viewPatchDocument: (patch: Partial>) => Record; lookDocument: (look: ViewLook

) => Record; lookFromDocument: (doc: Record | null | undefined) => Partial, "layout" | "where" | "groupField" | "swimlaneField" | "collapsedColumns" | "measure" | "dateField" | "startField" | "endField" | "imageField" | "mapField" | "mapLngField" | "parentField" | "answerField" | "conditionField" | "sorts" | "presentation">>; readLooks: (client: Pick, tableId: Uuid) => Promise, "layout" | "where" | "groupField" | "swimlaneField" | "collapsedColumns" | "measure" | "dateField" | "startField" | "endField" | "imageField" | "mapField" | "mapLngField" | "parentField" | "answerField" | "conditionField" | "sorts" | "presentation">>>>>; keepLook: (client: Pick, tableId: Uuid, viewId: Uuid, look: ViewLook

| null) => Promise | null>>; }; export { LAYOUT_FIELD_KIND, LAYOUT_LABEL, PAGE_VIEWS, PAGE_VIEW_LABEL, STORE_KEEPS_SWIPE, STORE_KEEPS_TIMELINE, STORE_KEPT_LAYOUTS, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NEEDS, applyLook, bindViewCodec, declareView, defaultViewOf, designateView, freeColumnName, groupViewsBySection, keepLook, lookDiffers, lookDocument, lookFromDocument, lookPart, makeDefaultLabel, pageViewFromParam, plainPresentation, planViewDrop, readLooks, reassignSection, saveToViewPlan, saveViewPatch, sectionDropId, sectionNameOk, sectionNames, storeKeepsLayout, unknownViewLine, viewDocument, viewFromRow, viewKeysFor, viewOrderOf, viewPatchDocument, viewPatchFor, viewSettings, viewSettingsFor, viewSettingsPatch, wordsList }; export type { PageView, SavedView, SavedViewSpec, ViewDropWrite, ViewKeyDeclaration, ViewKeyLayout, ViewKeyWriter, ViewLayout, ViewLook, ViewNeed, ViewNeedKind, ViewOrder, ViewPresentationCodec, ViewPresentationDocument, ViewSection, ViewSettings, ViewSettingsPatch, ViewSort, ViewSortKey };