TinyBase logoTinyBase β

Cell

The Cell type is the data structure representing the data in a single cell.

string | number | boolean | null | AnyObject | AnyArray

A Cell is used when setting a cell with the setCell method, and when getting it back out again with the getCell method. A Cell is a JavaScript string, number, boolean, or null (since v7.0), or a plain JavaScript object or array (since v8.0).

Object and array contents should recursively be strings, finite numbers, booleans, null, plain objects, or arrays. TinyBase validates the top-level container and then uses JSON serialization, so other nested values can be changed or omitted. If the value cannot be serialized, the Cell is invalid and the write is ignored silently.

String Cells must not start with the Unicode replacement character U+FFFD, which TinyBase reserves for its internal object and array encoding, or be the exact Unicode object replacement character U+FFFC, which TinyBase reserves to represent undefined in serialized data.

Example

import type {Cell} from 'tinybase';

export const cell: Cell = 'dog';

Since

v1.0.0