/** * ObjectUI * Copyright (c) 2024-present ObjectStack Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Pure display helpers for person (sys_user) records, shared by the * search-first PeoplePicker's rich rows, the SelectionTray chips, and the * read-only user cell renderer. Kept framework-free so they're trivially * unit-testable and reusable by a future org-tree tier. */ /** Resolve a possibly-dotted path (e.g. `primary_business_unit_id.name`) against a record. */ export declare function resolvePath(record: any, path: string): any; /** Best display name for a person record, tolerating expanded / raw shapes. */ export declare function getPersonName(record: any, nameField?: string): string; /** * Up-to-2-char initials for the avatar fallback. * - "John Doe" → "JD"; "John" → "JO" * - CJK single token → trailing 1–2 chars (given name): "张三" → "张三", "王小明" → "小明" */ export declare function getPersonInitials(name: string): string; /** Secondary line: resolve each field path, drop empties, join with " · ". */ export declare function getPersonSubtitle(record: any, fields?: string[]): string; /** Avatar image URL (defaults to `sys_user.image`); undefined when absent. */ export declare function getPersonAvatarUrl(record: any, avatarField?: string): string | undefined; /** Record id, tolerating `id` / `_id` / a custom id field. */ export declare function getPersonId(record: any, idField?: string): any; /** * Case-insensitive literal-substring match ranges of `query` in `text`, as * `[start, end)` index pairs. Used to highlight the typed term in candidate * rows — a strong disambiguation aid for same-named people. Pinyin matches are * resolved server-side and won't have client ranges; that's fine, the row still * shows, just without a highlight. */ export declare function matchRanges(text: string, query: string): Array<[number, number]>;