TinyBase logoTinyBase

ValuesSchema

The ValuesSchema type describes the keyed Values that can be set in a Store and their types.

{[valueId: Id]: ValueSchema}

A ValuesSchema comprises a JavaScript object describing each Value and its ValueSchema. It is provided to the setValuesSchema method.

Example

When applied to a Store, this ValuesSchema only allows one boolean Value called open, that defaults to false.

import type {ValuesSchema} from 'tinybase';

export const valuesSchema: ValuesSchema = {
  open: {type: 'boolean', default: false},
};

Since

v3.0.0