UNPKG

@webuildbots/webuildbots-sdk

Version:
40 lines (39 loc) 1.67 kB
import Block from '../../interfaces/block'; import { DeepPartial } from '../../helpers/helpers-types'; import { BlockTypes, CommonGroups, VoiceAction } from '../../const/block-enums'; import BlockPointer from '../../interfaces/block-pointer'; 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 BlockBuilder { static DEFAULT_NAME: CommonGroups; static DEFAULT_GROUP: CommonGroups; static VERSION: number; block: DeepPartial<Block>; 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; next(blockId: string): this; addVariable(title: string, value: any): this; onReply(blockId: string, args?: any): this; formFieldCallback(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: BlockPointer): this; alexaPermissionRequired(userInfo: AlexaUserInfo): this; /** * This function will use to build block object * @returns Block */ build(): DeepPartial<Block>; }