Objects API Reference
This is the API reference for the objects used for the Prompt API Reference methods.
Prompt Input Objects
- ItsPrompt.objects.prompts.type.CompletionDict
A type hint for the
dictstructure used to represent the completion dictionary.
- ItsPrompt.objects.prompts.type.OptionWithId
The OptionWithId tuple is used to store an option, its id and an optional key (for expand prompt).
For all prompts excluding
expand(), the tuple is structured as followsThe first element is the displayed option
The second element is the id of the option
For the
expand()prompt, the tuple is structured as follows:The first element is the key of the option
The second element is the displayed option
The third element is the id of the option
- ItsPrompt.objects.prompts.type.OptionsList
Different types of options that can be used in a prompt.
Can be given by either:
A
str, which is the displayed option and its idA
tuplecontaining the displayed option, its id and an optional key (for expand prompt)A
Separatorinstance
alias of
tuple[str|tuple[str,str,str|None] |Separator, …]
- ItsPrompt.objects.prompts.type.TablePromptDict
A type hint for the
dictstructure used to represent a table prompt.The keys are the column names and the values are the cells in the column.
- ItsPrompt.objects.prompts.type.TablePromptList
A type hint for the
liststructure used to represent a table prompt.Each inner
listrepresents a row in the table.The cells are represented by the
strtype.
Styling Objects
- class ItsPrompt.data.style.PromptStyle(question_mark: str = '', question: str = '', option: str = '', selected_option: str = '', tooltip: str = '', error: str = '', text: str = '', grayout: str = '', disabled: str = '', separator: str = '')[source]
The style object used for styling the prompts.
Empty styles will not be styled, so they appear without any styling.
- ItsPrompt.data.style.create_from_default() PromptStyle[source]
Returns a copy of the
default_stylewhich can be edited without changing the default style.- Returns:
An editable copy of the default style
- Return type:
- ItsPrompt.data.style.default_style = PromptStyle(question_mark='fg:ansigreen', question='', option='', selected_option='fg:ansicyan', tooltip='fg:ansibrightblue bg:ansiwhite bold', error='fg:ansiwhite bg:ansired bold', text='', grayout='fg:ansibrightblack', disabled='fg:ansibrightblack', separator='fg:ansibrightgreen')
The default style for the prompts.