CodelabDocs
Core conceptsData

Types and schemas

Data in Codelab.

Fields, interfaces, and schemas

A field has a name and type. An interface is a list of fields. A schema names an interface for reuse within an app.

Types

Types describe the values a field accepts.

TypeKindShapeDescription
Type.Texttext{ kind, flavor? }String. flavor is "inline" or "rich".
Type.Numbernumber{ kind }Number.
Type.Booleanboolean{ kind }Boolean.
Type.Datedate{ kind }Date.
Type.Filefile{ kind, accept? }File value { fileId, name?, format? }. accept is a MIME glob (image/*, video/*).
Type.Objectobject{ kind, fields }Nested record. fields is a field list. Holds a value of a shape.
Type.Arrayarray{ kind, item }List. item is any nested type.
Type.Refref{ kind, refId }An app schema.
Type.Andand{ kind, operands }Intersection. Last operand wins on the same field name.
Type.Oror{ kind, operands }Type-level union (string | string[] | void). No stored discriminator.
Type.OneOfoneof{ kind } plus field discriminator / variantsForm toggle-group: named variants, each with fields. Distinct from or.
Type.Elementelement{ kind }{ elementId }. A ref to a node in the tree.
Type.Componentcomponent{ kind }{ componentId, instanceProps? }.
Type.Functionfunction{ kind, params?, returns?, async?, identity? }A callable. The value is a function call { functionId, instanceParams?, when? }.
Type.RenderProprenderprop{ kind, params }The element's children are the callback body; declared params bind as {{render.<name>}}. Return is rendered, not consumed as a value.
Type.Voidvoid{ kind }Nothing. Only meaningful as a callable's returns. Distinct from omitted returns (undeclared).
Type.Interfaceinterface{ kind }The value is a field list (a shape). Object holds a value of a shape; Interface holds the shape.

On this page