use gents_derives::TS;
use logisheets_base::{BlockId, DiyCellId};
use crate::{Appendix, Style, Value, controller::style::Color, style_manager::RawStyle};
#[derive(Debug, Clone, TS)]
#[ts(file_name = "save_file_result.ts", rename_all = "camelCase")]
pub struct SaveFileResult {
pub data: Vec<u8>,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "cell_info.ts", rename_all = "camelCase")]
pub struct CellInfo {
pub value: Value,
pub formula: String,
pub style: Style,
pub block_id: Option<BlockId>,
pub diy_cell_id: Option<DiyCellId>,
pub validation_shadow: Option<Value>,
pub conditional_format: Option<ConditionalFormat>,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "conditional_format.ts", rename_all = "camelCase")]
pub struct ConditionalFormat {
pub style: Style,
pub scale: Option<f64>,
pub data_bar: Option<CfDataBar>,
pub icon: Option<CfIcon>,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "cf_data_bar.ts", rename_all = "camelCase")]
pub struct CfDataBar {
pub color: Color,
pub fraction: f64,
pub show_value: bool,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "cf_icon.ts", rename_all = "camelCase")]
pub struct CfIcon {
pub set: String,
pub index: usize,
pub count: usize,
pub show_value: bool,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "sheet_dimension.ts", rename_all = "camelCase")]
pub struct SheetDimension {
pub max_row: usize,
pub max_col: usize,
pub height: f64,
pub width: f64,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "reproducible_cell.ts", rename_all = "camelCase")]
pub struct ReproducibleCell {
pub coordinate: SheetCoordinate,
pub value: Value,
pub style: RawStyle,
pub appendix: Vec<Appendix>,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "sheet_coordinate.ts", rename_all = "camelCase")]
pub struct SheetCoordinate {
pub row: usize,
pub col: usize,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "cell_ref_range.ts", rename_all = "camelCase")]
pub struct CellRefRange {
pub sheet_idx: usize,
pub start_row: usize,
pub start_col: usize,
pub end_row: usize,
pub end_col: usize,
pub all_rows: bool,
pub all_cols: bool,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "dependent_cell.ts", rename_all = "camelCase")]
pub struct DependentCell {
pub sheet_idx: usize,
pub row: usize,
pub col: usize,
pub via: CellRefRange,
}
#[derive(Debug, Clone, TS)]
#[ts(file_name = "cf_rule_info.ts", rename_all = "camelCase")]
pub struct CfRuleInfo {
pub rule_id: u32,
pub range: String,
pub priority: i32,
pub spec: crate::conditional_formatting_manager::spec::CfRuleSpec,
pub preview: Option<Style>,
}