import type { Component, CSSProperties, Icon } from "@agyemanjp/fxui"; import type { FilterSingle, Rec, RecordFilter, StdError, Tuple } from "@agyemanjp/standard"; export type RecordViewerUI = Component<{ record: T; commands: (CommandInfo | undefined)[]; possibleValsDict: PossibleValsDict; style?: CSSProperties; children?: never; }>; export type RecordEditorUI = Component<{ /** The record to edit */ record: Partial; commands: (CommandInfo | undefined)[]; lastError?: string; possibleValsDict: PossibleValsDict; style?: CSSProperties; children?: never; }>; export type RecordsFilterUI = Component<{ filter?: RecordFilter; applyCommand?: CommandInfo[]>; lastError?: string; possibleValsDict: PossibleValsDict; style?: CSSProperties; children?: never; }>; export type PossibleValsDict = { [k in keyof T]?: Tuple[]; }; export type CommandInfo = [ caption: string, icon: Icon | undefined, action: (record: T) => Promise ]; /** Get the effective name of an input element, by combining its field name with a form id for * indicating which group/form of inputs it belongs to */