UNPKG

botui

Version:

Build customizable conversational UIs and bots

27 lines (26 loc) 1.04 kB
import type { Block, BlockData, BlockMeta, BlockManager } from './block.js'; import type { Plugin } from './plugin.js'; import type { ActionInterface } from './action.js'; declare type WaitOptions = { /** * how long should it wait for? in milliseconds * */ waitTime: number; }; export { Block, Plugin, BlockData, BlockMeta, WaitOptions, BlockManager, ActionInterface }; export interface BotuiInterface { message: BlockManager; action: ActionInterface; use(plugin: Plugin): BotuiInterface; next(...args: any[]): BotuiInterface; wait(): Promise<any>; wait(waitOptions: WaitOptions, forwardData?: BlockData, forwardMeta?: BlockMeta): Promise<BlockData>; onChange(state: BlockTypes, callback: CallbackFunction): BotuiInterface; } export declare type CallbackFunction = (...args: any[]) => void; export declare enum BlockTypes { 'ACTION' = "action", 'MESSAGE' = "message" } export declare const BOTUI_BLOCK_TYPES: typeof BlockTypes; export declare const createBot: () => BotuiInterface;