pub struct FrameParams<'a> {
pub is_tty: bool,
pub viewport_rows: usize,
pub output: &'a str,
pub output_height: usize,
pub static_output: &'a str,
pub is_unmounting: bool,
pub cursor_dirty: bool,
pub cursor: Option<CursorPos>,
pub interactive: Option<bool>,
pub is_in_ci: bool,
pub debug: bool,
}Expand description
Per-frame inputs to FrameWriter::write_frame.
Each field is an explicit parameter for what ink reads from the stream, the
render result, or process.env, so the writer performs no IO.
Fields§
§is_tty: boolstdout.isTTY — gates fullscreen detection, clear decisions, and sync.
viewport_rows: usizeTerminal height in rows (getWindowSize(stdout).rows). Per-call, not
constructor state: a viewport resize changes it between frames.
output: &'a strThe rendered main output (no trailing newline added yet).
output_height: usizeThe rendered output’s height in rows (outputHeight).
static_output: &'a strNew <Static> output for this frame, or "" when there is none. A bare
"\n" is treated as no static content (ink.tsx:548
staticOutput !== '\n'). Real static output is accumulated into the
writer’s full-static buffer.
is_unmounting: boolWhether this is the final teardown render (this.isUnmounting).
cursor_dirty: boollog.isCursorDirty() — retained on the params for the napi plumbing and
the historical steady-gate contract, but the cursor-RENDER gate now keys
off cursor vs the writer’s previous_cursor_position
(the oracle’s hasChanges is str !== previousOutput || cursorChanged,
log-update.ts:44-53 — cursorDirty itself is NOT in that predicate; it
only selects activeCursor upstream). Defaults false; on every
zero-flicker golden path it is false, so it never opens a gate.
cursor: Option<CursorPos>The ACTIVE cursor for this frame — ink’s
activeCursor = cursorDirty ? cursorPosition : undefined
(log-update.ts:43), resolved by the caller (napi) so the writer only
sees the already-gated value. None mirrors no active cursor. The writer
composes the ink-faithful cursor escape bytes (suffix / cursor-only
sequence / hide) from this against its previous_cursor_position. On
EVERY zero-flicker golden path this is None, which makes every new
cursor branch a provable no-op (cursor_changed = false, all cursor
builders return ""), so the golden bytes are byte-identical.
interactive: Option<bool>interactive option (interactive ?? !isInCi for sync). None defers
to is_in_ci.
is_in_ci: boolCI detection result (ink’s is-in-ci), hoisted out of this crate.
debug: booloptions.debug — plain full-frame mode: no diff, clear, or sync wrap.
Trait Implementations§
Source§impl<'a> Clone for FrameParams<'a>
impl<'a> Clone for FrameParams<'a>
Source§fn clone(&self) -> FrameParams<'a>
fn clone(&self) -> FrameParams<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more