import { type InputDefinition } from './defs.js'; export type InputDefsByProperty = { [Property in keyof T]: InputDefinition; }; export type ObjectDefOptions = { /** * A summary of the object to display to the user in a list. * * This is required for nested objects whose properties are not rolled up into the parent's * question set. For nested objects whose properties are all rolled up, this can be omitted * as it would not be used anyway. */ summarizeForEdit?: (item: T, context?: unknown[]) => string; /** * Only valid for nested objects. This controls whether the properties in this object * should be queried as a separate sub-object or as more questions in the parent object. * The default is to roll up if this object contains up to three properties. */ rollup?: boolean; helpText?: string; /** * Optional final validation. Most validation should be done on each field as it's entered * or updated but sometimes in a more complex object, a final validation needs to be used. * * Return true if the object is valid or a string error message if not. */ validateFinal?: (item: T, context?: unknown[]) => true | string; }; export type ObjectItemTypeData = { type: 'object'; inputDefsByProperty: InputDefsByProperty; rolledUp: boolean; }; /** * Create a definition for an object. This will most often be the top-level input definition but * it can be used for sub-objects as well. * * The user will be queried for the properties in `inputDefsByProperty` in order. Note that * JavaScript iterates over properties with string keys in _insertion_ order. * (https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order/38218582#38218582) * * If this definition is for a nested object whose properties are not rolled up into the questions * of its parent, you must include `summarizeForEdit` in `options`. * * NOTES: * Calling `updateIfNeeded` on rolled up properties is not yet implemented. */ export declare function objectDef(name: string, inputDefsByProperty: InputDefsByProperty, options?: ObjectDefOptions): InputDefinition; //# sourceMappingURL=object.d.ts.map