Skip to main content

xl3_core/
output_model.rs

1//! Public output types — mirror the TS / Python sibling APIs so that
2//! `xl3-wasm` and any other host can return the same `OutputFile[]`
3//! shape that `convert()` produces in xl3 (TS) and xl3-py.
4//!
5//! Multi-file split via `output_file_pattern` is a follow-up; the
6//! current renderer always emits exactly one `OutputFile`.
7
8/// A non-fatal note attached to a rendered output. Mirrors xl3 (TS)'s
9/// `XtlWarning` and xl3-py's `XtlWarning`. The renderer does not yet
10/// produce warnings — the field exists so callers can match against
11/// the canonical surface.
12#[derive(Debug, Clone, PartialEq, Eq)]
13pub struct XtlWarning {
14    pub message: String,
15}
16
17/// One rendered XLSX file. The `data` buffer is the raw OOXML bytes
18/// ready to write or transfer over `postMessage`. `filename` comes
19/// from `__config__.output_file_pattern` (after group-key
20/// substitution — currently a no-op for single-file fixtures).
21#[derive(Debug, Clone)]
22pub struct OutputFile {
23    pub filename: String,
24    pub data: Vec<u8>,
25    pub warnings: Vec<XtlWarning>,
26}