import ApiSubset from '../ApiSubset'; import { FlowIntentAction, FlowSessionAction, DialogTypes, FFIFunctionCall, HermesOptions } from '../types'; import * as enums from '../types/enums'; /** * The Dialog API subset. */ export default class Dialog extends ApiSubset { constructor(protocolHandler: Buffer, call: FFIFunctionCall, options: HermesOptions); private activeSessions; publishEvents: { start_session: { fullEventName: string; }; continue_session: { fullEventName: string; }; end_session: { fullEventName: string; }; configure: { fullEventName: string; }; }; publishMessagesList: DialogTypes.publishMessagesList; subscribeEvents: { 'intent/': { fullEventName: string; additionalArguments: (eventName: any) => Buffer[]; }; intents: { fullEventName: string; }; intent_not_recognized: { fullEventName: string; }; session_ended: { fullEventName: string; }; session_queued: { fullEventName: string; }; session_started: { fullEventName: string; }; }; subscribeMessagesList: DialogTypes.subscribeMessagesList; destroy(): void; /** * Sets a dialog flow up. * * @param intent - Starting intent name. * @param action - Action to perform when the starting intent is triggered. */ flow(intent: string, action: FlowIntentAction): void; /** * Sets a dialog flow up with multiple starting intents. * * @param intents - An array of { intent, action } objects. */ flows(intents: { intent: string; action: FlowIntentAction; }[]): void; /** * Creates a dialog flow that will trigger when the target session starts. * Useful when initiating a session programmatically. * * @param id : An id that should match the customData field of the started session. * @param action : The action to execute on session startup. */ sessionFlow(id: string, action: FlowSessionAction): void; /** * Dialog enumerations. */ static enums: { grain: typeof enums.grain; precision: typeof enums.precision; initType: typeof enums.initType; terminationType: typeof enums.terminationType; slotType: typeof enums.slotType; }; }