import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
import * as better_call from 'better-call';
import { z } from 'zod';
import { F as FormBuilderBackendConfig, S as SerializedForm, b as SerializedFormSubmissionWithData } from '../../../shared/stack.DzH_wcvr.js';

/**
 * Form Builder backend plugin
 * Provides API endpoints for managing forms and form submissions
 *
 * @param config - Configuration with optional hooks
 */
declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
    listForms: better_call.StrictEndpoint<"/forms", {
        method: "GET";
        query: z.ZodObject<{
            status: z.ZodOptional<z.ZodEnum<{
                active: "active";
                inactive: "inactive";
                archived: "archived";
            }>>;
            limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
            offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
        }, z.core.$strip>;
    }, {
        items: SerializedForm[];
        total: number;
        limit: number;
        offset: number;
    }>;
    getFormBySlug: better_call.StrictEndpoint<"/forms/:slug", {
        method: "GET";
        params: z.ZodObject<{
            slug: z.ZodString;
        }, z.core.$strip>;
    }, SerializedForm>;
    getFormById: better_call.StrictEndpoint<"/forms/id/:id", {
        method: "GET";
        params: z.ZodObject<{
            id: z.ZodString;
        }, z.core.$strip>;
    }, SerializedForm>;
    createForm: better_call.StrictEndpoint<"/forms", {
        method: "POST";
        body: z.ZodObject<{
            name: z.ZodString;
            slug: z.ZodString;
            description: z.ZodOptional<z.ZodString>;
            schema: z.ZodString;
            successMessage: z.ZodOptional<z.ZodString>;
            redirectUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
            status: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
                active: "active";
                inactive: "inactive";
                archived: "archived";
            }>>>;
        }, z.core.$strip>;
    }, SerializedForm>;
    updateForm: better_call.StrictEndpoint<"/forms/:id", {
        method: "PUT";
        params: z.ZodObject<{
            id: z.ZodString;
        }, z.core.$strip>;
        body: z.ZodObject<{
            name: z.ZodOptional<z.ZodString>;
            slug: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodString>;
            schema: z.ZodOptional<z.ZodString>;
            successMessage: z.ZodOptional<z.ZodString>;
            redirectUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
            status: z.ZodOptional<z.ZodEnum<{
                active: "active";
                inactive: "inactive";
                archived: "archived";
            }>>;
        }, z.core.$strip>;
    }, SerializedForm>;
    deleteForm: better_call.StrictEndpoint<"/forms/:id", {
        method: "DELETE";
        params: z.ZodObject<{
            id: z.ZodString;
        }, z.core.$strip>;
    }, {
        success: boolean;
    }>;
    submitForm: better_call.StrictEndpoint<"/forms/:slug/submit", {
        method: "POST";
        params: z.ZodObject<{
            slug: z.ZodString;
        }, z.core.$strip>;
        body: z.ZodObject<{
            data: z.ZodObject<{}, z.core.$loose>;
        }, z.core.$strip>;
    }, {
        form: {
            successMessage: string | undefined;
            redirectUrl: string | undefined;
        };
        submittedAt: string;
        id: string;
        data: string;
        formId: string;
        submittedBy?: string | undefined;
        ipAddress?: string | undefined;
        userAgent?: string | undefined;
    }>;
    listSubmissions: better_call.StrictEndpoint<"/forms/:formId/submissions", {
        method: "GET";
        params: z.ZodObject<{
            formId: z.ZodString;
        }, z.core.$strip>;
        query: z.ZodObject<{
            limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
            offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
        }, z.core.$strip>;
    }, {
        items: SerializedFormSubmissionWithData<Record<string, unknown>>[];
        total: number;
        limit: number;
        offset: number;
    }>;
    getSubmission: better_call.StrictEndpoint<"/forms/:formId/submissions/:subId", {
        method: "GET";
        params: z.ZodObject<{
            formId: z.ZodString;
            subId: z.ZodString;
        }, z.core.$strip>;
    }, SerializedFormSubmissionWithData<Record<string, unknown>>>;
    deleteSubmission: better_call.StrictEndpoint<"/forms/:formId/submissions/:subId", {
        method: "DELETE";
        params: z.ZodObject<{
            formId: z.ZodString;
            subId: z.ZodString;
        }, z.core.$strip>;
    }, {
        success: boolean;
    }>;
}>;
type FormBuilderApiRouter = ReturnType<ReturnType<typeof formBuilderBackendPlugin>["routes"]>;

export { formBuilderBackendPlugin };
export type { FormBuilderApiRouter };
