import { z } from '@botpress/sdk';
import { BotClient } from '@botpress/sdk/dist/bot';
import { WorkflowDefinitions } from '../_types/workflows';
import type { ChannelSpec, Channels } from '../_types/channels';
import { Autonomous } from '../runtime/autonomous';
import { ZuiType } from '../types';
import { BaseConversationInstance } from './conversation-instance';
import { Definitions } from './definition';
import { BaseWorkflowInstance } from './workflow-instance';
type WorkflowRequest = {
    [WfName in keyof WorkflowDefinitions & string]: keyof WorkflowDefinitions[WfName]['requests'] extends never ? never : {
        [ReqName in keyof WorkflowDefinitions[WfName]['requests'] & string]: {
            type: `${WfName}:${ReqName}`;
            workflow: BaseWorkflowInstance<WfName>;
            step: string;
        };
    }[keyof WorkflowDefinitions[WfName]['requests'] & string];
}[keyof WorkflowDefinitions & string];
export declare namespace Typings {
    type Message<TChannel extends string> = any;
    type Event<TChannel extends string> = any;
    type ExtractChannel<T extends ChannelSpec> = T extends readonly string[] ? T[number] : T extends '*' ? Channels : T;
    type HandlerProps<TChannelSpec extends ChannelSpec = ChannelSpec, State extends ZuiType = ZuiType> = ({
        type: 'message';
        message: any;
        event?: never;
        workflow?: never;
        request?: never;
    } | {
        type: 'event';
        event: any;
        message?: never;
        workflow?: never;
        request?: never;
    } | {
        type: 'workflow_request';
        event?: never;
        message?: never;
        workflow?: never;
        request: WorkflowRequest;
    }) & {
        conversation: BaseConversationInstance<ExtractChannel<TChannelSpec>>;
        state: z.infer<State>;
        client: BotClient<any>;
        execute: Autonomous.ExecuteFn;
    };
    type Handler<TChannelSpec extends ChannelSpec = ChannelSpec, State extends ZuiType = ZuiType> = (props: HandlerProps<TChannelSpec, State>) => Promise<void> | void;
    type StartFromTrigger<State extends ZuiType = ZuiType> = (event: any) => Promise<string | false> | string | false;
    type Props<TChannelSpec extends ChannelSpec = ChannelSpec, State extends ZuiType = ZuiType> = {
        channel: TChannelSpec;
        handler: Handler<TChannelSpec, State>;
        state?: State;
        startFromTrigger?: StartFromTrigger<State>;
    };
    const Primitive: "conversation";
}
/**
 * Base Conversation definition class.
 * This defines a conversation handler for one or more channels.
 * At runtime, it will be instantiated as a BaseConversationInstance.
 *
 * The generated Conversation class in runtime.d.ts provides proper typing.
 */
export declare class BaseConversation<TChannelSpec extends ChannelSpec = ChannelSpec, State extends ZuiType = ZuiType> implements Definitions.Primitive {
    #private;
    readonly channel: ChannelSpec;
    constructor(props: Typings.Props<TChannelSpec, State>);
}
export {};
//# sourceMappingURL=conversation.d.ts.map