import { type BooleanInputOptions, type IntegerInputOptions, type DefaultValueOrFn, type OptionalStringInputOptions, type ValidateFunction } from '../../lib/user-query.js'; import { type InputDefinition, type InputDefinitionDefaultValueOrFn, type InputDefinitionValidateFunction } from '../../lib/item-input/defs.js'; export declare const validateWithContextFn: (validate?: InputDefinitionValidateFunction, context?: unknown[]) => ValidateFunction | undefined; export declare const defaultWithContextFn: (def?: InputDefinitionDefaultValueOrFn, context?: unknown[]) => DefaultValueOrFn | undefined; export type StringDefOptions = Omit & { default?: InputDefinitionDefaultValueOrFn; validate?: InputDefinitionValidateFunction; }; export declare const optionalStringDef: (name: string, options?: StringDefOptions) => InputDefinition; export declare const stringDef: (name: string, options?: StringDefOptions) => InputDefinition; export type NumberDefOptions = Omit, 'default'> & { default?: InputDefinitionDefaultValueOrFn; }; export declare const optionalIntegerDef: (name: string, options?: NumberDefOptions) => InputDefinition; export declare const integerDef: (name: string, options?: NumberDefOptions) => InputDefinition; export type BooleanDefOptions = BooleanInputOptions; export declare const booleanDef: (name: string, options?: BooleanDefOptions) => InputDefinition; /** * Use a static definition if you only need a hard-coded value for a given field. The user will * never be asked or notified and the value specified will be used. */ export declare const staticDef: (value: T) => InputDefinition; export declare const undefinedDef: InputDefinition; export declare const computedDef: (compute: (context?: unknown[]) => T) => InputDefinition; export type ListSelectionDefOptions = { /** * A summary of the object to display to the user in a list. * * The default is `stringFromUnknown`. */ summarizeForEdit?: (item: T, context?: unknown[]) => string; default?: T; helpText?: string; }; /** * Create an `InputDefinition` for selecting items from a list. */ export declare const listSelectionDef: (name: string, validItems: T[], options?: ListSelectionDefOptions) => InputDefinition; export type OptionalDefPredicateFn = (context?: unknown[]) => boolean; export type OptionalDefOptions = { /** * When using an `optionalDef` for an update, include this to indicate whether an optional * def is active at the start or not. */ initiallyActive?: boolean; }; /** * Given an `InputDefinition`, `inputDef`, for type `T` and a predicate, checkIsActive, create a new * `InputDefinition` for type `T | undefined` that always resolves to `undefined` without consulting * the user if the predicate returns false. If the predicate returns true, the provided * `InputDefinition` is used to retrieve the value from the user. * * NOTES: * - We don't save any previously entered value for if the predicate starts returning `false` * after previously returning `true`. This could be implemented at a future date if it we decide * it would be useful. */ export declare const optionalDef: (inputDef: InputDefinition, checkIsActive: OptionalDefPredicateFn, options?: OptionalDefOptions) => InputDefinition; //# sourceMappingURL=misc.d.ts.map