/** * Shared helper for choosing which field to display (and search on) when * showing an entity's records in list-membership UIs — the Add Records * dialogs and the List form's Items grid. * * Resolution order: * 1. The entity's NameField, when one is defined (display the value alone). * 2. Otherwise the first field that is not a primary key, not a foreign * key, and not an MJ system column (`__mj_*`) — displayed as * " — " so the record stays identifiable. * 3. Otherwise the first non-primary-key field, whatever it is. * 4. Entities with only primary-key fields return null — callers display * the record ID alone. */ import { EntityFieldInfo, EntityInfo } from '@memberjunction/core'; /** The display-field choice for an entity's records in list UIs. */ export interface RecordDisplayFieldInfo { /** The field whose value should be shown; null when only the ID is displayable. */ Field: EntityFieldInfo | null; /** True when Field is the entity's real NameField (display value alone, no ID prefix). */ IsNameField: boolean; } /** * Picks the field to display for an entity's records per the resolution * order documented at the top of this file. */ export declare function GetRecordDisplayField(entityInfo: EntityInfo): RecordDisplayFieldInfo; /** True when the field's SQL type supports a LIKE-based contains search. */ export declare function IsTextSearchableField(field: EntityFieldInfo | null): boolean; /** * Formats a record's display label from its ID and the chosen display * field's value: NameField → the value alone; fallback field → * " — "; no field / empty value → the id. */ export declare function FormatRecordDisplayValue(recordId: string, fieldValue: unknown, displayField: RecordDisplayFieldInfo): string; //# sourceMappingURL=record-display-field.d.ts.map