import type { SiteClient, ResolvedMedia, MediaInput } from './site.js';
import type { ActuateDB } from './db/client-types.js';
/**
 * Server-only Site client that reads from the database directly.
 *
 * Use this in Server Components, `generateMetadata`, route loaders, and
 * anywhere else you would otherwise be tempted to call `createSiteClient()`
 * with a relative URL (which throws under bare Node `fetch`).
 *
 *   import { PrismaClient } from '@/generated/prisma'
 *   import { createServerSiteClient } from '@actuate-media/cms-core'
 *   import config from '@/actuate.config'
 *
 *   const prisma = new PrismaClient()
 *   const cms = createServerSiteClient(prisma, config)
 *
 *   const settings = await cms.getGlobal('settings')
 *
 * Benefits over the fetch-based client in Server Components:
 *   - Zero self-fetch overhead (one DB roundtrip instead of HTTP).
 *   - No `NEXT_PUBLIC_SITE_URL` plumbing required.
 *   - Works under bare Node, Edge runtime with Prisma Accelerate, or any
 *     Prisma-compatible client.
 *   - Bypasses Next.js fetch caching pitfalls on Server Components.
 */
export interface CmsConfigLike {
    /** Map of global slug → global definition. `access.read` is consulted before returning data. */
    globals?: Record<string, {
        access?: {
            read?: (ctx: {
                user: null;
                doc: any;
            }) => boolean | Promise<boolean>;
        };
    }>;
    /** Map of collection slug → collection definition (used by `resolveDocument`). */
    collections?: Record<string, {
        slug?: string;
        type?: string;
        urlPrefix?: string;
    }>;
}
export interface ServerSiteClient extends SiteClient {
    /** Resolve any media-like value into a normalized shape, looking up by id from the DB when needed. */
    resolveMedia(value: MediaInput): Promise<ResolvedMedia | null>;
}
/**
 * Build the server-side Site client. The supplied `db` only needs a tiny
 * subset of the Prisma surface (`document`, `media`) — that lets us accept
 * generated PrismaClient instances from any consumer schema without forcing
 * a hard type dependency.
 */
export declare function createServerSiteClient(db: ActuateDB, config?: CmsConfigLike): ServerSiteClient;
export { normalizeMedia, resolveMedia } from './site.js';
//# sourceMappingURL=server-site.d.ts.map