/**
 * Reference Widget Loaders
 *
 * Canonical, environment-agnostic data fetchers for each built-in reference kind.
 * Both the dashboard reference adapter map (`apps/dashboard/src/lib/block-form/referenceAdapters.tsx`)
 * and the preview-next reference adapter map (`packages/preview-next/src/client/widgets/widgetAdapters.ts`)
 * compose these loaders with their own labels, manage-links, caching, and error wrapping.
 *
 * Adding a new `BUILT_IN_REFERENCE_KIND` requires adding a loader here and an entry in
 * `referenceLoaders`. Both gates are enforced by TypeScript and a runtime parity test.
 *
 * Each loader takes the request shape `{ apiClient, siteId }` and returns a
 * `ReferenceWidgetItem[]` ready for the picker UI. Loaders throw raw errors —
 * environment-specific error wrapping (e.g. `toUserFacingError`) happens at the
 * composition layer.
 */
import type { ApiClient } from '@riverbankcms/api/request';
import type { BuiltInReferenceKind } from '@riverbankcms/content-model';
import type { SiteId } from '@riverbankcms/core';
import type { ReferenceWidgetItem } from './types';
export interface ReferenceLoaderArgs {
    apiClient: ApiClient;
    siteId: SiteId;
}
export type ReferenceLoader<K extends BuiltInReferenceKind = BuiltInReferenceKind> = ((args: ReferenceLoaderArgs) => Promise<ReferenceWidgetItem[]>) & Readonly<{
    referenceKind: K;
}>;
export type ReferenceLoaderMap = {
    readonly [K in BuiltInReferenceKind]: ReferenceLoader<K>;
};
export declare const loadPostReferenceItems: ReferenceLoader<"post">;
export declare const loadFormReferenceItems: ReferenceLoader<"form">;
export declare const loadBookingFormReferenceItems: ReferenceLoader<"bookingForm">;
export declare const loadAppointmentServiceReferenceItems: ReferenceLoader<"appointmentService">;
export declare const loadAppointmentResourceReferenceItems: ReferenceLoader<"appointmentResource">;
export declare const loadPageReferenceItems: ReferenceLoader<"page">;
export declare const loadNewsletterListReferenceItems: ReferenceLoader<"newsletterList">;
/**
 * Typed map keyed by `BuiltInReferenceKind`. Adding a new built-in kind fails to
 * compile here. The `satisfies` form preserves the literal's inferred shape while
 * still enforcing that every `BuiltInReferenceKind` has a loader and that no
 * extraneous keys are present. The parity test in `loaders.test.ts` is the
 * defense-in-depth against someone widening this annotation to `Record<string, …>`.
 */
export declare const referenceLoaders: {
    readonly post: ReferenceLoader<"post">;
    readonly form: ReferenceLoader<"form">;
    readonly bookingForm: ReferenceLoader<"bookingForm">;
    readonly appointmentService: ReferenceLoader<"appointmentService">;
    readonly appointmentResource: ReferenceLoader<"appointmentResource">;
    readonly page: ReferenceLoader<"page">;
    readonly newsletterList: ReferenceLoader<"newsletterList">;
};
