/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Behavior } from "#behavior/Behavior.js";
import { Val } from "#behavior/state/Val.js";
import { Diagnostic, Lifecycle, MaybePromise } from "#general";
import type { Agent } from "../Agent.js";
import type { Endpoint } from "../Endpoint.js";
import type { SupportedBehaviors } from "./SupportedBehaviors.js";
/**
 * This class manages {@link Behavior} instances owned by a {@link Endpoint}.
 */
export declare class Behaviors {
    #private;
    /**
     * The {@link SupportedBehaviors} of the {@link Endpoint}.
     */
    get supported(): SupportedBehaviors;
    get status(): Record<string, Lifecycle.Status>;
    get [Diagnostic.value](): Diagnostic[];
    get detailedDiagnostic(): Diagnostic[][];
    constructor(endpoint: Endpoint, options: Record<string, object | undefined>);
    /**
     * Activate any behaviors designated for immediate activation.  Returns a promise iff any behaviors have ongoing
     * initialization.
     *
     * Throws an error if any behavior crashes, but we allow all behaviors to settle before throwing.  The goal is to
     * surface multiple configuration errors and prevent inconsistent state caused by partial initialization.
     */
    initialize(): MaybePromise;
    /**
     * Does the {@link Endpoint} support a specified behavior?
     */
    has<T extends Behavior.Type>(type: T): boolean;
    /**
     * Add behavior support dynamically at runtime.  Typically called via {@link Agent.require}.
     */
    require<T extends Behavior.Type>(type: T, options?: Behavior.Options<T>): void;
    /**
     * Create a behavior synchronously.  Fails if the behavior is not fully initialized.
     */
    createSync(type: Behavior.Type, agent: Agent): Behavior;
    /**
     * Create a behavior asynchronously.  Waits for the behavior to complete initialization.
     */
    createAsync(type: Behavior.Type, agent: Agent): Promise<void>;
    /**
     * Create a behavior, possibly asynchronously.
     *
     * This method returns a {@link Promise} only if await is necessary so the behavior can be used immediately if
     * possible.
     */
    createMaybeAsync(type: Behavior.Type, agent: Agent): MaybePromise<Behavior>;
    /**
     * Activate a behavior.
     *
     * Semantically identical to createAsync() but does not return a {@link Promise} or throw an error.
     *
     * Behaviors that fail initialization will be marked with crashed {@link status}.
     */
    activate(type: Behavior.Type, agent: Agent): void;
    /**
     * Determine if a specified behavior is supported and active.
     */
    isActive(type: Behavior.Type): boolean;
    /**
     * Destroy all behaviors that are initialized (have backings present).  The object may be reused after close.
     */
    close(): Promise<void>;
    /**
     * Ensure a set of behavior requirements are met.  Throws an error detailing missing requirements.
     */
    validateRequirements(requirements?: SupportedBehaviors): void;
    /**
     * Obtain default values for a behavior.  This is state values as present when the behavior is first initialized for
     * a new endpoint.
     */
    defaultsFor(type: Behavior.Type): Val.Struct | undefined;
    /**
     * Access internal state for a {@link Behavior}.
     *
     * Internal state is not stable API and not intended for consumption outside of the behavior.  However it is not
     * truly private and may be accessed by tightly coupled implementation.
     *
     * As this API is intended for use by "friendly" code, it does not perform the same initialization assertions as
     * does access to {@link Behavior.State} and {@link Behavior.Events}.
     */
    internalsOf<T extends Behavior.Type>(type: T): InstanceType<T["Internal"]>;
}
//# sourceMappingURL=Behaviors.d.ts.map