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

    Interface FaceProviders

    What the app does with the face's providers.

    interface FaceProviders {
        lists: ProviderLists;
        defaults(
            defaults: Record<string, unknown>,
            narrowed: ClayConfigItem[],
        ): void;
        narrow(config: ClayConfigItem[]): ClayConfigItem[];
        page(config: ClayConfigItem[]): ClayConfigItem[];
        settle(saved: Record<string, unknown>, pages: SettlePages): boolean;
        start(
            options: StartOptions,
            collect: (items: ClayConfigItem[]) => Record<string, unknown>,
        ): Omit<FaceStart, "previewLoaders">;
    }
    Index

    Each kind's list, as the build wrote it, for the features to read through their context.

    • Sets each listed kind's provider default to the first listed custom provider the picker offers, unless the narrowed page already defaults to a listed one. That covers a face that lists a kind but has no picker for it. A plugin only kind gets no default.

      Parameters

      • defaults: Record<string, unknown>

        The defaults the narrowed page declares, by message key. Changed in place.

      • narrowed: ClayConfigItem[]

        The page after the first pass.

      Returns void

    • The second pass. It drops a provider picker left with fewer than two options, with the lead line above it, and takes off the rows the first pass left to place a plugin only kind's notes. A section left with nothing but headings goes with them.

      Parameters

      • config: ClayConfigItem[]

        The settings page so far, the hook's own copy. It is changed in place.

      Returns ClayConfigItem[]

      The page, changed.

    • Brings the saved settings in line with the narrowed page. It rewrites a saved provider the page cannot offer to the default, deletes the saved value of every row the first pass took off, and empties the stock cache when the stock provider the face really uses moves.

      Parameters

      • saved: Record<string, unknown>

        The saved settings, by name. Changed in place.

      • pages: SettlePages

        The face's own page and the narrowed one, with their defaults.

      Returns boolean

      True when it changed the settings, so the caller knows to save them.

    • Gets the face's start ready: the page narrowed, the defaults filled, the saved settings settled and saved when that changed them, and the hooks that run after every feature's.

      Parameters

      • options: StartOptions

        What the face handed startPebbleApp. Its page is never changed.

      • collect: (items: ClayConfigItem[]) => Record<string, unknown>

        The app's own defaults collector, collectDefaults.

      Returns Omit<FaceStart, "previewLoaders">

      What the app starts with.