import { BasicOptions } from '../buttons/basic'; import { ConstOrPromise } from '../generic-types'; import { GenericPaginationOptions } from '../buttons/pagination'; export declare type Choice = string | number; export declare type ChoiceText = string; export declare type ChoicesArray = readonly Choice[]; export declare type ChoicesRecord = Readonly>; export declare type ChoicesMap = ReadonlyMap; export declare type Choices = ChoicesArray | ChoicesRecord | ChoicesMap; export declare type ChoiceTextFunc = (context: Context, key: string) => ConstOrPromise; export interface ManyChoicesOptions extends BasicOptions, Partial> { /** * Amount of buttons shown per row (side by side). * * Defaults to 6 */ readonly columns?: number; /** * Maximum rows to be shown. * Consider pagination when you have many buttons rather than increasing the amount of buttons as its more user friendly. * * Defaults to 10 */ readonly maxRows?: number; /** * Per default the action (do or set) is only run when the user selected choice does exist. * For this the choices are queried again and has to contain the user selection. * Normally this is useful: Shop offers some drinks and user should only click existing drinks. If some drink isnt in the offer, the menu will be updated to show the current drinks instead of calling the do / set. * * Sometimes this behaviour is not helpful and can be disabled. */ readonly disableChoiceExistsCheck?: boolean; /** * Function which has to return the text the user will see on the button of a given choice */ readonly buttonText?: ChoiceTextFunc; }