# TextRendererOptions

Interface

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/utils/text-renderer.ts#L9

Output streams and optional memory-usage probe for [TextRenderer](https://api.playcanvas.com/splat-transform/classes/TextRenderer.md).

## Properties

### getPeakCpuMemory

```ts
getPeakCpuMemory?: () => number
```

Optional peak CPU-side memory probe in bytes (monotonic). Used by
the `[peak cpu=X]` overlay gated by the renderer's `mem` field. In
Node this is typically derived from `process.resourceUsage().maxRSS`
(which is kernel-tracked and reflects the whole process - including
ArrayBuffers - rather than just the V8 heap).

### getPeakGpuMemory

```ts
getPeakGpuMemory?: () => number
```

Optional peak GPU memory probe in bytes (monotonic, like
`getPeakCpuMemory`). When supplied alongside `getPeakCpuMemory` and
reporting a non-zero value, the `--memory` overlay gains a `gpu=Y`
entry: `[peak cpu=X gpu=Y]`. Zero suppresses the entry, so runs
that never touch the GPU keep the CPU-only overlay. In the CLI this
is fed by the engine's VRAM counters (see node-device.ts).

### output

```ts
output?: (chunk: string) => void
```

Receives `output` events, one logical unit per call, each already
terminated with `\n` by the renderer. Hand this to the pipeable
channel (typically `process.stdout.write.bind(process.stdout)`).
Defaults to the same sink as `write` when omitted.

### write

```ts
write: (chunk: string) => void
```

Receives all status chunks (scopes, bars, messages). May contain
partial-line writes (e.g. progress-bar `#` ticks). For TTY output,
hand this to a stream that flushes on partials
(`process.stderr.write.bind(process.stderr)` in Node) so bars
render in place. For non-interactive output (CI logs, file
redirects), wrap in a line buffer that holds chunks until a `\n`
arrives - the bar's incremental writes then coalesce into a single
complete line per bar.
