import { type APICommand } from '../api-command.js'; import { type SelectFromListConfig, type SelectFromListFlags, SelectOptions } from '../select.js'; export type ListItemPredicate = (value: T, index: number, array: T[]) => boolean; /** * Note that a few functions using this interface don't support all options. Check the * `chooseThing` (e.g. `chooseDevice`) method itself. (If the `chooseThing` is implemented using * `createChooseFn`, it will support all of them, with the exception of `useConfigDefault` * which will work only if the call to `createChooseFn` includes configuration for it via the * `defaultValue` option.) */ export type ChooseOptions = { allowIndex: boolean; verbose: boolean; useConfigDefault: boolean; listItems?: (command: APICommand) => Promise; autoChoose?: boolean; listFilter?: ListItemPredicate; promptMessage?: string; }; export declare const chooseOptionsDefaults: () => ChooseOptions; export declare const chooseOptionsWithDefaults: (options: Partial> | undefined) => ChooseOptions; export type CreateChooseFunctionOptions = { defaultValue?: Omit>['defaultValue'], 'getItem'> & { getItem: (command: APICommand, id: string) => Promise; }; customNotFoundMessage?: string; }; export type ChooseFunction = (command: APICommand, itemIdOrIndexFromArg?: string, options?: Partial>) => Promise; export declare const createChooseFn: (config: SelectFromListConfig, listItems: (command: APICommand) => Promise, createOptions?: CreateChooseFunctionOptions) => ChooseFunction; //# sourceMappingURL=util-util.d.ts.map