Pebble App Framework: Phone API
    Preparing search index...

    Interface ClayConfigItem

    One Clay config item (a section, heading, select, toggle, input, custom component, etc.). The fields both the config builder and the runtime touch are declared. Custom-component props ride along as optional. No index signature, so a face's own typed config array stays assignable to this.

    interface ClayConfigItem {
        attributes?: Record<string, unknown>;
        capabilities?: string[];
        defaultValue?: string | number | boolean;
        description?: string;
        group?: string;
        hideWhenEmpty?: boolean;
        id?: string;
        introWithoutWeather?: string;
        items?: ClayConfigItem[];
        label?: string;
        messageKey?: string;
        moduleOptions?: unknown;
        moduleThumbnails?: unknown;
        options?: ClayOption[];
        panel?: PluginPanelContent;
        pluginSource?: { category: string; item: string };
        pluginSourceHides?: string;
        pluginSourceLead?: string;
        pluginSourceRows?: string;
        previews?: ThemePreviewSource;
        previewsByKey?: string;
        providerKeys?: { keys: string; select: string };
        size?: number;
        step?: number;
        storeClass?: string;
        sunlight?: boolean;
        timeZone?: boolean;
        tone?: "warning" | "info" | "plain";
        type: string;
        visibleWhen?: VisibilityRule | VisibilityRule[];
    }
    Index
    attributes?: Record<string, unknown>
    capabilities?: string[]

    Clay's own per-item filter, resolved against the watch the page was opened from. Names come from Clay's capability map (PLATFORM_GABBRO, BW, HEALTH and so on) and take a NOT_ prefix to invert, so ['NOT_PLATFORM_GABBRO'] drops the item on a round watch and keeps it everywhere else. An item with none declared is always shown.

    defaultValue?: string | number | boolean
    description?: string
    group?: string

    A name Clay's getItemsByGroup finds the item by, for a custom function that works on several items at once.

    hideWhenEmpty?: boolean

    section only: hides the whole card while every row in it is hidden, and shows it again once any row shows. Clay draws a section as a card it cannot hide, so a section whose rows all hide would leave an empty card. dependentVisibility acts on it, and only a section carrying it is hidden. The plugin source page sets it on a section whose rows all hide while a plugin is picked.

    id?: string

    Names the item for Clay's getItemById, for an item a custom function has to reach.

    introWithoutWeather?: string

    The builder's default intro carries the plain wording here. The page takes it in place of the wording that mentions weather when no Weather section is left once the page is folded, such as on a face whose weather comes from a plugin alone. Clay ignores the field.

    items?: ClayConfigItem[]
    label?: string
    messageKey?: string
    moduleOptions?: unknown
    moduleThumbnails?: unknown
    options?: ClayOption[]

    pluginPanel only: what the supported plugins panel lists, every word in it HTML-escaped.

    pluginSource?: { category: string; item: string }

    select only: the Pebble app plugin source this choice can read from instead, by category and item, such as weather and location. A face built with plugin sources adds a "Pebble App: Preferred Source" option to it when a plugin on the phone serves that item. Clay ignores the field, so on any other face the select is left as it is.

    pluginSourceHides?: string

    The messageKey of a pluginSource select this row means nothing under while a plugin is picked, such as the API key row under WEATHER_PROVIDER. A face built with plugin sources hides the row while that select reads from a plugin. Clay ignores the field, so on any other face the row shows as it always does.

    pluginSourceLead?: string

    The messageKey of the provider select this text row leads into, such as the builder's line above WEATHER_PROVIDER. It shows with a plugin choice on offer, so the select stays where the wearer found it, and only a page that takes the select away takes this row with it. Clay ignores the field.

    pluginSourceRows?: string

    The kind of Pebble app plugin data whose notes go straight after this row, by its name in the providers list, such as music, phone, weather, stocks, or calendar. A face built with that kind's plugin define puts the notes for a kind with no source choice here, such as the one saying to turn plugins on. Without the mark they go at the foot of the page. Clay ignores the field.

    themePreview only: the pictures for each option, keyed by the option's value as a string, from the face's theme-previews.g.js or a named map's theme-previews-.g.js. A value is a list of data URLs, drawn side by side, so a theme can carry one picture or a few (such as a day and a night shot). A value can instead be a map keyed by platform, so a round and a rectangular watch each show their own shots. With previewsByKey set, it nests one level deeper, keyed first by the sibling control's value. It can also be a function handing the map back, which the framework calls as the settings page opens. Either way the page gets only the shots for the watch it opens on.

    previewsByKey?: string

    themePreview only: the messageKey of another control on the page whose value picks which set of previews to draw. The previews map then nests, keyed first by that control's value and then by the option's value, so the shots under the picker follow a second choice such as the scene. The named control is read once the page is built, and the preview redraws whenever it changes.

    providerKeys?: { keys: string; select: string }

    An API key row only: the provider select it belongs to, and the key the phone holds for each of that select's providers, written by the phone each time the page opens. The page swaps the row's value as the select changes, as provider-keys-fn.ts covers. Clay ignores the field.

    size?: number

    heading only: how big the heading is, from 1 to 6. Clay draws 4 when none is given.

    step?: number

    slider only: the gap between values. Its decimal places are how far Clay scales the value up for the watch.

    storeClass?: string

    hiddenStore only: the extra class that tells one store on a page from another.

    sunlight?: boolean

    color only: false shows the true colours instead of their washed-out sunlight pair.

    timeZone?: boolean

    Marks a locationsearch item as a time zone picker. It offers zones and plain offsets beside the places, and the phone sends it to the watch as "offset,label" with the offset read off the zone.

    tone?: "warning" | "info" | "plain"

    pluginNote only: warning, the default, with its "!" badge, info for the calmer look, or plain for a select's own description.

    type: string
    visibleWhen?: VisibilityRule | VisibilityRule[]

    Shows this item only while another control holds one of the given values, so a row that does nothing under the current choice is hidden rather than left on the page. One condition, or a list of them that all have to hold. key is a control's messageKey and in the values that reveal this item (a toggle's are true/false), or notIn the values that hide it. An entry can also be { anyOf: [...] }, a list of conditions that holds when any one of them does. The framework wires the showing and hiding when a page has any, ahead of the face's own customClay.