//! ref: composer/src/Composer/IO/IOInterface.php use crate::config::Config; use indexmap::IndexMap; use shirabe_external_packages::psr::log::logger_interface::LoggerInterface; use shirabe_php_shim::PhpMixed; pub const QUIET: i64 = 1; pub const NORMAL: i64 = 2; pub const VERBOSE: i64 = 4; pub const VERY_VERBOSE: i64 = 8; pub const DEBUG: i64 = 16; pub trait IOInterface: LoggerInterface { fn is_interactive(&self) -> bool; fn is_verbose(&self) -> bool; fn is_very_verbose(&self) -> bool; fn is_debug(&self) -> bool; fn is_decorated(&self) -> bool; fn write(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); fn write_error(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); fn write_raw(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); fn write_error_raw(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); fn overwrite(&mut self, messages: PhpMixed, newline: bool, size: Option, verbosity: i64); fn overwrite_error( &mut self, messages: PhpMixed, newline: bool, size: Option, verbosity: i64, ); fn ask(&mut self, question: String, default: PhpMixed) -> PhpMixed; fn ask_confirmation(&mut self, question: String, default: bool) -> bool; fn ask_and_validate( &mut self, question: String, validator: Box PhpMixed>, attempts: Option, default: PhpMixed, ) -> PhpMixed; fn ask_and_hide_answer(&mut self, question: String) -> Option; fn select( &mut self, question: String, choices: Vec, default: PhpMixed, attempts: PhpMixed, error_message: String, multiselect: bool, ) -> PhpMixed; fn get_authentications(&self) -> IndexMap>>; fn has_authentication(&self, repository_name: &str) -> bool; fn get_authentication(&self, repository_name: &str) -> IndexMap>; fn set_authentication( &mut self, repository_name: String, username: String, password: Option, ); fn load_configuration(&mut self, config: &mut Config) -> anyhow::Result<()>; }