import type { CopyTextButton } from 'grammy/types'; import type { ActionFunc } from '../action-hive.ts'; import type { ConstOrContextPathFunc, ContextPathFunc } from '../generic-types.ts'; export interface BasicOptions { /** Return true when the button(s) should be hidden and not to be called */ readonly hide?: ContextPathFunc; } interface JoinLastRowOption { /** Decide whether the button should be in the last added row or in a new row. Own row per default, last row when true. */ readonly joinLastRow?: boolean; } export interface SingleButtonOptions extends BasicOptions, JoinLastRowOption { /** Label text on the button */ readonly text: ConstOrContextPathFunc; /** Custom Emoji shown before the text of the button */ readonly icon_custom_emoji_id?: ConstOrContextPathFunc; /** Visual button style */ readonly style?: ConstOrContextPathFunc; } export type ManualButtonOptions = BasicOptions & JoinLastRowOption; export interface CopyTextButtonOptions extends SingleButtonOptions { readonly copy_text: ConstOrContextPathFunc>; } export interface UrlButtonOptions extends SingleButtonOptions { /** Url where this button should be heading */ readonly url: ConstOrContextPathFunc; } export interface SwitchToChatOptions extends SingleButtonOptions { /** Query that is shown next to the bot username. Can be empty ('') */ readonly query: ConstOrContextPathFunc; } export interface InteractionOptions extends SingleButtonOptions { /** Function which is called when the button is pressed */ readonly do: ActionFunc; } export {};