blob: 15d9456d190b06d9759cd3ccb2154e10d674a67e [file] [log] [blame]
// 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;
const MAX_NAME_LENGTH uint32 = 100;
const MAX_CHILD_NAME_LENGTH uint32 = 1024;
const MAX_PATH_LENGTH uint32 = 1024;
const MAX_MONIKER_LENGTH uint32 = 4096;
const MAX_URL_SCHEME_LENGTH uint32 = 100;
alias name = string:MAX_NAME_LENGTH;
alias child_name = string:MAX_CHILD_NAME_LENGTH;
alias url_scheme = string:MAX_URL_SCHEME_LENGTH;
/// Path in a dictionary. The format is similar to a directory path, except no `.` or `..`.
/// is allowed and each path segment must conform to the format of the `name` type.
///
/// The "dirname" (first to the penultimate segment, or empty if there is one
/// segment) represents a sequence of nested dictionaries.
/// The "basename" (last segment) identifies a capability in the last nested
/// dictionary.
@available(added=HEAD)
alias dictionary_path = string:MAX_PATH_LENGTH;
/// `DeliveryType` may be used when declaring a capability, and specifies under
/// what conditions the framework will open the capability from the provider
/// component's outgoing directory when there is a request for this capability.
@available(added=HEAD)
type DeliveryType = flexible enum {
/// The framework will open the capability as soon as some consumer
/// component requests it.
IMMEDIATE = 0;
/// The framework will monitor the `ZX_CHANNEL_READABLE` signal on the
/// server endpoint of connection requests made by the consumer component,
/// and only open the capability from the provider component's outgoing
/// directory when the server endpoint becomes readable.
ON_READABLE = 1;
};