UNPKG

votcore

Version:

Vot Kit for Valensas Bots

58 lines (57 loc) 2.05 kB
import { Flow } from './../models'; import { Blank, CheckCache, GetIntent, ListCardChoices, ListChoices, ListExamples, PrepareCategoryChoices, SelectChoice, SendMessage } from './actions'; import { CategoriesOptions, IntentCaptureOptions, SelectionExits, SelectionOptions, UnderstoodExits } from './helpers'; /** * Used for capturing intents from incoming messages. */ export declare class IntentCapture extends Flow<UnderstoodExits, IntentCaptureOptions> { entrypoint: string; private withCards(); steps: { getIntent: GetIntent; retryPlease: SendMessage; showExamples: ListExamples; selectMessage: SendMessage; choices: Selection; cardChoices: CardSelection; }; } /** * Selection flow using numbered items. Each message is sent one by one starting with their ids. * Before using this flow, choices key must be set in state. * Choices format { id1: value, id2: value2 } */ export declare class Selection extends Flow<SelectionExits, SelectionOptions> { entrypoint: string; steps: { checkCache: CheckCache; list: ListChoices; selectChoice: SelectChoice; invalidSelection: SendMessage; }; } /** * Selection flow using cards. Each message is sent using a single card. * Before using this flow, choices and cardChoices keys must be set in state. * choices format { id1: value, id2: value2 } * cardChocies format: Card[] * On clicked a card should return id of a choice so that its value is chosen. */ export declare class CardSelection extends Flow<SelectionExits, SelectionOptions> { entrypoint: string; steps: { checkCache: CheckCache; list: ListCardChoices; selectChoice: SelectChoice; invalidSelection: SendMessage; }; } export declare class Categories extends Flow<UnderstoodExits, CategoriesOptions> { entrypoint: string; steps: { entry: Blank; message: SendMessage; prepareCategories: PrepareCategoryChoices; cardChoices: CardSelection; }; }