blob: 208e8a1798cb87a1c770833036ece716f57a9bc1 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.modular;
/// Metadata that define the runtime properties of a Module.
struct ModuleManifest {
/// The relative path from the root of the package where the Module executable
/// file can be found.
/// TODO(MF-94): Extract a module's URL from its cmx manifest instead of
/// here.
string binary;
/// A human-readable string that can be used when suggesting this Module.
string? suggestion_headline;
/// A list of intents that this module is able to handle.
vector<IntentFilter>? intent_filters;
/// Identifies the pattern with which to compose this module with others.
string? composition_pattern;
/// Defines the color of the placeholder widget used while the module loads.
string? placeholder_color;
/// This struct is used to describe an intent that a module is able to handle.
struct IntentFilter {
/// The action this module is able to handle.
string action;
/// Includes the name and types of entities for the parameters required to
/// execute specified [action].
vector<ParameterConstraint> parameter_constraints;
/// Defines presentation properties for suggestions of this action.
ActionDisplay action_display;
struct ParameterConstraint {
string name;
/// The entity type that is valid for this parameter.
string type;
/// Defines how a suggestion of an action will be presented.
table ActionDisplay {
/// Defines presentation fields for a suggestion. The string fields might be
/// templated and will be filled from data in `parameter_mapping`.
/// For example: "Listen to $artistName"
1: DisplayInfo display_info;
/// Fields to be replaced in the given `display_info` templated strings.
/// In the example above, we would map name=artistName to the intent field
/// where artist is the intent parameter name and name a field
/// of it.
2: vector<ParameterMapping> parameter_mapping;
/// Presentation information about the suggestion.
table DisplayInfo {
/// The title of the suggestion.
1: string title;
/// A subtitle for the suggestion.
2: string subtitle;
/// A url from which to fetch the icon of the suggestion.
3: string icon;
/// Defines pairs that will be replaced in the DisplayInfo.
table ParameterMapping {
/// The name of the variable to be replaced in the template.
1: string name;
/// The path in the intent parameter to get that name.
/// The first string in the dot-separated string is the name of the intent
/// parameter and the following are nested subfields.
2: string parameter_property;