/** * Shared schema builders for TOON table rendering. Each FieldDef is a * projection from a source object (usually a Google API response row) * onto a named column in the output table. * * Usage: * const schema = [ * field("id"), * pluck("creator", "email", "creator_email"), * mapEnum("status", { confirmed: "✓", tentative: "?" }, "unknown"), * lower("visibility"), * ]; * renderList("events", items, schema); */ export interface FieldDef { name: string; extract: (item: Record) => unknown; } export declare function field(name: string): FieldDef; export declare function lower(name: string): FieldDef; export declare function pluck(parent: string, child: string, alias?: string): FieldDef; export declare function mapEnum(name: string, mapping: Record, fallback: string, alias?: string): FieldDef; /** * Compute a field from the whole item. Use for derived values (e.g. * "5/8 attendees confirmed", "tomorrow 2pm"). */ export declare function computed(name: string, fn: (item: Record) => unknown): FieldDef; /** * Truncate a string to `max` chars with ellipsis. Returns the original * value when it's not a string. */ export declare function truncated(name: string, max: number, alias?: string): FieldDef;