import * as React from 'react'; /** Host i18n translator (react-i18next `t`), as threaded into the columns factory. */ export type Translate = (key: string, options?: any) => string; /** * Declared schema for one column of a jsonb line-items array. Mirrors the * kernel v3 `item_fields` entry the backend serves on the column metadata * (`col.itemFields` / snake `col.item_fields`). When present it drives the * popover mini-table: headers come from `label` (already LOCALIZED by the * backend — never re-translated here) and `ref` columns resolve to the * backend-injected sibling label instead of the raw uuid. */ export interface ItemField { /** jsonb key this column maps to (e.g. `product_id`, `quantity`). */ key: string; /** Header text — ALREADY localized by the backend. Used verbatim. */ label: string; /** Declarative cell type hint (informational; not branched on today). */ type?: string; /** FK target model. When set, the cell renders the resolved sibling label. */ ref?: string; } /** * Localized key label for a popover column header. Resolution order: * (a) host i18n `t(rawKey)` if it resolves to something ≠ rawKey; * (b) the built-in generic es/en data/commerce dictionary; * (c) snake_case → Title Case prettify (`product_id` → "Product ID"). * `locale` defaults to 'en' when absent. */ export declare function prettifyKey(key: string, locale?: string, t?: Translate): string; /** * Localized, pluralized count noun. Prefers the host i18n `t` (react-i18next * count plural via `defaultValue`); otherwise the built-in es/en noun map. */ export declare function countLabel(count: number, locale?: string, t?: Translate): string; /** * Render a single scalar (or near-scalar) value for compact display. * - uuid-like or very long (32+ char) strings → first 8 chars + "…" * - numbers / booleans → rendered as-is (booleans as ✓ / ✗) * - nested object → "{…}", nested array → "[N]" * - null / undefined / "" → "-" */ export declare function formatScalar(value: unknown): string; export interface CollectionCellProps { value: unknown; /** Max items previewed inline for scalar arrays. */ maxInline?: number; /** Org/UI language tag (e.g. `es`, `en-US`). Defaults to `'en'`. */ locale?: string; /** Host i18n translator; takes precedence over the built-in dictionary. */ t?: Translate; /** * Declared schema for the jsonb line-items columns (kernel v3 `item_fields`, * read from `col.itemFields ?? col.item_fields` at the callsite). When * present AND the value is an array of objects, the popover mini-table uses * these (already-localized) headers in order and resolves `ref` columns to * the backend-injected sibling label. Absent → the generic dict/prettify * behaviour is unchanged. */ itemFields?: ItemField[]; /** * Resolves a stored image path to a displayable URL (same resolver the table * columns use). Threaded to the ref-chip thumbnails so resolved line-item * relations show a product photo / logo / avatar like the FK columns do. */ getImageUrl?: (path: string) => string; /** * Presentation mode. * - `'badge'` (default): the compact count/preview badge that opens a * popover with the mini-table / pair-list. Used in dense table cells. * - `'inline'`: render the mini-table / pair-list DIRECTLY, with no badge * or popover. Used by the read-only record detail view, which has full * width and shows one field per row. All schema/locale logic is shared. */ variant?: 'badge' | 'inline'; } /** * Generic renderer for jsonb / array / object cell values. Brand-neutral, * compact, dark-mode friendly, locale-aware. Never throws on unexpected shapes. * * `variant` selects the surface: the default `'badge'` shows a compact trigger * + popover (dense table cells); `'inline'` renders the mini-table / pair-list * directly for the full-width record detail view. Both paths share the * itemFields schema (localized headers + resolved ref labels) and the * locale-aware generic fallback. */ export declare function CollectionCell({ value, maxInline, locale, t, itemFields, getImageUrl, variant, }: CollectionCellProps): React.JSX.Element; //# sourceMappingURL=collection-cell.d.ts.map