blob: c194d56aa47cb6d86606fdbe2cf7392f01aeaa37 [file] [log] [blame] [edit]
// Copyright 2021 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.component.decl;
/// Statically declares a component instance collection.
type Collection = table {
/// The name of the collection. Instances created in the collection are
/// scoped to this name.
1: name name;
/// The durability of instances in the collection.
2: durability Durability;
/// The kinds of offers that can target the child instances in this
/// collection. The default value is `STATIC_ONLY`.
///
/// Only components using the `dynamic_offers` restricted feature may set
/// this field.
4: allowed_offers AllowedOffers;
/// The environment assigned to child instances in this collection.
///
/// Must be non-empty, reference an environment defined in the containing
/// `ComponentDecl`, and contain only the following characters:
/// [a-z0-9-_.].
3: environment name;
};
/// The durability of component instances created in a collection.
type Durability = strict enum {
/// An instance exists until either it or its parent is destroyed.
PERSISTENT = 1;
/// An instance exists until either its parent instance is stopped
/// or it is explicitly destroyed.
TRANSIENT = 2;
/// An instance is started upon creation and is immediately destroyed when
/// it stops.
SINGLE_RUN = 3;
};
/// The kinds of offers that can target the children in a collection.
type AllowedOffers = strict enum {
/// Only static offers may target components in the collection. "Static
/// offers" are the offers in the `ComponentDecl` that target the collection
/// itself.
///
/// This is the default behavior.
STATIC_ONLY = 1;
/// Both static offers and dynamic offers may target components in the
/// collection. "Static offers" are the offers in the `ComponentDecl` that
/// target the collection itself. "Dynamic offers" are additional offers
/// that are passed to `CreateChild` at runtime.
STATIC_AND_DYNAMIC = 2;
};