botbuilder-core
Version:
Core components for Microsoft Bot Builder. Components in this library can run either in a browser or on the server.
35 lines • 1.39 kB
TypeScript
import { BotState } from './botState';
import { Storage } from './storage';
import { TurnContext } from './turnContext';
/**
* Reads and writes conversation state for your bot to storage.
*
* @remarks
* Each conversation your bot has with a user or group will have its own isolated storage object
* that can be used to persist conversation tracking information between turns of the conversation.
* This state information can be reset at any point by calling [clear()](#clear).
*
* ```JavaScript
* const { ConversationState, MemoryStorage } = require('botbuilder');
*
* const conversationState = new ConversationState(new MemoryStorage());
* ```
*/
export declare class ConversationState extends BotState {
private namespace;
/**
* Creates a new ConversationState instance.
*
* @param storage Storage provider to persist conversation state to.
* @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string.
*/
constructor(storage: Storage, namespace?: string);
/**
* Returns the storage key for the current conversation state.
*
* @param context Context for current turn of conversation with the user.
* @returns The storage key for the current conversation state.
*/
getStorageKey(context: TurnContext): string | undefined;
}
//# sourceMappingURL=conversationState.d.ts.map