import { type SanityClient } from "@sanity/client";
import { type EditorialReference } from "../_vendor/ailf-shared/index.d.ts";
import type { ResolvedSourceConfig } from "../sources.js";
export type { EditorialReference };
export interface SanityConfig {
    apiVersion: string;
    dataset: string;
    perspective?: string[];
    projectId: string;
    token?: string;
    useCdn: boolean;
}
/**
 * Create a Sanity client configured for a specific perspective.
 *
 * Unlike getSanityClient(), this always creates a fresh (uncached) client.
 * Used for perspective diffing — comparing published vs. perspective content.
 *
 * @param perspective - The perspective ID (e.g., "agent-c7OKTk"). Stacked
 *   on top of "published" as [perspectiveId, "published"].
 * @param source - Optional ResolvedSourceConfig for projectId/dataset overrides.
 */
export declare function createPerspectiveClient(perspective: string, source?: ResolvedSourceConfig): SanityClient;
/**
 * Create a Sanity client that reads only published content (no perspectives).
 *
 * Unlike getSanityClient(), this always creates a fresh (uncached) client.
 * Used for perspective diffing — fetching the "before" state.
 *
 * @param source - Optional ResolvedSourceConfig for projectId/dataset overrides.
 */
export declare function createPublishedClient(source?: ResolvedSourceConfig): SanityClient;
/**
 * Create or return a cached Sanity client.
 *
 * When a ResolvedSourceConfig is provided, its projectId, dataset, and perspective
 * override the defaults. For release perspectives, the perspective is
 * passed as a stacked array: [perspectiveId, "published"].
 */
export declare function getSanityClient(overrides?: Partial<SanityConfig>, source?: ResolvedSourceConfig): SanityClient;
/**
 * Get a Sanity client targeting the AILF private dataset.
 *
 * Use this for reads and writes against `ailf.*` document types. The
 * returned client is cached when called without overrides.
 *
 * @param overrides - Per-call config overrides (e.g., explicit token, dataset).
 */
export declare function getAilfSanityClient(overrides?: Partial<SanityConfig>): SanityClient;
/**
 * Reset the cached AILF client. Test-only — call from `beforeEach` when
 * mutating env vars between tests so the cached client doesn't leak.
 */
export declare function resetAilfSanityClientCache(): void;
export interface BuildEditorialReferenceOptions {
    /** Override the editorial-side project ID. Defaults to AILF project. */
    projectId?: string;
    /** Override the editorial dataset. Defaults to `AILF_EDITORIAL_DATASET`. */
    dataset?: string;
    /**
     * Mark the reference as weak. Strongly recommended for any AILF→editorial
     * link — keeps the AILF doc publishable when the target is deleted.
     * Defaults to `true`.
     */
    weak?: boolean;
}
/**
 * Build a Cross Dataset Reference from an AILF document into editorial content,
 * with env-aware defaults for `projectId` / `dataset` so call sites can pass
 * just the `refId` in the common case.
 *
 * Use this for any reference field on an `ailf.*` document that points at an
 * editorial type (`article`, `docPage`, …). The schema-side counterpart is a
 * `crossDatasetReference` field with matching `dataset` and `weak: true`.
 *
 * @example
 *   const docRef = buildEditorialReference(articleId)
 *   // → { _type: "crossDatasetReference", _projectId: "3do82whm",
 *   //     _dataset: "next", _ref: articleId, _weak: true }
 */
export declare function buildEditorialReference(refId: string, options?: BuildEditorialReferenceOptions): EditorialReference;
