import { A as APIEndpoints } from './types-5XdVD2J1.js';

type SiteResponse = NonNullable<APIEndpoints['getSite']['response']>;
type PageResponse = NonNullable<APIEndpoints['getContentByPath']['response']>;
type EntriesResponse = NonNullable<APIEndpoints['listPublishedEntries']['response']>;
type EntryResponse = NonNullable<APIEndpoints['getPublishedEntryPreview']['response']>;
type PublicFormResponse = NonNullable<APIEndpoints['getPublicFormById']['response']>;
type PublicBookingServicesResponse = NonNullable<APIEndpoints['getPublicBookingServices']['response']>;
type PublicEventsResponse = NonNullable<APIEndpoints['listPublicEvents']['response']>;
/**
 * Pagination metadata returned when `includeMeta: true`
 */
interface PaginationMeta {
    /** Total number of entries matching the query (estimated if hasMore is true) */
    total: number;
    /** Whether there are more entries after this page */
    hasMore: boolean;
    /** Number of entries per page */
    limit: number;
    /** Number of entries skipped (offset) */
    offset: number;
    /** Total number of pages (estimated if hasMore is true) */
    totalPages: number;
    /** Current page number (1-indexed) */
    currentPage: number;
}
/**
 * Response type when includeMeta is true - includes pagination metadata
 */
type EntriesResponseWithMeta = {
    entries: EntriesResponse['entries'];
} & PaginationMeta;
/**
 * Base parameters for getEntries - shared across all overloads
 */
interface GetEntriesBaseParams {
    /** The site ID */
    siteId: string;
    /** The content type key (e.g., 'blog-post', 'product') */
    contentType: string;
    /** Maximum number of entries to return (default: 10, max: 50) */
    limit?: number;
    /** Number of entries to skip for pagination */
    offset?: number;
    /** Sort order for entries. 'order' uses custom ordering (default behavior). */
    order?: 'newest' | 'oldest' | 'title' | 'order';
    /** If true, includes draft entries (requires API key with site access) */
    preview?: boolean;
    /** Selection mode: 'query' for automatic, 'manual' for specific entry IDs */
    mode?: 'query' | 'manual';
    /** Entry IDs to fetch when mode is 'manual' */
    entryIds?: string[];
}
/**
 * Configuration for creating a Riverbank CMS client
 */
interface RiverbankClientConfig {
    /**
     * API key for authentication (format: bld_live_... or bld_test_...)
     */
    apiKey: string;
    /**
     * Base URL for the Riverbank CMS API (required; e.g. https://dashboard.example.com/api)
     */
    baseUrl: string;
    /**
     * Cache configuration
     */
    cache?: {
        /**
         * Enable caching (default: true)
         */
        enabled?: boolean;
        /**
         * Time-to-live for cached responses in seconds
         * @default 300 (5 minutes)
         */
        ttl?: number;
        /**
         * Maximum number of cached responses
         * @default 100
         */
        maxSize?: number;
    };
}
/**
 * Riverbank CMS client interface
 */
interface RiverbankClient {
    /**
     * Fetch site data by slug, domain, or ID
     */
    getSite(params: {
        slug?: string;
        domain?: string;
        id?: string;
    }): Promise<SiteResponse>;
    /**
     * Fetch a specific page by path
     *
     * @param params.preview - If true, returns draft content instead of published content (requires API key with site access)
     */
    getPage(params: {
        siteId: string;
        path: string;
        preview?: boolean;
    }): Promise<PageResponse>;
    /**
     * Fetch published content entries with optional pagination, sorting, and preview mode
     *
     * @param params.siteId - The site ID
     * @param params.contentType - The content type key (e.g., 'blog-post', 'product')
     * @param params.limit - Maximum number of entries to return (default: 10, max: 50)
     * @param params.offset - Number of entries to skip for pagination (default: 0)
     * @param params.order - Sort order: 'newest' (published_at desc) or 'oldest' (published_at asc)
     * @param params.preview - If true, includes draft entries (requires API key with site access)
     * @param params.mode - 'query' for automatic fetching, 'manual' for specific entry IDs
     * @param params.entryIds - Array of entry IDs to fetch (only used when mode is 'manual')
     * @param params.includeMeta - If true, returns pagination metadata with the response
     *
     * @example
     * ```ts
     * // Fetch latest 10 blog posts
     * const entries = await client.getEntries({
     *   siteId: 'site-id',
     *   contentType: 'blog-post',
     *   limit: 10,
     *   order: 'newest',
     * });
     *
     * // Fetch page 3 with pagination metadata
     * const page3 = await client.getEntries({
     *   siteId: 'site-id',
     *   contentType: 'blog-post',
     *   limit: 10,
     *   offset: 20,
     *   includeMeta: true,
     * });
     * // page3.entries, page3.total, page3.hasMore, page3.currentPage
     *
     * // Fetch specific entries by ID (manual mode)
     * const specific = await client.getEntries({
     *   siteId: 'site-id',
     *   contentType: 'blog-post',
     *   mode: 'manual',
     *   entryIds: ['uuid-1', 'uuid-2'],
     * });
     * ```
     */
    getEntries(params: GetEntriesBaseParams & {
        /** If true, returns pagination metadata with the response */
        includeMeta?: false;
    }): Promise<EntriesResponse>;
    getEntries(params: GetEntriesBaseParams & {
        /** If true, returns pagination metadata with the response */
        includeMeta: true;
    }): Promise<EntriesResponseWithMeta>;
    getEntries(params: GetEntriesBaseParams & {
        includeMeta?: boolean;
    }): Promise<EntriesResponse | EntriesResponseWithMeta>;
    /**
     * Fetch a specific content entry by slug
     */
    getEntry(params: {
        siteId: string;
        contentType: string;
        slug: string;
    }): Promise<EntryResponse>;
    /**
     * Fetch a public form definition by ID
     */
    getPublicFormById(params: {
        formId: string;
    }): Promise<PublicFormResponse>;
    /**
     * Fetch public booking services for a site
     */
    getPublicBookingServices(params: {
        siteId: string;
        ids?: string;
    }): Promise<PublicBookingServicesResponse>;
    /**
     * List public events for a site (optionally time-filtered)
     */
    listPublicEvents(params: {
        siteId: string;
        limit?: number;
        from?: string;
        to?: string;
        stage?: string;
    }): Promise<PublicEventsResponse>;
    /**
     * Force clear the cache
     */
    clearCache(): void;
}

export type { EntriesResponse as E, PageResponse as P, RiverbankClient as R, SiteResponse as S, RiverbankClientConfig as a, EntryResponse as b, EntriesResponseWithMeta as c, PaginationMeta as d };
