UNPKG

@microsoft/teams.apps

Version:

<p> <a href="https://www.npmjs.com/package/@microsoft/teams.apps" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.apps/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.apps?activeTab=code

31 lines (30 loc) • 1.23 kB
import { TurnState } from './turn-state'; type StateDeleter = () => Promise<void>; /** Conversation and user state loaded for one activity turn. */ export declare class TurnStateContainer { /** State shared by all users in the current conversation. */ readonly conversation: TurnState; /** * State for the current user within the current conversation. * Undefined when the activity has no sender ID. */ readonly user?: TurnState; private readonly deleter?; /** * Creates a loaded state container. * @param conversation Conversation-scoped state. * @param user Optional user-within-conversation state. * @param deleter Optional callback that removes persisted scopes. Normally supplied by the app. */ constructor(conversation: TurnState, user?: TurnState, deleter?: StateDeleter); /** * Deletes both persisted scopes and clears their in-memory snapshots. * * The backing delete must succeed before the in-memory state changes. Values * written after this call are persisted normally at the end of the turn. */ delete(): Promise<void>; /** Seals both scopes after activity processing completes. */ seal(): void; } export {};