/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { ValueSupervisor } from "#behavior/supervision/ValueSupervisor.js";
import { AsyncObservable, MaybePromise, Transaction } from "#general";
import type { Node } from "#node/Node.js";
import { Message, MessageExchange, SecureSession } from "#protocol";
import { Priority } from "#types";
import { NodeActivity } from "../NodeActivity.js";
export interface RemoteActorContext extends ValueSupervisor.RemoteActorSession {
    /**
     * Override for {@link ValueSupervisor.RemoteActorSession} to specialize the context.
     */
    interactionComplete?: AsyncObservable<[context?: RemoteActorContext]>;
    /**
     * The Matter session in which an interaction occurs.
     */
    session: SecureSession;
    /**
     * The Matter exchange in which an interaction occurs.
     */
    exchange: MessageExchange;
    /**
     * The wire message that initiated invocation.
     */
    message?: Message;
    /**
     * Activity tracking information.  If present, activity frames are inserted at key points for diagnostic
     * purposes.
     */
    activity?: NodeActivity.Activity;
    /**
     * The priority of actions in this context.
     */
    priority?: Priority;
    /**
     * @deprecated use `context.fabric !== undefined` or `hasRemoteActor(context)` to detect a remote actor
     */
    offline?: false;
}
/**
 * The context for operations triggered by an authenticated peer.  Public Matter interactions use this context.
 */
export declare function RemoteActorContext(options: RemoteActorContext.Options): {
    /**
     * Operate on behalf of a remote actor.
     *
     * If the actor changes state, this may return a promise even if {@link actor} does not return a promise.
     */
    act<T>(actor: (context: RemoteActorContext) => MaybePromise<T>): MaybePromise<T>;
    /**
     * Create an online context.
     *
     * This context operates with a {@link Transaction} created via {@link Transaction.open} and the same rules
     * apply for lifecycle management using {@link Transaction.Finalization}.
     */
    open(): RemoteActorContext & Transaction.Finalization;
    /**
     * Begin an operation with a read-only context.
     *
     * A read-only context offers simpler lifecycle semantics than a r/w OnlineContext but you must still close the
     * context after use to properly deregister activity.
     */
    beginReadOnly(): RemoteActorContext & Disposable;
    [Symbol.toStringTag]: string;
};
export declare namespace RemoteActorContext {
    type Options = {
        node: Node;
        exchange: MessageExchange;
        activity?: NodeActivity.Activity;
        command?: boolean;
        timed?: boolean;
        fabricFiltered?: boolean;
        message?: Message;
    };
}
//# sourceMappingURL=RemoteActorContext.d.ts.map