import { WebChatActivity, DirectLineAttachment } from 'botframework-webchat-core';
import react__default, { ReactNode } from 'react';
import * as valibot from 'valibot';
import { InferInput } from 'valibot';
import * as react_chain_of_responsibility_preview from 'react-chain-of-responsibility/preview';
import { ComponentHandler, ComponentHandlerResult, ComponentEnhancer, ProviderProps, ProxyProps, ComponentRenderer } from 'react-chain-of-responsibility/preview';

type LegacyAttachmentProps = {
    activity: WebChatActivity;
    attachment: DirectLineAttachment;
};
type LegacyRenderAttachment = (props?: LegacyAttachmentProps) => ReactNode;
type LegacyAttachmentEnhancer = (next: LegacyRenderAttachment) => LegacyRenderAttachment;
type LegacyAttachmentMiddleware = () => LegacyAttachmentEnhancer;

type LegacyActivityProps = {
    children?: never | undefined;
    hideTimestamp: boolean;
    renderActivityStatus: (options: {
        hideTimestamp: boolean;
    }) => ReactNode;
    renderAvatar: false | (() => Exclude<ReactNode, boolean | null | undefined>);
    showCallout: boolean;
};
type LegacyActivityComponent = (props: LegacyActivityProps) => Exclude<ReactNode, boolean | null | undefined>;
type LegacyActivityComponentFactoryOptions = {
    activity: WebChatActivity;
};
type LegacyActivityComponentFactory = (options: LegacyActivityComponentFactoryOptions) => LegacyActivityComponent | false;
type LegacyRenderActivity = (renderAttachment: LegacyRenderAttachment, { hideTimestamp, renderActivityStatus, renderAvatar, showCallout }: LegacyActivityProps) => Exclude<ReactNode, boolean>;
type LegacyActivityRenderer = (options: LegacyActivityComponentFactoryOptions) => LegacyRenderActivity | false;
type LegacyActivityEnhancer = (next: LegacyActivityRenderer) => LegacyActivityRenderer;
type LegacyActivityMiddleware = () => LegacyActivityEnhancer;

type InferenceHelper<Request, Props extends object> = {
    '~types': {
        handler: ComponentHandler<Request, Props>;
        handlerResult: ComponentHandlerResult<Props>;
        middleware: (init: string) => ComponentEnhancer<Request, Props>;
        props: Props;
        providerProps: Pick<ProviderProps<Request, Props, string>, 'children' | 'middleware'>;
        proxyProps: ProxyProps<Request, Props>;
        renderer: ComponentRenderer<Props>;
        request: Request;
    };
};
type InferHandler<T extends InferenceHelper<any, any>> = T['~types']['handler'];
type InferHandlerResult<T extends InferenceHelper<any, any>> = T['~types']['handlerResult'];
type InferMiddleware<T extends InferenceHelper<any, any>> = T['~types']['middleware'];
type InferProps<T extends InferenceHelper<any, any>> = T['~types']['props'];
type InferRenderer<T extends InferenceHelper<any, any>> = T['~types']['renderer'];
type InferRequest<T extends InferenceHelper<any, any>> = T['~types']['request'];

declare const createActivityPolymiddleware: (enhancer: react_chain_of_responsibility_preview.ComponentEnhancer<{
    readonly activity: WebChatActivity;
}, {
    readonly children?: never;
}>) => (init: string) => react_chain_of_responsibility_preview.ComponentEnhancer<{
    readonly activity: WebChatActivity;
}, {
    readonly children?: never;
}>;
declare const Provider: react__default.NamedExoticComponent<{
    readonly children?: react__default.ReactNode | undefined;
    readonly middleware: readonly ((init: string) => react_chain_of_responsibility_preview.ComponentEnhancer<{
        readonly activity: WebChatActivity;
    }, {
        readonly children?: never;
    }>)[];
}> & {
    '~types': {
        handler: react_chain_of_responsibility_preview.ComponentHandler<{
            readonly activity: WebChatActivity;
        }, {
            readonly children?: never;
        }>;
        handlerResult: react_chain_of_responsibility_preview.ComponentHandlerResult<{
            readonly children?: never;
        }>;
        middleware: (init: string) => react_chain_of_responsibility_preview.ComponentEnhancer<{
            readonly activity: WebChatActivity;
        }, {
            readonly children?: never;
        }>;
        props: {
            readonly children?: never;
        };
        providerProps: Pick<react_chain_of_responsibility_preview.ProviderProps<{
            readonly activity: WebChatActivity;
        }, {
            readonly children?: never;
        }, string>, "middleware" | "children">;
        proxyProps: react_chain_of_responsibility_preview.ProxyProps<{
            readonly activity: WebChatActivity;
        }, {
            readonly children?: never;
        }>;
        renderer: react_chain_of_responsibility_preview.ComponentRenderer<{
            readonly children?: never;
        }>;
        request: {
            readonly activity: WebChatActivity;
        };
    };
};
declare const activityComponent: react_chain_of_responsibility_preview.ReactComponentHandlerResult<{
    readonly children?: never;
}>;
declare const useBuildRenderActivityCallback: () => react_chain_of_responsibility_preview.UseBuildRenderCallback<{
    readonly activity: WebChatActivity;
}, {
    readonly children?: never;
}>;
type ActivityPolymiddleware = InferMiddleware<typeof Provider>;
type ActivityPolymiddlewareHandler = InferHandler<typeof Provider>;
type ActivityPolymiddlewareHandlerResult = InferHandlerResult<typeof Provider>;
type ActivityPolymiddlewareProps = InferProps<typeof Provider>;
type ActivityPolymiddlewareRenderer = InferRenderer<typeof Provider>;
type ActivityPolymiddlewareRequest = InferRequest<typeof Provider>;
declare const activityPolymiddlewareProxyPropsSchema: valibot.SchemaWithPipe<readonly [valibot.ObjectSchema<{
    readonly activity: valibot.CustomSchema<Readonly<WebChatActivity>, undefined>;
}, undefined>, valibot.ReadonlyAction<{
    activity: Readonly<WebChatActivity>;
}>]>;
type ActivityPolymiddlewareProxyProps = Readonly<InferInput<typeof activityPolymiddlewareProxyPropsSchema>>;
declare const ActivityPolymiddlewareProxy: react__default.NamedExoticComponent<Readonly<{
    activity: Readonly<WebChatActivity>;
}>>;

declare const createErrorBoxPolymiddleware: (enhancer: react_chain_of_responsibility_preview.ComponentEnhancer<{
    readonly error: unknown;
    readonly where: string;
}, {
    readonly children?: never;
}>) => (init: string) => react_chain_of_responsibility_preview.ComponentEnhancer<{
    readonly error: unknown;
    readonly where: string;
}, {
    readonly children?: never;
}>;
declare const ErrorBoxPolymiddlewareProvider: react__default.NamedExoticComponent<{
    readonly children?: react__default.ReactNode | undefined;
    readonly middleware: readonly ((init: string) => react_chain_of_responsibility_preview.ComponentEnhancer<{
        readonly error: unknown;
        readonly where: string;
    }, {
        readonly children?: never;
    }>)[];
}> & {
    '~types': {
        handler: react_chain_of_responsibility_preview.ComponentHandler<{
            readonly error: unknown;
            readonly where: string;
        }, {
            readonly children?: never;
        }>;
        handlerResult: react_chain_of_responsibility_preview.ComponentHandlerResult<{
            readonly children?: never;
        }>;
        middleware: (init: string) => react_chain_of_responsibility_preview.ComponentEnhancer<{
            readonly error: unknown;
            readonly where: string;
        }, {
            readonly children?: never;
        }>;
        props: {
            readonly children?: never;
        };
        providerProps: Pick<react_chain_of_responsibility_preview.ProviderProps<{
            readonly error: unknown;
            readonly where: string;
        }, {
            readonly children?: never;
        }, string>, "middleware" | "children">;
        proxyProps: react_chain_of_responsibility_preview.ProxyProps<{
            readonly error: unknown;
            readonly where: string;
        }, {
            readonly children?: never;
        }>;
        renderer: react_chain_of_responsibility_preview.ComponentRenderer<{
            readonly children?: never;
        }>;
        request: {
            readonly error: unknown;
            readonly where: string;
        };
    };
};
declare const errorBoxComponent: react_chain_of_responsibility_preview.ReactComponentHandlerResult<{
    readonly children?: never;
}>;
declare const useBuildRenderErrorBoxCallback: () => react_chain_of_responsibility_preview.UseBuildRenderCallback<{
    readonly error: unknown;
    readonly where: string;
}, {
    readonly children?: never;
}>;
type ErrorBoxPolymiddleware = InferMiddleware<typeof ErrorBoxPolymiddlewareProvider>;
type ErrorBoxPolymiddlewareHandler = InferHandler<typeof ErrorBoxPolymiddlewareProvider>;
type ErrorBoxPolymiddlewareHandlerResult = InferHandlerResult<typeof ErrorBoxPolymiddlewareProvider>;
type ErrorBoxPolymiddlewareProps = InferProps<typeof ErrorBoxPolymiddlewareProvider>;
type ErrorBoxPolymiddlewareRenderer = InferRenderer<typeof ErrorBoxPolymiddlewareProvider>;
type ErrorBoxPolymiddlewareRequest = InferRequest<typeof ErrorBoxPolymiddlewareProvider>;
declare const ErrorBoxPolymiddlewareProxyPropsSchema: valibot.SchemaWithPipe<readonly [valibot.ObjectSchema<{
    readonly error: valibot.UnknownSchema;
    readonly where: valibot.StringSchema<undefined>;
}, undefined>, valibot.ReadonlyAction<{
    error: unknown;
    where: string;
}>]>;
type ErrorBoxPolymiddlewareProxyProps = Readonly<InferInput<typeof ErrorBoxPolymiddlewareProxyPropsSchema>>;
declare const ErrorBoxPolymiddlewareProxy: react__default.NamedExoticComponent<Readonly<{
    error: unknown;
    where: string;
}>>;

type Polymiddleware = ActivityPolymiddleware | ErrorBoxPolymiddleware;

declare const polymiddlewareComposerPropsSchema: valibot.SchemaWithPipe<readonly [valibot.ObjectSchema<{
    readonly children: valibot.OptionalSchema<valibot.CustomSchema<react__default.ReactNode, undefined>, undefined>;
    readonly polymiddleware: valibot.SchemaWithPipe<readonly [valibot.CustomSchema<readonly Polymiddleware[], undefined>, valibot.TransformAction<readonly Polymiddleware[], readonly Polymiddleware[]>]>;
}, undefined>, valibot.ReadonlyAction<{
    children?: react__default.ReactNode;
    polymiddleware: readonly Polymiddleware[];
}>]>;
type PolymiddlewareComposerProps = Readonly<InferInput<typeof polymiddlewareComposerPropsSchema>>;
declare function PolymiddlewareComposer(props: PolymiddlewareComposerProps): react__default.JSX.Element;
declare const _default: react__default.MemoExoticComponent<typeof PolymiddlewareComposer>;

export { type ActivityPolymiddleware as A, type ErrorBoxPolymiddleware as E, type LegacyActivityMiddleware as L, type Polymiddleware as P, _default as _, type LegacyAttachmentMiddleware as a, type LegacyRenderAttachment as b, type LegacyActivityComponentFactory as c, type ActivityPolymiddlewareHandler as d, type ActivityPolymiddlewareHandlerResult as e, type ActivityPolymiddlewareProps as f, ActivityPolymiddlewareProxy as g, type ActivityPolymiddlewareProxyProps as h, type ActivityPolymiddlewareRenderer as i, type ActivityPolymiddlewareRequest as j, type ErrorBoxPolymiddlewareHandler as k, type ErrorBoxPolymiddlewareHandlerResult as l, type ErrorBoxPolymiddlewareProps as m, ErrorBoxPolymiddlewareProxy as n, type ErrorBoxPolymiddlewareProxyProps as o, type ErrorBoxPolymiddlewareRenderer as p, type ErrorBoxPolymiddlewareRequest as q, activityComponent as r, createActivityPolymiddleware as s, createErrorBoxPolymiddleware as t, errorBoxComponent as u, useBuildRenderActivityCallback as v, useBuildRenderErrorBoxCallback as w };
