gristlabs_grist-core/app/plugin/GristData.ts
Alex Hall a64fb105e3 (core) Use GristObjCode in CellValue
Summary: Makes type checking a bit stronger

Test Plan: it just has to compile

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3065
2021-10-11 14:11:32 +02:00

23 lines
564 B
TypeScript

// Letter codes for CellValue types encoded as [code, args...] tuples.
export const enum GristObjCode {
List = 'L',
Dict = 'O',
DateTime = 'D',
Date = 'd',
Skip = 'S',
Censored = 'C',
Reference = 'R',
ReferenceList = 'r',
Exception = 'E',
Pending = 'P',
Unmarshallable = 'U',
Versions = 'V',
}
export type CellValue = number|string|boolean|null|[GristObjCode, ...unknown[]];
export interface RowRecord {
id: number;
[colId: string]: CellValue;
}