org.openappdefinition.core, version 0.2.0

The core catalog

Baseline controls and capabilities that every host is expected to understand: layout, content, input, action, data and freeform drawing controls, plus typed access to notifications, background timing, the network, files, device media, location, people, record collections, sharing and the clipboard.

This page is generated from catalogs/core/core.oadcatalog.json in the repository: 30 controls, 10 capabilities and 33 shared types, each described in the catalog’s own words. A definition names a control as core: followed by its name, after it names the catalog in uses; how catalogs and contracts work is in the Catalogs and Contracts chapter.

Controls#

The building blocks of a visual surface, and of a voice surface where they have a spoken form. The host draws each one; its look comes from the design system.

core:stack#

Arrange parts one after another, down the view or across it. The basic layout container; reach for it first.

Props

direction "vertical" | "horizontal" default "vertical"
vertical places children one below another; horizontal places them side by side. A horizontal stack that does not fit may wrap. In a horizontal stack the first child, when it is a text, a heading or a stack, takes the room the others leave, so the children after it sit at the trailing end, as a title with a button after it; children that one each repeats are laid out alike, the first among them too.
gap Spacing default "medium"
Space between children.
align "start" | "center" | "end" | "stretch" default "stretch"
How children line up across the stacking direction. stretch makes each child as wide (or tall) as the stack.

Children: many. Visual: full, children are shown in order along the direction. Voice: full, children are presented in order; direction and gap have no spoken form.

core:grid#

Arrange parts in equal columns, filling row by row. Use for dashboards and galleries. On narrow screens the host may use fewer columns.

Props

columns integer (at least 1, at most 6) default 2
How many columns the layout intends when there is room. The host reduces the count when space is short.
gap Spacing default "medium"
Space between cells.

Children: many. Visual: full, responsive collapse to fewer columns is up to the host. Voice: degraded, children are presented in reading order, row by row; the column structure is not spoken.

core:group#

A titled section that gathers related parts, such as the fields of an address or the figures for one month.

Props

title string
Section title, shown and announced before the contents.
description string optional
Optional sentence under the title explaining the section.
emphasis Emphasis default "medium"
How prominently the section stands apart from its surroundings.

Slots

actions
What a person can do with this section, such as edit it or add to it: one node, usually a button or a horizontal stack of a few, drawn at the end of the line of its title. It reads the same names as a child at the same place would.

Children: many. Visual: full, presented as a distinct section with its title. Voice: full, the title is spoken before the contents; its actions are offered after the title, by their labels.

core:tabs#

Show one of several panels at a time, with a tab for each that its panel names, so each child is usually a group whose title names its tab. Each child is one panel, counted as drawn after when and each, and its tab caption is the child's accessible label: a group's title, an embedded part view's title, and otherwise Tab followed by its position counted from 1.

Props

selected integer default 0, bindable
Position of the panel being shown among the panels as drawn, counting from 0. Bind it to remember or control the open tab.
label string optional
Optional name for the set of tabs, announced to assistive technology.

Events

change
The person switched to another tab.

Payload

value integer
Position of the newly shown panel, counting from 0.

Children: many. Visual: full, tabs are shown together; only the selected panel is shown. Voice: degraded, panel captions are offered as choices; only the selected panel is read.

core:dialog#

Ask for a person's attention or a short decision on top of the current view, without leaving it. Shown while open is true; only the app opens it.

Props

open boolean default false, bindable
Whether the dialog is showing. Only the app opens it, by making this true. When the person dismisses it the host writes false if open is bound; otherwise the dialog stays open until the app makes open false, usually in its dismiss handler.
title string
What the dialog is about, shown at its top and announced when it opens.
dismissible boolean default true
Whether the person may close it without choosing anything inside.

Events

dismiss
The person closed the dialog without using its contents. The host also writes false to open when it is bound.

Children: many. Visual: full, shown above the view, or inside the app's own region; either way the rest of the view is unavailable while it is open. Voice: degraded, spoken as a prompt: the title, then the contents, then the available actions.

core:divider#

Separate groups of content with a visible break.

Props

label string optional
Optional short text naming the break, such as a date between messages.

Children: none. Visual: full, shown as a separator, with its label when given. Voice: none, not spoken; nothing is lost when it is omitted.

core:text#

Show a piece of text, such as a sentence, a value or a note.

Props

value string
The text to show.
style "body" | "caption" | "emphasis" default "body"
body for ordinary text, caption for secondary detail, emphasis for text that should stand out. It sets the size and weight of ordinary text in both formats.
format "plain" | "markdown" default "plain"
plain shows the value as it is. markdown reads a small subset of Markdown, the same on every host: paragraphs and line breaks, strong, emphasis and code in a line, headings, lists, blocks of code, quotations, rules, links and pipe tables; anything else, HTML and images included, is shown as its characters. Use markdown for text that arrives formatted, such as a model's reply, notes people write or a description from a service; keep the app's own words plain. A link in it follows the rules of a link with a url, and the text never opens a view, runs an action or loads anything.

Children: none. Visual: full, style is realized by the design system. A markdown text is drawn with its headings, lists, code, quotations, rules, tables and links; a surface that cannot format shows the text without its markup. Voice: full, the text is spoken; captions may be skipped in brief replies. A markdown text is spoken without its markup, whose symbols are never read aloud: a heading starts a part, list items are read in turn, and a table is summarized by its columns and the number of its rows.

core:heading#

Title a view or a section of one, so people can scan and navigate by headings.

Props

value string
The heading text.
level integer (at least 1, at most 3) default 2
1 for the view's main title, 2 for a section, 3 for a subsection.

Children: none. Visual: full, size follows the level through the design system. Voice: full, spoken as the start of a section.

core:image#

Show a picture, such as a photo, an illustration or a picked image file.

Props

source string
Where the image comes from: asset: followed by the name of a picture the app carries in its assets, such as asset:logo, or the uri of a file reference returned by a capability, neither of which needs a grant; or an absolute http or https address, which the host loads only when the app holds an http.read grant for that origin. Any other value is not loaded, and a refused image shows its alt text.
alt string
What the image shows, for people who cannot see it. Use an empty string only for a purely decorative image, which the host then hides from assistive technology.
fit "contain" | "cover" default "contain"
contain shows the whole image; cover fills the space and may crop the edges.
size "small" | "medium" | "large" | "fill" default "fill"
How much room the image takes: small for thumbnails and avatars, fill to use the available width.

Children: none. Visual: full, loaded and scaled by the host. Voice: degraded, the alt text is spoken in place of the image.

core:icon#

Show a small symbol named by meaning, such as add, delete, warning or search. Hosts map names to their own symbol set.

Props

name IconName
Meaning of the symbol, a name of the icon vocabulary. A name the host does not know shows no symbol; the label, if any, is still given to assistive technology.
label string optional
What the symbol means in this place, for people who cannot see it. Leave it out when nearby text already says the same thing; the icon is then hidden from assistive technology.

Children: none. Visual: full, drawn from the host's symbol set. Voice: degraded, the label is spoken; icons without a label are skipped.

core:badge#

Mark something with a short status or count, such as New, Overdue or 3.

Props

label string
The short text or number to show.
tone Tone default "neutral"
What the status means. The design system gives each tone a consistent look.

Children: none. Visual: full, shown as a compact marker. Voice: full, the label is spoken.

core:stat#

Show one key figure with its name and, optionally, which way it is moving. The building block of dashboards.

Props

label string
What the figure measures.
value number or string
The figure: a number, formatted according to format, or text that is already formatted.
format NumberFormat default "plain"
How a numeric value is read.
currency string (matching ^[A-Z]{3}$) optional
ISO 4217 currency code when format is currency. Defaults to env.currency; with neither, the value is shown as a plain number.
trend Trend optional
Optional direction of change and whether it is good news.

Children: none. Visual: full, the value is prominent; the label and trend support it. Voice: full, spoken as label, value, then trend.

core:progress#

Show progress toward a numeric target, or that work is under way when the amount is unknown.

Props

value number? optional
Current amount. Leave it out or null when progress cannot be measured yet.
max number default 100
The target amount that counts as complete.
label string
What is progressing; the accessible name and visible caption.
format NumberFormat default "plain"
How the amounts are read and shown.
currency string (matching ^[A-Z]{3}$) optional
ISO 4217 currency code when format is currency. Defaults to env.currency; with neither, the amounts are shown as plain numbers.

Children: none. Visual: full, shown as a measure filled toward the target. Voice: degraded, spoken as a percentage.

core:alert#

Tell a person something important in place: that an action failed, that something needs attention, or that something worked. More prominent than a badge, and shown in the flow of the view rather than on top of it.

Props

title string
Short summary of what happened; the accessible name.
message string optional
Optional detail, such as what to do next.
tone Tone default "info"
What the alert means. warning and danger are announced to assistive technology at once; other tones wait for a pause.
dismissible boolean default false
Whether the person may dismiss it. The alert does not hide itself: handle dismiss, usually by changing the state its node's when reads.

Events

dismiss
The person dismissed the alert.

Slots

actions
What a person can do about what the alert says, such as Retry or Undo: one node, usually a button or a horizontal stack of a few, drawn after the message. It reads the same names as a child at the same place would.

Children: none. Visual: full, shown inline with the tone's color and a matching symbol, so the tone never depends on color alone. Voice: full, spoken when it appears, title first; its actions are offered after the message, by their labels; dismissed by saying so when dismissible.

core:textInput#

Let a person enter text: a name, an email address, a note or a longer description.

Props

value string? optional, bindable
The entered text. Bind it to keep what the person types; the host writes it at least when the person pauses or leaves the field, and may do so at every keystroke.
label string
What to enter; the accessible name and visible caption.
hint string optional
Optional guidance shown with the input, such as an example of what to type.
multiline boolean default false
Whether the text may span several lines, for notes and descriptions.
kind "text" | "email" | "phone" | "url" | "secret" default "text"
What sort of text is expected, so the host can offer a fitting keyboard and check the format. The checks for email, phone and url are the host's and accept any value a person could reasonably mean; secret hides what is typed.
required boolean default false
Whether a value must be entered before an enclosing form can submit. Text holding only white space counts as empty.
maxLength integer (at least 1) optional
Most characters allowed.
error string? optional
A problem with the current value, in plain language. When present the input is shown as invalid and an enclosing form will not submit.

Events

change
The person changed the text. Raised at least when they pause or leave the field, and possibly at every keystroke.

Payload

value string?
The new text.

Children: none. Visual: full, shown as a text field, or a larger area when multiline. Voice: full, filled by dictation and read back for confirmation; secret values are never read back.

core:numberInput#

Let a person enter a number, such as an amount of money, a quantity or a percentage.

Props

value number? optional, bindable
The entered number. Bind it to keep what the person enters.
label string
What to enter; the accessible name and visible caption.
hint string optional
Optional guidance shown with the input.
min number optional
Smallest allowed value. A smaller number from the person is refused: it is not written and raises no event.
max number optional
Largest allowed value. A larger number from the person is refused: it is not written and raises no event.
step number (at least 0) optional
Increment used when stepping up or down. A number from the person that is not min (or 0 without min) plus a whole number of steps is refused, as one outside min and max is.
format NumberFormat default "plain"
How the number is read and shown.
currency string (matching ^[A-Z]{3}$) optional
ISO 4217 currency code when format is currency. Defaults to env.currency; with neither, the value is shown as a plain number.
required boolean default false
Whether a value must be entered before an enclosing form can submit.
error string? optional
A problem with the current value, in plain language. When present the input is shown as invalid.

Events

change
The person changed the number.

Payload

value number?
The new number, or null when the field was cleared.

Children: none. Visual: full, shown as a numeric field formatted for the user's locale. Voice: full, spoken numbers are accepted and read back in the declared format.

core:dateInput#

Let a person choose a calendar date, a date and time, or a time of day, such as a due date, an appointment or an alarm.

Props

value string? optional, bindable
The chosen value in the form mode sets: YYYY-MM-DD for date, the canonical UTC datetime YYYY-MM-DDTHH:MM:SSZ for datetime, and HH:MM on a 24-hour clock, with no date or zone, for time. Bind it to keep the choice; a state entry of type date or datetime can be bound in those modes.
mode "date" | "datetime" | "time" default "date"
date for a calendar day; datetime for a moment, shown in the user's time zone and stored in UTC; time for a time of day with no date.
label string
What the date is for; the accessible name and visible caption.
hint string optional
Optional guidance shown with the input.
min string optional
Earliest allowed value, in the form mode sets, as for value.
max string optional
Latest allowed value, in the form mode sets, as for value.
required boolean default false
Whether a value must be chosen before an enclosing form can submit.
error string? optional
A problem with the current value, in plain language. When present the input is shown as invalid.

Events

change
The person chose a different value.

Payload

value string?
The new value in the form mode sets, or null when cleared.

Children: none. Visual: full, the host chooses between typing and a calendar or clock picker. Voice: full, spoken dates and times, including relative ones such as next Friday at 3, are resolved by the host and read back.

core:toggle#

Let a person turn one setting on or off.

Props

value boolean default false, bindable
Whether the setting is on. Bind it to keep the choice.
label string
What the setting controls; the accessible name and visible caption.
hint string optional
Optional guidance shown with the setting.

Events

change
The person turned the setting on or off.

Payload

value boolean
true when now on.

Children: none. Visual: full, shown as a switch or checkbox, at the host's choice. Voice: full, set by saying on or off; the new state is read back.

core:choice#

Let a person pick exactly one option from a list. The host decides whether to show all options at once or in a drop-down.

Props

value ChoiceValue? optional, bindable
The value of the picked option, with that option's type. Bind it to keep the choice.
options ChoiceOption[]
The options, in the order they should be offered. Values are compared with ==, and a value that is not among the options is not written.
label string
What is being chosen; the accessible name and visible caption.
hint string optional
Optional guidance shown with the options.
required boolean default false
Whether an option must be picked before an enclosing form can submit.
error string? optional
A problem with the current choice, in plain language. When present the input is shown as invalid.

Events

change
The person picked a different option.

Payload

value ChoiceValue?
Value of the newly picked option.

Children: none. Visual: full, shown as radio buttons, a drop-down or a segmented control, depending on the number of options and space, and as a palette of symbols or colors when every option has an icon or a swatch. Voice: full, the options are read and the person says one.

core:multiChoice#

Let a person pick any number of options from a list, such as tags or days of the week.

Props

value ChoiceValue[] default [], bindable
Values of the picked options, each with its option's type. Bind it to keep the choice.
options ChoiceOption[]
The options, in the order they should be offered. Values are compared with ==, and a value that is not among the options is not written.
label string
What is being chosen; the accessible name and visible caption.
hint string optional
Optional guidance shown with the options.
required boolean default false
Whether at least one option must be picked before an enclosing form can submit.
error string? optional
A problem with the current choice, in plain language. When present the input is shown as invalid.

Events

change
The person picked or unpicked an option.

Payload

value ChoiceValue[]
Values of all options now picked.

Children: none. Visual: full, shown as checkboxes, chips or a multi-select list, at the host's choice. Voice: degraded, long lists are read in short runs; options are added or removed one at a time by name.

core:slider#

Let a person set a number within a fixed range by feel, such as volume, a rating or a budget split.

Props

value number default 0, bindable
The current setting. Bind it to keep the choice.
label string
What is being set; the accessible name and visible caption.
min number default 0
Lowest value. A lower number from the person is refused: it is not written and raises no event.
max number default 100
Highest value. A higher number from the person is refused: it is not written and raises no event.
step number (at least 0) default 1
Increment between allowed values. A number from the person that is not min plus a whole number of steps is refused, as one outside min and max is.
format NumberFormat default "plain"
How the value is read and shown.
currency string (matching ^[A-Z]{3}$) optional
ISO 4217 currency code when format is currency. Defaults to env.currency; with neither, the value is shown as a plain number.

Events

change
The person moved the slider.

Payload

value number
The new setting.

Children: none. Visual: full, shown as a track with a handle. Voice: degraded, spoken as a number entry within the range.

core:fileInput#

Let a person attach files, or take a photo or recording with the device, for example to add a receipt to an expense. Choosing a file, or taking a photo or recording, is the person's own act and needs no grant; reading the file's contents goes through a capability.

Props

value FileRef[] default [], bindable
The files chosen so far. The file references in it come only from the host, from its file chooser or a capture. Bind it to keep them.
label string
What to attach; the accessible name and visible caption.
accept FileKind[] default ["any"]
Kinds of file that may be chosen. A file of a kind it excludes is refused.
multiple boolean default false
Whether more than one file may be chosen.
capture "none" | "camera" | "microphone" default "none"
A hint that the device camera or microphone is the expected source, as when photographing a receipt. Hosts without one fall back to choosing a file.
required boolean default false
Whether a file must be chosen before an enclosing form can submit.
error string? optional
A problem with the chosen files, in plain language. When present the input is shown as invalid.

Events

change
The person added or removed files.

Payload

value FileRef[]
All files now chosen.

Children: none. Visual: full, shown as a button that opens the system file chooser or camera, with the chosen file names. Voice: none, files cannot be chosen by voice; offer another way to provide them.

core:form#

Gather related inputs into one unit that is submitted together, and report whether every input is acceptable.

Props

label string optional
Optional name of the form, announced to assistive technology.
submitLabel string optional
Wording of the submit action the host provides, such as Save or Send. When absent the host uses its own wording.
cancelLabel string optional
When present, the host also offers a cancel action with this wording, which raises cancel.

Events

submit
The person submitted the form and every input that counts toward it is acceptable. When some input is not, the host shows the problems at the inputs and does not raise submit. Read the entered values from the state the inputs are bound to.
cancel
The person chose the cancel action.

Children: many. Visual: full, inputs are shown in order with the submit action after them. Voice: full, each input is asked in turn, then the answers are summarized and confirmed before submitting.

core:button#

Let a person start something: save, send, add, delete, start a game. Attach the action to its press event.

Props

label string
What pressing it does, as a short verb phrase.
emphasis Emphasis default "medium"
high for the main action of a view, medium for ordinary actions, low for minor ones.
icon IconName optional
Optional symbol shown beside the label, a name of the icon vocabulary.
destructive boolean default false
Whether the action removes something or cannot be undone. Hosts present such buttons with caution.
iconOnly boolean default false
Whether the button shows its icon without its label, for a compact place such as the actions of a chart or a table. The label stays the accessible name and is shown when the pointer rests on the button or keyboard focus is on it. Needs icon.

Events

press
The person activated the button.

Children: none. Visual: full, prominence follows emphasis through the design system. While the handler of a press runs, the button shows that it is working and takes no second press. Voice: full, activated by saying its label or a close paraphrase, also when only its icon is shown.

core:list#

Show a collection of items one after another, each drawn by the item template, and let a person pick one, move one to another list, or put one at a place of their choosing. Use for feeds, inboxes, simple records, the columns of a board and lists a person orders, such as priorities. Pass the items as a prop; repeating the node itself with each would make several lists.

Props

items any[]
The items to show, in order, each drawn with the item template.
itemKey string default "id"
Name of the field that identifies each item, so the host can keep track of items as the list changes.
label string optional
Optional name of the list, announced to assistive technology.
empty string optional
What to show when there are no items, such as No deposits yet. When absent the host shows its own empty state.
moveGroup string optional
A name the app chooses for lists whose items a person may move between, such as tasks. Lists of one view that share it and handle move take items from each other: the host lets the person drag an item onto another list of the group and offers, from each item, a way to move it to each other list without dragging, naming each by its label. An item moves only by its itemKey; one without a key of its own stays where it is.
reorderable boolean default false
Whether a person may put an item of this list at a place of their choosing, such as the order of a to-do list or of the cards of one column. A reorderable list that handles move takes part in moving items even without a moveGroup, and then moves its items only within itself: the host lets the person drag an item to its new place, showing where it will stand, and offers, from each item, a way to move it one place earlier or later without dragging. The list shows its items in the order the app passes them, so the handler keeps the order move gives.

Events

select
The person picked an item.

Payload

item any
The element of items at the picked position, exactly as the app passed it, so a handler can read any of its fields.
index integer
Its position among items, counting from 0.
move
The person moved an item here from another list of the same moveGroup, or to another place in this list when it is reorderable, by dragging it or without dragging. It is raised by the list the item lands in, so the handler reads this list's names, and usually changes the field the lists filter their items on. In a list that is not reorderable, where the item lands means nothing; the app orders its lists itself. In a reorderable list, index and order say where it stands, and nothing is raised when the item would stay where it was.

Payload

item any
The element of items of the list it came from, exactly as the app passed it there, so a handler can read any of its fields.
index integer?
The place the item takes among this list's items in the new order, counting from 0, or null when this list is not reorderable.
order any[]?
The itemKey of every item of this list in the new order, the moved item among them, each exactly as it is in the item, so a handler can keep that order: state.goals.sortBy(g, indexOf(event.order, g.id)). An item whose key is missing, or is not a short string, a number or a boolean, has null at its place. Null when this list is not reorderable.

Slots

item required
Template drawn once per item. Names in scope: item (any), index (integer).
actions
What a person can do with this list, such as add an item: one node, usually a button or a horizontal stack of a few, drawn at the end of a line with its label as a title. It reads the same names as a child at the same place would.

Children: none. Visual: full, long lists scroll; the host may load rows as they come into view. With actions, the label is shown as the list's title. With moveGroup, each item offers to move to the other lists of its group, and the host may let the person drag it. With reorderable, each item offers to move one place earlier or later, and the host may let the person drag it to a new place. Voice: degraded, read a few items at a time; the person can ask for more or pick one by name or number. Its actions are offered after the list is named, by their labels. With moveGroup, the person can move an item to another list of its group by that list's label. With reorderable, the person can move an item earlier or later, or to the first or last place.

core:table#

Show records as rows with named columns so people can compare, sort, select and page through them. Use for ledgers, inventories and reports.

Props

items any[]
The records to show, one per row.
columns TableColumn[]
The columns, in order.
label string
What the table lists; the accessible name and caption.
itemKey string default "id"
Name of the field that identifies each record.
complete boolean default true
true when items holds every record: the host sorts and pages them itself, ordering numbers by size and text without regard to case, putting missing and null values last, keeping ties in their original order, and returning to page 1 after sorting. false when items is the current page in display order: the host shows it as given, neither sorts nor slices it, and raises sort and page for the app to answer, usually by changing the query of a sourced state value.
sort SortKey? optional, bindable
The current ordering. Bind it to keep or control the order.
pageSize integer (at least 1) optional
How many rows to show at a time. When absent, a table of more than 100 rows is shown 50 at a time, and a table of 100 or fewer is not paged.
page integer (at least 1) default 1, bindable
Which page is shown, counting from 1. Bind it to keep or control the page.
total integer (at least 0) optional
Total number of records when complete is false and the count is known. Together with pageSize it tells the host how many pages to offer; without total the host offers a next page while the current one is full.
selection "single" | "multiple" default "single"
single lets a person pick one row at a time, and picking the selected row again unpicks it; multiple lets them pick several for a bulk action. A host that lets people select rows presents the table in the grid role.
selected any[] default [], bindable
Keys (values of itemKey) of the selected rows. When the person picks a row the host works out the new selection and writes it here when this is bound. Bind it to keep or clear the selection.
empty string optional
What to show when there are no records. When absent the host shows its own empty state.

Events

select
The person picked or unpicked a row. The payload carries the row and the new selection, which the host has worked out.

Payload

item any
The row's element of items, exactly as the app passed it, so a handler can read any of its fields.
index integer
Its position among items, counting from 0.
selected any[]
Keys of all rows now selected.
sort
The person asked to order rows by a column. With complete false the app answers it by supplying the rows in the new order.

Payload

field string
Field of the chosen column.
direction "asc" | "desc"
Requested direction.
page
The person moved to another page. With complete false the app answers it by supplying that page's rows.

Payload

page integer
The requested page, counting from 1.

Slots

cell
Template for cells in columns whose format is custom, such as a status badge or a row action button. Without it, such cells show their values as text. Names in scope: item (any), index (integer), column (TableColumn), value (any).
actions
What a person can do with this table, such as add a record or export the rows: one node, usually a button or a horizontal stack of a few, drawn at the end of a line with its label as a title. It reads the same names as a child at the same place would.

Children: none. Visual: full, on narrow screens the host may show each row as a stacked card. With actions, the label is shown as the table's title. Voice: degraded, read row by row using column labels; sorting and paging are offered on request. Its actions are offered after the table is named, by their labels.

core:chart#

Show how numbers compare or change, drawn from a list of records. Say which field names each category and which fields hold values; the host draws the chart. The plot is drawn left to right in every language; its title, legend and data table follow the direction of the app.

Props

kind "bar" | "line" | "area" | "pie" | "scatter"
bar to compare categories, line or area for change over time, pie for parts of a whole (one series), scatter for the relation between two numbers.
items any[]
The records to plot, one per category or point, in order.
category string
Name of the field that labels each record: the horizontal axis for bar, line and area, the slice for pie, and the numeric horizontal value for scatter.
series ChartSeries[]
The value fields to plot. pie uses only the first.
label string
What the chart shows; the accessible name and title.
stacked boolean default false
For bar and area: stack series on top of each other instead of side by side.
format NumberFormat default "plain"
How values are read, for every series that does not set its own format.
currency string (matching ^[A-Z]{3}$) optional
ISO 4217 currency code for values whose format is currency. Defaults to env.currency; with neither, they are shown as plain numbers.
unit string optional
What the plain numbers count, such as hours or kg, shown after each value as written: never translated or made plural by the host. A series may set its own. Values formatted as currency or percent are shown without it.
categoryLabel string optional
What the categories are, such as Month: the title of the category axis (the horizontal number for scatter) and the heading of the first column of the data's table. A pie draws no axis; it is still read aloud and heads the table.
valueLabel string optional
What the values are, such as Hours worked: the title of the value axis, read aloud with the chart. A pie draws no axis; it is still read aloud.
orientation "vertical" | "horizontal" default "vertical"
For bar: horizontal lays the bars on their side, categories down the side with the first at the top and values along the bottom, as for a ranking or long category names. Ignored for other kinds.
goal ChartGoal optional
For bar, line and area: a value to measure the figures against, such as { "value": 40, "label": "Weekly target" }, drawn as a dashed line across the plot and read aloud. The value axis always reaches it. Ignored for pie and scatter.
selected ChartValue? default null, bindable
The value selected, or null for none, such as { "item": "Mar", "series": "hours" }. Pressing a bar, a point or a slice selects it, and pressing it again clears it; pressing empty space changes nothing. The host draws the selected value outlined and says that it is selected. A selection that names a record or a series the chart does not draw now marks nothing, and marks it again when it is drawn. Bind it to keep, set or clear the selection.
itemKey string optional
Name of the field that identifies each record, as selected names it. When absent the category field does, and records that share a category are selected together.

Events

select
The person pressed a bar, a point or a slice, or cleared the selection with Escape. The host works out the new selection and writes it to selected when selected is bound. Escape is heard only by an app that gives selected; for one that does not, the host clears its own mark without calling the handler.

Payload

item any
The element of items behind the value pressed, or behind the value whose selection Escape cleared (the first drawn of the records that share its key), exactly as the app passed it, so a handler can read any of its fields.
series string
Field of the series of that value.
selected ChartValue?
The value selected now, or null when the press or Escape cleared the selection.

Slots

actions
What a person can do with this chart, such as export it or choose its period: one node, usually a button or a horizontal stack of a few, drawn at the end of the line of its title, the label. It reads the same names as a child at the same place would.

Children: none. Visual: full, axes, legend and colors are chosen by the host and design system. The host should offer the data as a table for people who cannot see the chart. Voice: degraded, spoken as a short summary: what is shown, the highest and lowest values, the overall direction, and the value selected when there is one; its actions are offered after the summary, by their labels. A unit is spoken after each value as written, such as 38 hours, and a goal by its label and value with how the figures stand against it, such as: the weekly target of 40 hours was passed in March.

core:canvas#

A drawing surface for casual games and custom visuals. The app describes what is on it as a list of simple shapes, usually derived from state, and the canvas reports where the person points and which keys they press. Timing comes from rules with an every trigger that update state; the canvas has no clock the app sees. A figure drawn many times is a symbol placed by use shapes, and a shape that changes can glide to its new place with motion, so a rule fires only as often as the state changes. A canvas is never mirrored: in an app read from right to left it draws the same picture.

Props

scene Shape[]
Everything drawn on the canvas, in drawing order. Normally an expression over state, so the drawing follows the app's state as rules and actions change it. The source of an image shape may be asset: followed by the name of a picture the app carries, which needs no grant. Only that source can cause a fetch: a remote address loads only when the app holds an http.read grant for that origin, and file references returned by a capability need none.
label string
What the canvas is, such as Snake game board; the accessible name.
summary string optional
A short description of what is currently on the canvas, for people who cannot see it, such as Score 12, snake heading left.
aspect number (at least 0.1, at most 10) default 1
Width divided by height. The host fits the canvas into the available space keeping this shape.
background string optional
Color token name for the canvas background. When absent the design system's surface color is used; an unknown name falls back to the host's nearest default and the canvas is reported as degraded.
mode "light" | "dark" optional
Keeps the scene in one mode of the design system: its background and every color its shapes name are drawn in that mode's values whatever the page's mode, for a drawing whose colors mean something by themselves, such as one that must print as it shows. When absent the scene follows the page's mode, as every other control does. A design system without that mode gives its base values. The card around the canvas, its title, tools and settings follow the page.
keys string[] default []
Keys the canvas should receive while it has focus, using W3C UI Events key values with Space for the space bar (for example ArrowLeft, Space, a). Other keys keep their usual meaning. Tab is never captured.
symbols object optional
Drawings made once and placed many times by use shapes, by name: each a list of shapes in the space a group gives its shapes, around its origin at 0, 0. A shape of a symbol whose fill or stroke is the name given is drawn in the color of the placement. A symbol may place other symbols, as groups nest. Use one for a figure a scene shows many times, such as a block of a game with its light and shade, a playing piece or a marker: the scene then says only where each one is and in what color. The source of an image shape may be asset: and the name of a picture the app carries, and only that source can cause a fetch, as in scene.
motion Motion default "none"
How a shape that stays in the scene when it changes gets from its old values to its new ones. A shape stays when the scene after the change has a shape of the same kind with its id at the same level: in the scene, or among the shapes of the same group with an id; of two with one id the first is matched. What moves is every number that places or sizes the shape (x, y, x2, y2, width, height, r, radius, radiusX, radiusY, from, to, rotation, scale, opacity, strokeWidth, size) and the points of a path whose number of points stays the same; rotation takes the shorter way round. Everything else, such as colors and text, changes at once. A shape that appears or goes does so at once, a shape without an id never moves smoothly, and a change while a shape moves starts from where it is drawn. The host is the clock: the app is not told about frames, and pointer events report shapes where the scene says they are. A person who asks their system for less motion sees every change at once, and so does a canvas that is not shown. Once a motion ends the canvas shows exactly what it would without it. A shape's own motion overrides this one.

Events

pointer
The person touched, clicked or dragged on the canvas. Moves are reported only while pressed.

Payload

phase "down" | "move" | "up" | "cancel"
Which part of the gesture this is.
x number
Horizontal position as a fraction of the canvas width, 0 at the left edge.
y number
Vertical position as a fraction of the canvas height, 0 at the top edge.
target string?
id of the topmost shape with an id under the pointer, or null. Hit testing measures lengths that do not follow one axis as fractions of the width, using aspect.
key
The person pressed or released one of the keys listed in keys while the canvas had focus.

Payload

key string
The key, using the same names as the keys prop.
phase "down" | "up"
Whether the key went down or came up.
repeat boolean
true when the key is held and this is an automatic repeat.

Slots

actions
What a person can do with this canvas, such as start again or pause: one node, usually a button or a horizontal stack of a few, drawn at the end of a line with its label as a title. It reads the same names as a child at the same place would.
tools
The tools of a drawing and their settings: one node, or a vertical stack of a few, in order. A choice whose options carry an icon or a swatch and an icon-only button are tools; any other control, such as a slider for a pen size, is a setting of them. Both are drawn outside the surface. A tool choice's own label is not shown and stays its accessible name. It reads the same names as a child at the same place would.

Children: none. Visual: full, shapes are drawn with design system colors; hosts that render visual surfaces should keep up with rules firing every 16 ms. Groups and symbols are drawn by every host. Motion, gradients and shadows are the parts a host may leave out, and what it draws then is always a correct picture: each change at once, a fill in its first stop's color at that stop's opacity, and no shadow. With actions, the label is shown as the canvas's title, in a bar on top of the surface; the tools and their settings are drawn outside the surface too. None of them changes the positions a pointer event carries. A canvas that has drawn keeps showing its last picture, at its size, for a short time while its scene cannot be drawn (the node is then a placeholder), and draws again once a scene can be; when no scene can be drawn within that time, the placeholder is shown. Voice: none, a canvas has no spoken form. Expose the same moves as actions so voice and agent users can still play or act. Its actions are still offered, by their labels.

core:diagram#

Explain how parts connect: an architecture, a flow or a process. The app gives the boxes and the connections between them, never positions, sizes or colours; the host lays them out, routes the lines and fits the drawing to the space it has. Use canvas only for drawings that are not boxes and connections. The layout is the same in every language.

Props

boxes DiagramBox[]
The parts to show, such as [{id: 'web', label: 'Web app', group: 'front'}, {id: 'db', label: 'Orders', kind: 'store'}]. At most 60 are drawn; the rest are left out, the host says how many, and the diagram is reported as degraded.
connections DiagramConnection[] default []
The lines between boxes, such as [{from: 'web', to: 'api', label: 'REST calls'}]. Without groups, a box is drawn below the boxes that lead to it, and a connection that closes a loop is drawn going back up. At most 120 are drawn. A connection that names a box the diagram does not have is left out.
groups DiagramGroup[] optional
Optional bands that hold boxes, shown in this order from the top, such as [{id: 'front', label: 'Front end'}, {id: 'back', label: 'Back end'}]. A box names its group by id; one that names no group, or a group the diagram does not have, is drawn in a band without a name below the others. At most 12 are drawn.
selected string? default null, bindable
id of the selected box, or null for none, such as api. Pressing a box selects it, and pressing it again or pressing empty space clears it; the host draws the selected box ringed, keeps what it connects to strong and dims the rest. Bind it to keep or set the selection.
highlight string[] default []
ids of boxes and connections to show strongly while the rest is dimmed, such as ['web', 'api', 'webToApi'] for one step of a story. A connection without an id counts as named when both its boxes are. Empty shows everything at full strength.
label string
What the diagram shows, such as How an order is placed; the accessible name and title.
summary string optional
A short sentence about what the diagram shows now, for people who cannot see it, such as Step 2 of 5: the API saves the order.

Events

select
The person pressed a box, pressed the selected box again, or pressed empty space. The host works out the new selection and writes it to selected when selected is bound.

Payload

box DiagramBox?
The box pressed, exactly as the app passed it, or null when empty space was pressed or the selection was cleared with Escape.
selected string?
id of the box selected now, or null when none is.

Slots

actions
What a person can do with this diagram, such as export it or choose what it shows: one node, usually a button or a horizontal stack of a few, drawn at the end of the line of its title, the label. It reads the same names as a child at the same place would.

Children: none. Visual: full, layout, routing, shapes and colours are the host's; each kind of box has a shape of its own. The host offers the same content as a list for people who cannot see the diagram. Voice: degraded, read as a list: each group, its boxes and what each connects to; its actions are offered after the list, by their labels.

Capabilities#

Typed access to the outside world. Every operation is gated by a grant that covers its scope.

core:notify#

Send a notification to the person using the app, or to another named person, such as a reminder, an alert or a request for approval.

Operations

send external, scope notify.self
Notify the current user: the person the acting principal is or acts for, never an agent or the app. Fails with capability.failed when the acting principal has no person; otherwise returns an identifier for the notification.
sendTo external, scope notify.others
Notify another principal, by id, on behalf of the current user: the person the acting principal is or acts for, never an agent or the app. Fails with capability.failed when the acting principal has no person; otherwise returns an identifier for the notification.

core:scheduler#

Let the app run while nobody has it open. Holding a grant on this capability permits every rules, flow after timers and timed source refreshes to run unattended, and lets rules fire on capability events and changes of the environment while no session is open. It can also wake the app at chosen moments, for the person on whose behalf each wake was scheduled.

Operations

wakeAt write, scope scheduler.background
Wake the app once at the given time, raising the wake event on behalf of the person for whom it is scheduled. Wakes are kept by the instance, not by a session; a time that has passed is due at once, and a key that is already pending replaces the earlier wake. Within the instance, a wake belongs to the definition whose steps scheduled it, the app itself or one of its parts, and its wake event reaches only that definition's rules. Returns the time the wake is due: the current time for a time that has passed, and otherwise possibly later than asked where the platform limits background work. A host supports at least 100 pending wakes per instance and times up to ten years ahead; a request beyond what it supports fails with capability.failed.
cancel write, scope scheduler.background
Cancel a pending wake by its key. Does nothing if none is pending.

core:http#

Read from or send to one web service. Each use names a single origin in its config, so a grant always covers exactly one service. A grant on http.read also lets the host show images and other remote content from that origin.

Operations

get read, scope http.read
Fetch a resource from the service without changing anything. A redirect is not followed: a 3xx response is returned as it is, and where the platform cannot return it the call fails with capability.failed.
send external, scope http.send
Send data to the service, such as submitting a form or creating an item there. A redirect is not followed: a 3xx response is returned as it is, and where the platform cannot return it the call fails with capability.failed.

core:files#

Work with the user's own files: ask them to choose files, read what they chose, and save new files where they decide.

Operations

pick read, scope files.pick
Ask the person the app is acting for to choose one or more files, on a surface of theirs that is open; with none, the call fails with capability.unavailable. Returns an empty list if they cancel.
read read, scope files.read
Read the contents of a file whose reference the host issued to this app instance: by pick, by save, by a capture, or for a file an agent handed to the host. Any other reference fails with capability.failed, as if the file were not available.
save write, scope files.save
Ask the person the app is acting for to choose a place, on a surface of theirs that is open, and save a new file there; with no such surface, the call fails with capability.unavailable. Returns a reference to the saved file, or null if they cancel.

core:media#

Capture a photo or a short audio clip with the device, with the user taking the photo or making the recording themselves.

Operations

capturePhoto read, scope media.camera
Open the camera for the person the app is acting for to take one photo, on a surface of theirs that is open; with none, the call fails with capability.unavailable. Returns null if they cancel.
captureAudio read, scope media.microphone
Let the person the app is acting for record one audio clip, on a surface of theirs that is open; with none, the call fails with capability.unavailable. Returns null if they cancel.

core:location#

Find where the device is right now, once per request. A grant can be limited to approximate positions with a where condition on precision.

Operations

current read, scope location.current
Get the device's current position.

core:directory#

Look up people and their roles: who the current user is, who their manager is, who holds a role, and who matches a name. Needed for approvals, assignments and team apps.

Operations

me read, scope directory.self
Get the current user as the directory knows them: the person the acting principal is or acts for, never an agent or the app. Fails with capability.failed when the acting principal has no person.
get read, scope directory.read
Get a principal by id. Returns null if there is none.
manager read, scope directory.read
Get the manager of a principal, or, when of is absent, of the current user: the person the acting principal is or acts for, never an agent or the app. Returns null if they have none; without of, fails with capability.failed when the acting principal has no person.
members read, scope directory.read
List the principals that hold a role.
find read, scope directory.read
Find people whose name matches some text, for choosing an assignee or approver.

core:records#

Read and change a collection of records kept somewhere else, such as tickets in a tracker, rows in a spreadsheet or rows in a database table. Adapters to those systems implement this contract. Some providers also work offline, queueing changes until they reconnect.

Operations

list read, scope records.read
List records that pass every condition, in the requested order, one page at a time. A record that exists throughout the paging and keeps its sort values is listed exactly once.
get read, scope records.read
Get one record by id. Returns null if there is none.
count read, scope records.read
Count the records that pass every condition.
aggregate read, scope records.read
Group the records that pass every condition and compute measures for each group. Groups come in ascending order of their keys, in the order list sorts by, and truncated says when more groups existed than limit.
create write, scope records.write
Add a new record. The provider assigns its id.
update write, scope records.write
Change some fields of a record. Fields not given are left unchanged.
delete write, scope records.delete
Remove a record. Returns false if there was none.

core:share#

Hand text, a link or files to the device's share mechanism, so the user picks where they go.

Operations

send external, scope share.send
Open the share mechanism with the given content for the person the app is acting for, on a surface of theirs that is open; with none, the call fails with capability.unavailable. Give at least one of text, url or files. Returns false if the person cancelled, when the platform can tell.

core:clipboard#

Copy text to the clipboard, and, with a separate and more sensitive permission, read what is on it.

Operations

write write, scope clipboard.write
Put text on the clipboard, replacing what was there. Returns true when the text was copied.
read read, scope clipboard.read
Get the text currently on the clipboard, or null if it holds no text.

Shared types#

Spacing#

A named amount of space. The design system decides how much each name means.

Values: "small", "medium", "large".

Emphasis#

How much attention a part should draw relative to its neighbors. Use high for the one main thing on a view.

Values: "high", "medium", "low".

Tone#

The meaning a status carries. Hosts present each tone consistently so people learn to recognize it.

Values: "neutral", "info", "success", "warning", "danger".

IconName#

A symbol named by its meaning, in camelCase, such as add, delete, warning or search. The names listed as known are the icon vocabulary: every host knows them and draws each with a symbol of its own set, and a host may know more. A name the host does not know is still a valid value and shows no symbol.

NumberFormat#

How a number is meant to be read: a plain quantity, an amount of money, or a percentage. Percent values are fractions, so 0.25 reads as 25%.

Values: "plain", "currency", "percent".

SortKey#

One field to order by and the direction to order it in.

field string
Name of the field to order by.
direction "asc" | "desc"
asc for smallest or earliest first, desc for largest or latest first.

ChoiceValue#

The value of a choice option: a string, a number or a boolean. Options are compared with ==, so 1 and "1" are different options.

ChoiceOption#

One option a person can pick.

value ChoiceValue
The value stored when this option is picked, with its own type. Stable, not shown.
label string
What the person sees or hears for this option.
description string optional
Optional extra sentence explaining the option.
icon IconName optional
A symbol for the option, such as a drawing tool. A choice whose options all have a symbol the host draws, at most 12 of them, is drawn as a row of symbol buttons, one picked; the label stays the option's name. A multiChoice does not draw it.
swatch string optional
A color for the option, named by a design token as a canvas shape's fill is, so an app can offer the colors it paints with. A choice whose options all have a color, at most 12 of them, is drawn as a row of color dots, one picked; the label stays the option's name. An unknown name falls back as a canvas fill's does. A multiChoice does not draw it.

Trend#

Which way a figure is moving and whether that is good news.

direction "up" | "down" | "flat"
Which way the figure moved.
label string optional
Short text describing the change, such as a difference from the previous period.
sentiment "positive" | "negative" | "neutral" optional
Whether the movement is good, bad or neither. Rising costs are up but negative.

TableColumn#

One column of a table: which field of each item it shows and how to read it.

field string
Name of the item field shown in this column.
label string
Column heading, also used when the table is read aloud.
format "text" | "number" | "currency" | "percent" | "date" | "datetime" | "boolean" | "custom" optional
How values in this column are read. custom means each cell is drawn with the table's cell template, and without one its value is shown as text.
currency string (matching ^[A-Z]{3}$) optional
ISO 4217 currency code for currency columns. Defaults to env.currency; with neither, values are shown as plain numbers.
sortable boolean optional
Whether a person may order the table by this column.

ChartSeries#

One set of values plotted in a chart, taken from a numeric field of each item.

field string
Name of the numeric item field holding this series' values.
label string
Name of the series, shown in legends and read aloud.
color string optional
Optional color token name from the design system. When absent the host assigns one; an unknown name falls back to the host's nearest default and the chart is reported as degraded.
format NumberFormat optional
How this series' values are read. When present it overrides the chart's format.
unit string optional
What this series' plain numbers count, such as kg; when present it overrides the chart's unit. Values formatted as currency or percent are shown without it.

ChartGoal#

A value the figures are measured against, such as a target or a limit, drawn as a quiet dashed line across the plot.

value number
Where the line is drawn, in the chart's values, such as 40. In a stacked chart it is compared with the whole stack.
label string optional
What the goal is, such as Weekly target, shown at the end of the line and read aloud. Without it the line is called Goal.

ChartValue#

One value a chart draws as a bar, a point or a slice, named by the record it comes from and its series, such as { "item": "Mar", "series": "hours" }.

item string or number or boolean
The value of the record's key field: the field itemKey names, or else the category field. A record whose key is not a string, a number or a boolean cannot stay selected.
series string
Field of the series.

PathPoint#

One point of a path, placed as every position of a scene. The segment that ends at it is straight, or curved when it also gives control points, placed as x and y are: cx and cy for one (a quadratic curve), or c1x, c1y, c2x and c2y for two (a cubic curve, used when both are given). The curve leaves the point before toward the first control point and arrives from the last. A curved point counts as one point. A control point given only in part bends nothing, and the canvas is reported as degraded. Other fields are ignored.

x number
Horizontal position.
y number
Vertical position.
cx number optional
Horizontal position of the one control point of a quadratic curve.
cy number optional
Vertical position of the one control point of a quadratic curve.
c1x number optional
Horizontal position of the first control point of a cubic curve, which the curve leaves the point before toward.
c1y number optional
Vertical position of the first control point of a cubic curve.
c2x number optional
Horizontal position of the second control point of a cubic curve, which the curve arrives at this point from.
c2y number optional
Vertical position of the second control point of a cubic curve.

Shape#

One element of a canvas scene, told apart by kind. Positions are fractions of the canvas: x runs from 0 at the left edge to 1 at the right, y from 0 at the top to 1 at the bottom; inside a group or a symbol both are fractions of the canvas width, measured from its origin. Values outside 0 to 1 are allowed and are clipped. Lengths that do not follow one axis (every radius, stroke width, text size) are fractions of the canvas width, so hit testing uses the canvas aspect. Colors are design token names; an unknown name falls back to the host's nearest default and the canvas is reported as degraded. Shapes are drawn in list order, so later shapes appear on top. A canvas draws at most 5000 shapes and 50000 path points in all, counted in drawing order and each as often as it is drawn: a group and a placement of a symbol count as one shape each, and the shapes they hold count again for every placement; what lies beyond is not drawn, and the canvas is reported as degraded with how many shapes and path points were left out.

Fill#

How a shape is filled: a color token name, or a gradient that runs between colors across the shape's own box. A gradient is linear (along angle, in degrees clockwise: 0 runs from left to right, 90, the default, from top to bottom, from one corner of the box to the other) or radial (from the middle of the box out to its farthest edge), through two to eight stops; there are no color codes, pixel positions, focus points or repeats. A stroke stays one color. A host that cannot draw a gradient fills the shape with its first stop's color at that stop's opacity, so write the main color first. Use a gradient for light that falls on something (a fill that runs from a color to a deeper one) or a shine (a color fading to nothing over a plain fill), on a few shapes; it spoils a drawing when every shape has one, or when it runs between unrelated colors.

GradientStop#

One color of a gradient: a color token name, or an object with the color, its opacity and where it sits. Inside a symbol the name given takes the color of the placement, as a plain fill does. Stops that do not say where they sit are spread evenly between those that do, the first at the start and the last at the end; a stop never sits before the one ahead of it.

Shadow#

How far a shape, a group or a placement seems lifted from the canvas, as a soft shadow under it: low, medium or high. The design system says what each level looks like (its shadow tokens), in the mode the scene is drawn in; the shadow never moves anything or changes what is under the pointer, and a host that draws no shadows draws the shape without one. Use it to lift the few things a person picks up or acts on, such as a card, a tile or a piece in play, and keep one level for things of one kind; shadows on everything, or high ones on small shapes, make a drawing look heavy.

Values: "low", "medium", "high".

Motion#

How a shape that stays in a canvas's scene when it changes gets from its old values to its new ones: none, at once; the name of a motion token of the design system, such as quick, standard or slow, over that long and eased so that it starts fast and settles; or an object with over, a duration, and ease.

DiagramBox#

One part shown in a diagram: a component, a person, a place data is kept, or a system outside what is shown. The host decides its size, place and colours.

id string
Stable name of the box, unique in the diagram, which connections, highlight and selected refer to, such as api. Not shown.
label string
What the box is, in a few words, such as Order service. Shown on at most two lines; the whole text is in the box's accessible name.
detail string optional
Optional short line under the label, such as Node.js, or Keeps every order. Shown smaller, on at most two lines.
group string optional
Optional id of the group the box belongs to, such as backend. The box is drawn in that group's band.
kind "box" | "person" | "store" | "outside" optional
What sort of part it is, which the host shows by its shape: box for a component, person for someone who uses the system, store for something that keeps data such as a database, outside for a system that is not part of what is shown, such as a payment provider.

DiagramConnection#

A line from one box to another, such as a call, a message or data that flows. The host routes it.

from string
id of the box the connection starts at, such as web.
to string
id of the box the connection leads to, such as api.
label string optional
Optional few words on the line saying what passes along it, such as REST calls.
id string optional
Optional name of the connection, unique in the diagram, so that highlight can name it alone, such as webToApi.
style "solid" | "dashed" optional
solid for a direct connection, dashed for one that is occasional, asynchronous or optional, such as events sent later.
arrows "forward" | "both" | "none" optional
Where arrowheads are drawn: forward at the to end, both at both ends for a two-way exchange, none for a plain link.

DiagramGroup#

A named band of a diagram that holds the boxes that name it, such as a layer or a team.

id string
Stable name of the group, unique in the diagram, which boxes refer to with group, such as backend. Not shown.
label string
The group's name, shown beside or above its band, such as Back end.

FileKind#

A broad kind of file, used to say what may be chosen. Hosts map each kind to concrete formats.

Values: "image", "video", "audio", "document", "spreadsheet", "text", "any".

FileRef#

A handle to one file the user gave the app or the app created. It identifies the file without containing it. Handles are issued by the host to one app instance, which can read only the handles issued to it, and a handle stays readable for as long as the instance's stored state holds it. Any operation input typed as this type, at any depth, is resolved by the host so the provider can read the file.

id string
Host-issued identifier of the file, unguessable: at least 128 random bits.
name string
File name as the user would recognize it.
mediaType string
IANA media type, such as image/jpeg.
size integer (at least 0) optional
Size in bytes, when known.
uri string optional
Host-issued address that image controls and canvas image shapes can display, good only for the app instance it was issued to. The host already holds the file, so showing it is not egress and needs no grant.

GeoPoint#

A position on Earth in WGS 84 coordinates.

latitude number (at least -90, at most 90)
Degrees north of the equator; negative is south.
longitude number (at least -180, at most 180)
Degrees east of Greenwich; negative is west.
accuracy number (at least 0) optional
Radius of uncertainty in meters, when known.

Principal#

A person, agent or app as the directory knows it, with the fields of the user value that expressions see other than person.

id string
Stable identifier, usable wherever a principal id is expected.
kind "person" | "agent" | "app"
What sort of principal this is.
name string
Display name.
roles array
Role names the directory assigns to this principal.
onBehalfOf value
The principal this one is acting for, or null when it acts for itself. Directory lookups always give null.

Record#

One record in a collection: an object with a stable id and any other fields the collection defines.

id string
Stable identifier assigned by the provider.

RecordCondition#

One test a record must pass. Conditions in a list must all pass.

field string
Name of a top-level field of the record. A missing field reads as null.
op "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "contains" | "in"
The comparison. eq, ne and in compare exactly, with no conversion between kinds; lt, lte, gt and gte hold only between two numbers or two strings; contains holds when the field and the value are both strings and the field contains the value once both are mapped to lower case by the Unicode default case conversion with no locale (what ECMAScript's String.prototype.toLowerCase gives), with no normalization and no folding of accents: "Refund for a cancelled booking" contains "refund" and "REFUND" but not "réfund".
value value
The value to compare against. For in, a list of values.

RecordPage#

One page of records from a list operation.

items array
The records on this page, in the requested order.
next string or null optional
Cursor for the following page, or null when there is none. It is good only for the listing that produced it.
total integer (at least 0) optional
Number of records that pass the filter, across every page, when the provider knows it.

RecordCount#

How many records pass a filter.

count integer (at least 0)
The number of records that pass the filter.

RecordMeasure#

One value computed over the records of a group, told apart by op. sum and avg use only number values; min and max use the record sort order over values that are not null.

RecordAggregate#

The groups of an aggregate operation, with the measures computed for each.

groups array
The groups, in ascending order of their keys in the record sort order, at most limit of them.
truncated boolean
true when more groups existed than limit.

HttpResponse#

The answer a web service gave. Redirects are never followed, set-cookie headers are removed, and a credential the host attached that the service echoes back is replaced with [withheld].

status integer (at least 100, at most 599)
HTTP status code. Error and redirect statuses are returned here, not raised as failures.
headers object
Response headers, with lowercase names and without set-cookie.
body value
null when the response has no content; the parsed value when it declares a JSON media type (application/json, or application/ followed by a name ending in +json) and parses; otherwise the content decoded as UTF-8 text, with invalid sequences replaced. Binary content therefore cannot be read through http.