/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { type Agent } from "#endpoint/Agent.js";
import type { Endpoint } from "#endpoint/Endpoint.js";
import { Construction, EventEmitter, Lifecycle, MaybePromise, Observable } from "#general";
import type { Behavior } from "../Behavior.js";
import { Reactor } from "../Reactor.js";
import { Datasource } from "../state/managed/Datasource.js";
/**
 * The "backing" for a behavior manages those portions of behavior that endure for the lifetime of an endpoint.
 */
export declare abstract class BehaviorBacking {
    #private;
    get construction(): Construction<BehaviorBacking>;
    constructor(endpoint: Endpoint, type: Behavior.Type, options?: Behavior.Options);
    toString(): string;
    get path(): import("@matter.js/model").DataModelPath;
    /**
     * Initialize state by applying values from options and invoking the behavior's initialize() function.
     *
     * Initiated via {@link Construction#start} by Behaviors class once the backing is installed.
     */
    [Construction.construct](agent: Agent): Promise<void> | undefined;
    /**
     * Destroy the backing.
     */
    close(agent: Agent, invokeClose?: boolean): MaybePromise;
    /**
     * Set state from options and invoke {@link Behavior.invokeInitializer}.
     *
     * This is an optional extension point for derivatives.  Errors thrown here are recorded and place the behavior into
     * crashed state.
     */
    protected invokeInitializer(behavior: Behavior, options?: Behavior.Options): MaybePromise;
    /**
     * The {@link Endpoint} that owns the behavior.
     */
    get endpoint(): Endpoint<import("../../index.js").EndpointType.Empty>;
    /**
     * The {@link Behavior.Type} backed.
     */
    get type(): Behavior.Type;
    /**
     * Create an instance of the backed {@link Behavior}.
     *
     * Derivatives may override to perform additional setup beyond simple instantiation.
     */
    createBehavior(agent: Agent, type: Behavior.Type): Behavior;
    /**
     * The source of raw data that backs managed state instances.
     */
    get datasource(): Datasource<import("../index.js").StateType>;
    protected get datasourceOptions(): Datasource.Options;
    /**
     * The data provider for {@link datasource}.
     */
    protected abstract readonly store?: Datasource.Store;
    /**
     * Obtain internal state for a behavior instance.
     */
    getInternal(): object;
    /**
     * Access the event object.  Unlike state, the events object does not vary by instance.
     */
    get events(): EventEmitter;
    /**
     * The status of the behavior.
     */
    get status(): Lifecycle.Status;
    /**
     * A read-only offline view of behavior state.
     */
    get stateView(): {};
    /**
     * Install a reactor.
     */
    reactTo<O extends Observable<any[], any>>(observable: O, reactor: Reactor<Parameters<O["emit"]>, ReturnType<O["emit"]>>, options?: Reactor.Options): void;
}
//# sourceMappingURL=BehaviorBacking.d.ts.map