import * as Iopa from 'iopa'; import type { ActionElement } from 'reactive-dialogs'; interface Db { get(path: string): Promise; put(path: string, item: T): Promise; delete(path: string): Promise; } export interface Session { id: string; updated: number; [key: string]: any; } export interface SessionDbCapability { get(id: string, timeout: number): Promise; put(session: Partial & { id: string; }): any; delete(id: string): any; dispose(): any; } export interface SessionCurrentDialog { id: string; iopaBotVersion: '2.0'; lastDirective: number | null; previousId: string; lastPromptActions: ActionElement[] | null; } export interface ReactiveDialogsSession { 'id': string; 'bot:CurrentDialog': SessionCurrentDialog | null; 'bot:LastDialogEndedDate': number | null; 'bot:NewSession': boolean; 'bot:Skill': string; 'bot:SkillVersion': string; 'bot:Slots': string; 'bot:Variables': any; 'isMultiChoicePrompt': boolean; [key: string]: any; } export declare const useBotSession: (context: Iopa.Context) => [Partial, (newState: Partial) => Promise]; export default class SessionMiddleware implements Iopa.Component { enabled: boolean; app: Iopa.App | null; db: Db | null; constructor(app: Iopa.App); invoke(context: any, next: any): Promise; } export {};