import type { Server } from 'node:http'; import { BasePlugin, PluginImplementation } from '../plugin'; import * as utils from '../utils'; import { BaseBot } from './common'; import { MessageHandlers, EventHandlers, StateExpiredHandlers, HookHandlers, WorkflowHandlers, MessageHandlersMap, EventHandlersMap, StateExpiredHandlersMap, HookHandlersMap, WorkflowHandlersMap, UnimplementedActionHandlers, InjectedBotHandlers, RegisterHandler } from './server'; export type BotImplementationProps = {}> = { register?: RegisterHandler; actions: UnimplementedActionHandlers; plugins: { [K in utils.types.StringKeys]: PluginImplementation; }; }; export declare class BotImplementation = {}> implements InjectedBotHandlers { readonly props: BotImplementationProps; private _registerHandler; private _actionHandlers; private _messageHandlers; private _eventHandlers; private _stateExpiredHandlers; private _hookHandlers; private _workflowHandlers; private _plugins; private _registerOrder; constructor(props: BotImplementationProps); get registerHandler(): RegisterHandler | undefined; get actionHandlers(): InjectedBotHandlers['actionHandlers']; get messageHandlers(): InjectedBotHandlers['messageHandlers']; get eventHandlers(): InjectedBotHandlers['eventHandlers']; get stateExpiredHandlers(): InjectedBotHandlers['stateExpiredHandlers']; get hookHandlers(): InjectedBotHandlers['hookHandlers']; get workflowHandlers(): InjectedBotHandlers['workflowHandlers']; readonly on: { message: >>(type: T, handler: MessageHandlers[T]) => void; event: >>(type: T, handler: EventHandlers[T]) => void; stateExpired: >>(type: T, handler: StateExpiredHandlers[T]) => void; beforeIncomingEvent: ["before_incoming_event"]>>(type: T, handler: HookHandlers["before_incoming_event"][T]) => void; beforeIncomingMessage: ["before_incoming_message"]>>(type: T, handler: HookHandlers["before_incoming_message"][T]) => void; beforeOutgoingMessage: ["before_outgoing_message"]>>(type: T, handler: HookHandlers["before_outgoing_message"][T]) => void; beforeOutgoingCallAction: ["before_outgoing_call_action"]>>(type: T, handler: HookHandlers["before_outgoing_call_action"][T]) => void; /** * # EXPERIMENTAL * This API is experimental and may change in the future. */ beforeIncomingCallAction: ["before_incoming_call_action"]>>(type: T, handler: HookHandlers["before_incoming_call_action"][T]) => void; afterIncomingEvent: ["after_incoming_event"]>>(type: T, handler: HookHandlers["after_incoming_event"][T]) => void; afterIncomingMessage: ["after_incoming_message"]>>(type: T, handler: HookHandlers["after_incoming_message"][T]) => void; afterOutgoingMessage: ["after_outgoing_message"]>>(type: T, handler: HookHandlers["after_outgoing_message"][T]) => void; afterOutgoingCallAction: ["after_outgoing_call_action"]>>(type: T, handler: HookHandlers["after_outgoing_call_action"][T]) => void; /** * # EXPERIMENTAL * This API is experimental and may change in the future. */ afterIncomingCallAction: ["after_incoming_call_action"]>>(type: T, handler: HookHandlers["after_incoming_call_action"][T]) => void; /** * # EXPERIMENTAL * This API is experimental and may change in the future. */ workflowStart: ["started"]>>(type: T, handler: WorkflowHandlers[T]) => void; /** * # EXPERIMENTAL * This API is experimental and may change in the future. */ workflowContinue: ["continued"]>>(type: T, handler: WorkflowHandlers[T]) => void; /** * # EXPERIMENTAL * This API is experimental and may change in the future. */ workflowTimeout: ["timed_out"]>>(type: T, handler: WorkflowHandlers[T]) => void; }; readonly handler: (req: import("../serve").Request) => Promise; readonly start: (port?: number) => Promise; }