/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { AgentState, TurnContext } from '@microsoft/agents-hosting'; /** * A collection of `AgentState` plugins that should be loaded or saved in parallel as a single unit. * * @remarks * See `AutoSaveStateMiddleware` for an implementation of this class. */ export declare class AgentStateSet { /** * Array of the sets `AgentState` plugins. */ readonly agentStates: AgentState[]; /** * Creates a new AgentStateSet instance. * * @param agentStates One or more AgentState plugins to register. */ constructor(...agentStates: AgentState[]); /** * Registers one or more `AgentState` plugins with the set. * * @param agentStates One or more AgentState plugins to register. * @returns The updated AgentStateSet. */ add(...agentStates: AgentState[]): this; /** * Calls the {@link AgentState.load | AgentState.load method} on all of the AgentState plugins in the set. * * @param context Context for current turn of conversation with the user. * @param force (Optional) If `true` the cache will be bypassed and the state will always be read in directly from storage. Defaults to `false`. * * @remarks * This will trigger all of the plugins to read in their state in parallel. * */ loadAll(context: TurnContext, force?: boolean): Promise; /** * Calls {@link AgentState.saveChanges | AgentState.saveChanges method} on all of the AgentState plugins in the set. * * @param context Context for current turn of conversation with the user. * @param force (Optional) if `true` the state will always be written out regardless of its change state. Defaults to `false`. * * @remarks * This will trigger all of the plugins to write out their state in parallel. */ saveAllChanges(context: TurnContext, force?: boolean): Promise; }