import type { ContentEntryReference, ContentEntryQueryValue } from "../types.js"; /** * Minimal CMS data loader the content-entry resolver depends on. Injected by the * caller (the render layer passes the CMS `contentSdk`) so this module stays * decoupled from `@webiny/cms-sdk`. */ export interface ContentEntryLoader { getEntry(params: { modelId: string; entryId: string; }): Promise; listEntries(params: { modelId: string; sort?: Record; limit?: number; search?: string; after?: string; }): Promise<{ data: unknown[]; meta: { cursor: string | null; hasMoreItems: boolean; totalCount: number; }; }>; } /** * The query params used to produce a page. Embedded in the query result so the * client can fetch further pages (loadMore) from `pageInfo.cursor`. */ export interface ContentEntryQuerySpec { modelId: string; sort?: Record; limit?: number; search?: string; } export interface ResolvedContentEntryQuery { items: T[]; pageInfo: { cursor: string | null; hasMore: boolean; totalCount: number; }; /** Continuation params for loadMore. */ query?: ContentEntryQuerySpec; } /** * The shape passed to a component for a content-entry input: * - manual, single -> the resolved entry (or null) * - manual, list -> an array of resolved entries * - query -> `{ items, pageInfo, query? }` */ export type ResolvedContentEntry = unknown | unknown[] | ResolvedContentEntryQuery | null; /** * Detect whether a raw binding value is a `ContentEntryQueryValue` (query mode) * rather than a manual `ContentEntryReference`. * * Query values carry `modelId` but NOT `id`; manual references carry both. */ export declare function isQueryValue(value: unknown): value is ContentEntryQueryValue; /** * Detect whether a content-entry input's value is already a resolved CMS entry * rather than a bare reference that needs fetching. */ export declare function isAlreadyResolved(value: unknown, list: boolean): boolean; /** * Resolve a content-entry binding value into CMS entries. Works entirely from * the value shape — no component manifest needed. * * - `{ id, modelId }` → fetch single entry * - `[{ id, modelId }, ...]` → fetch multiple entries * - `{ modelId, sort?, limit?, search? }` → list query */ export declare function resolveContentEntryValue(value: ContentEntryReference | ContentEntryReference[] | ContentEntryQueryValue | null | undefined, list: boolean, loader: ContentEntryLoader): Promise;