UNPKG

@botonic/plugin-flow-builder

Version:

Botonic plugin for **Hubtype Flow Builder**: run and bridge flow-driven logic from bots on the **current** line.

44 lines (43 loc) 1.8 kB
import { type BotonicContext } from '@botonic/core'; import { type BotonicButtonContent } from '@botonic/shared'; import type { FlowBuilderApi } from '../api'; import { ContentFieldsBase } from './content-fields-base'; import { FlowWebview } from './flow-webview'; import { HtButton, HtButtonStyle, HtRatingButton } from './hubtype-fields'; interface AddButtonToBotonicProps { buttonIndex: number; buttonStyle?: HtButtonStyle; /** Required when this button opens a webview (typically the full {@link BotonicContext}). */ botonicContext?: BotonicContext; } export declare class FlowButton extends ContentFieldsBase { text: string; url?: string; payload?: string; /** Set for Flow Builder rating options — used to order payloads vs CMS storage order. */ ratingValue?: number; target?: string; webview?: { name: string; }; flowWebview?: FlowWebview; params?: Record<string, string>; static fromHubtypeCMS(cmsButton: HtButton, locale: string, cmsApi: FlowBuilderApi): FlowButton; private static getWebviewParams; private static getExitSuccessContentID; static fromAIAgent(button: { id: string; text: string; payload?: string; url?: string; target?: string; }): FlowButton; static fromRating(button: HtRatingButton): FlowButton; static getUrlId(cmsButton: HtButton, locale: string): string | undefined; static getTargetWebview(cmsApi: FlowBuilderApi, targetId: string): FlowWebview | undefined; trackFlow(botonicContext: BotonicContext): Promise<void>; processContent(): Promise<void>; addButtonToBotonic({ buttonIndex, buttonStyle: _buttonStyle, botonicContext, }: AddButtonToBotonicProps): BotonicButtonContent; private getButtonPayload; } export {};