UNPKG

voxa

Version:

A fsm (state machine) framework for Alexa, Dialogflow, Facebook Messenger and Botframework apps using Node.js

52 lines (51 loc) 1.69 kB
import { GoogleActionsV2SimpleResponse, GoogleCloudDialogflowV2Context, RichResponse } from "actions-on-google"; import { IBag, IVoxaEvent } from "../../VoxaEvent"; import { IVoxaReply } from "../../VoxaReply"; export interface IDialogflowPayload { facebook?: any; google?: any; } export interface IGooglePayload extends IDialogflowPayload { google: { expectUserResponse: boolean; noInputPrompts?: any[]; richResponse?: RichResponse; possibleIntents?: any; expectedInputs?: any; inputPrompt?: any; systemIntent?: any; isSsml?: boolean; userStorage: any; resetUserStorage?: true; }; } export interface ISessionEntityType { name: string; entities: IEntity[]; entityOverrideMode: string; } export interface IEntity { value: string; synonyms: string[]; } export declare class DialogflowReply implements IVoxaReply { outputContexts: GoogleCloudDialogflowV2Context[]; fulfillmentMessages?: any[]; fulfillmentText: string; source: string; payload: IDialogflowPayload; sessionEntityTypes?: ISessionEntityType[]; constructor(); saveSession(attributes: IBag, event: IVoxaEvent): Promise<void>; readonly speech: string; readonly hasMessages: boolean; readonly hasDirectives: boolean; readonly hasTerminated: boolean; clear(): void; terminate(): void; addStatement(statement: string, isPlain?: boolean): void; hasDirective(type: string | RegExp): boolean; addReprompt(reprompt: string): void; protected getRichResponseDirectives(): string[]; protected getSimpleResponse(): GoogleActionsV2SimpleResponse; }