blob: c566770452412667424e0dadd3dc7ad9cc805d7e [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.sys2;
using fuchsia.component;
using fuchsia.url;
/// Statically declares a child component instance.
table ChildDecl {
/// The name assigned to the child by its parent.
///
/// Must be non-empty, unique among all siblings, and contain only the
/// following characters: [a-z0-9-_.].
1: fuchsia.component.name name;
/// The child component's URL.
///
/// Must be non-empty and a well-formed URL.
2: fuchsia.url.Url url;
/// The startup mode for the component instance.
3: StartupMode startup;
/// The environment assigned to this child.
///
/// Must be non-empty, reference an environment defined in the containing
/// `ComponentDecl`, and contain only the following characters:
/// [a-z0-9-_.].
4: fuchsia.component.name environment;
// TODO(fxbug.dev/4051): Provide a way to supply parameters to the child, possibly
// as command-line arguments, by URL, or maybe in some other way which is
// orthogonal to other inputs to mitigate confused deputy issues. Perhaps
// as a dictionary like we do for runners?
};
/// Describes under what conditions the component may be started.
enum StartupMode {
/// Start component instance only when another instance binds to it.
LAZY = 0;
/// Start component instance as soon as parent starts. This mode is only
/// supported for statically declared children -- a dynamic instance may only be
/// started by binding to it.
EAGER = 1;
};