import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
import * as better_call from 'better-call';
import { z } from 'zod';
import { b as CMSBackendConfig, S as SerializedContentType, a as SerializedContentItemWithType, I as InverseRelation } from '../../../shared/stack.BsXokfNh.js';

/**
 * CMS backend plugin
 * Provides API endpoints for managing content types and content items
 *
 * @param config - Configuration with content types and optional hooks
 */
declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
    listContentTypes: better_call.StrictEndpoint<"/content-types", {
        method: "GET";
    }, {
        itemCount: number;
        createdAt: string;
        updatedAt: string;
        name: string;
        id: string;
        slug: string;
        description?: string | undefined;
        jsonSchema: string;
        fieldConfig?: string | undefined;
        autoFormVersion?: number | undefined;
    }[]>;
    getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
        method: "GET";
        params: z.ZodObject<{
            slug: z.ZodString;
        }, z.core.$strip>;
    }, SerializedContentType>;
    listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
        method: "GET";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
        }, z.core.$strip>;
        query: z.ZodObject<{
            slug: z.ZodOptional<z.ZodString>;
            limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
            offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
        }, z.core.$strip>;
    }, {
        items: SerializedContentItemWithType<Record<string, unknown>>[];
        total: number;
        limit: number;
        offset: number;
    }>;
    getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
        method: "GET";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
            id: z.ZodString;
        }, z.core.$strip>;
    }, SerializedContentItemWithType<Record<string, unknown>>>;
    createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
        method: "POST";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
        }, z.core.$strip>;
        body: z.ZodObject<{
            slug: z.ZodString;
            data: z.ZodObject<{}, z.core.$loose>;
        }, z.core.$strip>;
    }, {
        parsedData: Record<string, unknown>;
        createdAt: string;
        updatedAt: string;
        id: string;
        slug: string;
        contentTypeId: string;
        data: string;
        authorId?: string | undefined;
    }>;
    updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
        method: "PUT";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
            id: z.ZodString;
        }, z.core.$strip>;
        body: z.ZodObject<{
            slug: z.ZodOptional<z.ZodString>;
            data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
        }, z.core.$strip>;
    }, SerializedContentItemWithType<Record<string, unknown>>>;
    deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
        method: "DELETE";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
            id: z.ZodString;
        }, z.core.$strip>;
    }, {
        success: boolean;
    }>;
    getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
        method: "GET";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
            id: z.ZodString;
        }, z.core.$strip>;
    }, {
        _relations: Record<string, SerializedContentItemWithType<Record<string, unknown>>[]>;
        parsedData: Record<string, unknown>;
        contentType?: SerializedContentType;
        createdAt: string;
        updatedAt: string;
        id: string;
        slug: string;
        contentTypeId: string;
        data: string;
        authorId?: string | undefined;
    }>;
    listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
        method: "GET";
        params: z.ZodObject<{
            typeSlug: z.ZodString;
        }, z.core.$strip>;
        query: z.ZodObject<{
            field: z.ZodString;
            targetId: z.ZodString;
            limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
            offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
        }, z.core.$strip>;
    }, {
        items: SerializedContentItemWithType<Record<string, unknown>>[];
        total: number;
        limit: number;
        offset: number;
    }>;
    getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
        method: "GET";
        params: z.ZodObject<{
            slug: z.ZodString;
        }, z.core.$strip>;
        query: z.ZodObject<{
            itemId: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>;
    }, {
        inverseRelations: InverseRelation[];
    }>;
    listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
        method: "GET";
        params: z.ZodObject<{
            slug: z.ZodString;
            sourceType: z.ZodString;
        }, z.core.$strip>;
        query: z.ZodObject<{
            itemId: z.ZodString;
            fieldName: z.ZodString;
            limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
            offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
        }, z.core.$strip>;
    }, {
        items: SerializedContentItemWithType<Record<string, unknown>>[];
        total: number;
        limit: number;
        offset: number;
    }>;
}>;
type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;

export { cmsBackendPlugin };
export type { CMSApiRouter };
