/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { CollectionDefinition, ColumnDefinition } from '@byline/core'; /** * Render a single row cell from a `ColumnDefinition`, reading the value * from the document's `fields` (with a fallback to top-level metadata like * `status`, `updated_at`, `path`). Honours both formatter shapes — plain * function → its return value, `{ component }` → the component is rendered. */ export declare function PickerCell({ column, record, }: { column: ColumnDefinition; record: Record; }): import("react").JSX.Element; /** First top-level `text` field name on a collection, or null. */ export declare function resolveFallbackDisplayField(def: CollectionDefinition | null | undefined): string | null; /** Resolve the row's primary label text from the document. */ export declare function resolveRowLabel(doc: Record | null | undefined, displayField: string | null): string | null; /** * Build the `fields` projection for the picker listing. Unions: * - caller-supplied `displayField` * - target schema's `useAsTitle` (always included, even when not visible) * - every `fieldName` declared in the admin config's `picker` columns * - `title` (metadata fallback for rows with no explicit picker columns) * * Note that the document `path` is top-level metadata on every list response * — it is always returned by `getCollectionDocuments` regardless of the * `fields` projection. Callers that need `{ title, path }` for downstream * normalisation (e.g. the rich-text link plugin) can rely on: * - `record.fields[def.useAsTitle]` for the title * - `record.path` for the path * * Returns `undefined` when no target definition is available, leaving the * listing endpoint to decide its own default projection. */ export declare function resolveSelectFields(def: CollectionDefinition | null | undefined, displayField: string | undefined, pickerColumns: ColumnDefinition[] | undefined, extraFields?: string[]): string[] | undefined;