Cell Data
Defines the data model for a cell
export type CellData<
T extends StructuredResult = StructuredResult,
M extends Mention = Mention,
> = {
/**
* The value the user entered in the cell. e.g, 1234, "Hello", or
* "=NOW()". Dates, times, and datetimes are represented as doubles
* in serial format.
*/
ue?: ExtendedValue;
/**
* The effective value of the cell. For formula cells this is the
* calculated result; for literal cells it equals `ue`. Read-only —
* the calculation engine writes this. Set only when hydrating from
* a saved snapshot.
*/
ev?: ExtendedValue & StructuredValue<T>;
/**
* The formatted display string (after the number format is
* applied). Read-only.
*/
fv?: string;
/**
* The user-entered format. New writes are merged onto any existing
* format. Can be a full `CellFormat` or a `StyleReference` (a short
* `{ sid }` ref into the workbook's cellXfs registry) — the registry
* dedupes repeated formats.
*/
uf?: CellFormat | StyleReference;
/**
* Shared-strings key for cells whose value is interned in the
* workbook's shared-strings table. Always a string. Per-segment
* rich-text formatting (bold / italic / color / `@mention` chips)
* rides on the SharedStrings entry as `{ text, runs }`; see the
* [Rich text formatting](../features/rich-text-formatting.md)
* feature page.
*/
ss?: string;
/**
* Hyperlink target. Either a plain URL string or a structured value
* carrying the URL + display label + tooltip.
*/
hyperlink?: string | HyperlinkValue;
/**
* Data-validation rule attached to the cell. Inline rule object or
* an ID reference into the sheet-level validation registry.
*/
dataValidation?: DataValidationRule | DataValidationRuleRecord["id"];
/**
* Plain-text note (Excel "comment" — single-author, not threaded).
*/
note?: string;
/**
* Pointer into the threaded-comment store (Excel 2016+ replies and
* resolved state).
*/
commentThreadId?: string | number;
/**
* Citation reference (FILTER source attribution, etc.).
*/
citationId?: Citation["id"];
/**
* Cell-level protection flags. Only take effect when sheet protection
* is enabled. `locked` defaults to true in Excel, so this field is
* usually set to `{ locked: false }` to opt a cell OUT of protection.
*/
protection?: {
locked?: boolean;
hidden?: boolean;
};
/**
* Image URL — for cells whose value is an embedded image.
*/
imageUrl?: string;
/**
* Cell metadata marker — currently only "people" for mention chips.
*/
metaType?: "people";
/**
* Array-formula spill range in A1 notation ("B5:B20"). Only set on
* the anchor cell of an array formula; spilled cells in the range
* carry no `af`. Round-trips to / from <f t="array" ref="..."/> in
* xlsx.
*/
af?: string;
/**
* Conditional-formatting results keyed by rule ID. Written by the
* CF evaluator; consumers shouldn't set this directly.
*/
conditionalFormattingResultById?: Record<string, CustomFormulaResult>;
/**
* Result of a formula-based data-validation rule.
*/
dataValidationResult?: CustomFormulaResult;
/**
* Outline / pivot grouping markers used by the canvas to render
* expand-collapse chevrons.
*/
expandable?: boolean;
expanded?: boolean;
/**
* Pivot grouping key tuple for the cell.
*/
groupKeys?: string[];
childrenCount?: number;
/**
* Pivot table this cell belongs to.
*/
pivotId?: PivotTable["pivotId"];
/**
* Collaboration / sync metadata.
*/
version?: number;
updatedAt?: number;
// -------------------------------------------------------------------
// Long-form aliases — kept for backwards compatibility with older
// saved payloads. Prefer the short forms (`ue` / `ev` / `uf` / `fv`)
// for new writes.
// -------------------------------------------------------------------
/** @deprecated use `ue` */
userEnteredValue?: ExtendedValue;
/** @deprecated use `ev` */
effectiveValue?: ExtendedValue & StructuredValue<T>;
/** @deprecated use `fv` */
formattedValue?: string;
/** @deprecated use `uf` */
userEnteredFormat?: CellFormat | StyleReference;
};ev and ue
uf and the effective format
Using your own CellData object
Last updated