Référence de l’API

ICellData

Cette page API est actuellement disponible en anglais. Les signatures et identifiants restent identiques dans toutes les langues.

The stored content and formatting of one cell. Use v for plain values, f for formulas, p for rich text, and s for styles. Pass cell data to FRange.setValue or setValues.

TypeScript
import type { ICellData } from '@univerjs/core'import { CellValueType } from '@univerjs/core'const amount: ICellData = { v: 42, t: CellValueType.NUMBER }const formula: ICellData = { f: '=SUM(A1:A5)' }const label: ICellData = { v: '00123', t: CellValueType.FORCE_STRING }

Import

TypeScript
import type { ICellData } from '@univerjs/core'

Definition

TypeScript
interface ICellData {  p?: Nullable<IDocumentData>  s?: Nullable<IStyleData | string>  v?: Nullable<CellValue>  t?: Nullable<CellValueType>  f?: Nullable<string>  ft?: Nullable<FormulaType>  fd?: Nullable<BooleanNumber>  ref?: Nullable<string>  xf?: Nullable<string>  si?: Nullable<string>  custom?: CustomData}

Fields

p

Optional · Nullable<IDocumentData>

Rich text stored as a document snapshot. Plain values use v instead.

s

Optional · Nullable<string | IStyleData>

An inline cell style or a style ID from IWorkbookData.styles.

v

Optional · Nullable<CellValue>

The plain cell value: a string, number, or boolean. Use null to clear the value.

t

Optional · Nullable<CellValueType>

The value type. Univer normally infers it; use CellValueType.FORCE_STRING to keep numeric-looking text as text.

f

Optional · Nullable<string>

A formula beginning with =, such as =SUM(A1:B4).

ft

Optional · Nullable<FormulaType>

Formula type, mapped from OOXML f@t. Omission preserves existing runtime behavior.

fd

Optional · Nullable<BooleanNumber>

Dynamic array flag, mapped from the referenced dynamicArrayProperties@fDynamic metadata.

ref

Optional · Nullable<string>

If the formula is a formula array, this field is used to store the referencing range.

xf

Optional · Nullable<string>

New Excel formulas need to add prefixes for differentiation, e.g., _xlfn._xlws. _xlfn. _xlws. _xludf.

si

Optional · Nullable<string>

Id of the formula.

custom

Optional · CustomData

User stored custom fields.

Package: @univerjs/core · Type definitions

Que pensez-vous de ce guide ?

© 2026 DreamNum Co., Ltd.