mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) move home server into core
Summary: This moves enough server material into core to run a home server. The data engine is not yet incorporated (though in manual testing it works when ported). Test Plan: existing tests pass Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2552
This commit is contained in:
31
app/common/TabularDiff.ts
Normal file
31
app/common/TabularDiff.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
*
|
||||
* Types for use when summarizing differences between versions of a table, with the
|
||||
* diff itself presented in tabular form.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Pairs of before/after values of cells. Values, when present, are nested in a trivial
|
||||
* list since they can be literally anything - null, undefined, etc. Otherwise they
|
||||
* are either null, meaning non-existent, or "?", meaning unknown. Non-existent values
|
||||
* appear prior to a table/column being created, or after it has been destroyed.
|
||||
* Unknown values appear when they are omitted from summaries of bulk actions, and those
|
||||
* summaries are then merged with others.
|
||||
*/
|
||||
export type CellDelta = [[any]|"?"|null, [any]|"?"|null];
|
||||
|
||||
/** a special column indicating what changes happened on row (addition, update, removal) */
|
||||
export type RowChangeType = string;
|
||||
|
||||
/** differences for an individual table */
|
||||
export interface TabularDiff {
|
||||
header: string[]; /** labels for columns */
|
||||
cells: Array<[RowChangeType, number, CellDelta[]]>; // "number" is rowId
|
||||
}
|
||||
|
||||
/** differences for a collection of tables */
|
||||
export interface TabularDiffs {
|
||||
[tableId: string]: TabularDiff;
|
||||
}
|
||||
Reference in New Issue
Block a user