botbuilder-core
Version:
Core components for Microsoft Bot Builder. Components in this library can run either in a browser or on the server.
34 lines • 1.23 kB
TypeScript
import { BotState } from './botState';
import { Storage } from './storage';
import { TurnContext } from './turnContext';
/**
* Reads and writes user state for your bot to storage.
*
* @remarks
* Each user your bot communicates with will have its own isolated storage object that can be used
* to persist information about the user across all of the conversation you have with that user.
*
* ```JavaScript
* const { UserState, MemoryStorage } = require('botbuilder');
*
* const userState = new UserState(new MemoryStorage());
* ```
*/
export declare class UserState extends BotState {
private namespace;
/**
* Creates a new UserState instance.
*
* @param storage Storage provider to persist user 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 user state.
*
* @param context Context for current turn of conversation with the user.
* @returns The storage key for the current user state.
*/
getStorageKey(context: TurnContext): string | undefined;
}
//# sourceMappingURL=userState.d.ts.map