block-obj-builder
Version:
Block object builder
35 lines (34 loc) • 1.56 kB
TypeScript
import BlockObj from '../../objs/block-obj';
import { DeepPartial } from '../../helpers/helpers';
import { BlockTypes, CommonGroups, VoiceAction } from '../../const/block-obj-enums';
import BlockPointerObj from '../../objs/block-pointer-obj';
import { TwilioVerb } from '../../const/twilio-enums';
import { JovoStates } from '../../const/jovo-enums';
import { MessengerMessageTags } from '../../const/messenger-enums';
import { AlexaUserInfo } from '../../const/alexa-enums';
import { Languages } from '../../const/languages-enums';
export default class BlockObjBuilder {
static DEFAULT_NAME: CommonGroups;
static DEFAULT_GROUP: CommonGroups;
obj: DeepPartial<BlockObj>;
constructor();
addTitle(lang: Languages, title: string): this;
name(s: string): this;
group(s: string): this;
module(module: string): this;
description(description: string): this;
type(bt: BlockTypes): this;
blockId(blockId: string): this;
next(blockId: string): this;
onReply(blockId: string, args?: any): this;
formFieldCallback(formId: string, args: any): this;
voiceAction(voiceAction: VoiceAction): this;
twilioVerb(twilioVerb: TwilioVerb): this;
twilioVerbAttributes(verbAttributes: any): this;
twilioGatherRepeats(numRepeats: number): this;
jovoFollowUpState(state: JovoStates): this;
messengerTag(tag: MessengerMessageTags): this;
addIntent(intentName: string, blockPointer: BlockPointerObj): this;
alexaPermissionRequired(userInfo: AlexaUserInfo): this;
build(): DeepPartial<BlockObj>;
}