Changes a value's settings as one step to undo: its function, then how it is shown, then its
number format, then its caption. What settings leaves out stays.
Stops listening to the table, whoever still subscribes.
The table the model works.
The table as the field list shows it now.
Puts a chip, or a field from the list, in an area at index (counted from 0 among the area's
chips, the values' slot among them); absent, after the last.
Takes a chip off the table: a field off its axis, a value deleted. The values' slot deletes every value, as Excel's does.
Renames a chip: a field, a value, or the values' slot.
Changes what a value computes; a caption the table made follows it, as Excel's does.
Calls listener after each change to the table; returns the call that stops it. The model
listens to the table's sheet while anything listens to it.
Ticks a field in the list: a field of numbers goes to the values, as a Sum; any other to the rows, after the last (IPivotTable.IField.getDataType). Nothing for a field already ticked.
Unticks a field in the list: it comes off its axis and every value summarizing it goes.
A pivot table's field list as a user works it, with no UI: what each field is and where it sits, the four areas in order, and one method per gesture (DESIGN-PIVOT-UI ยง3). A view renders getSnapshot and calls the gestures; it hears every change, the table's own and those made by script, undo or another view, through subscribe.
Remarks
Reads and writes through the public IPivotTable only, so the same model drives a task pane beside a sheet and a pivot widget with no grid. Each gesture is one step to undo, two calls included, and gestures run one after another in the order they are asked for. A refused gesture rejects with the table's error and changes nothing.
While anything subscribes, the snapshot is the same object until the table changes, as
useSyncExternalStoreneeds; otherwise each call reads the table afresh.