Accumulates progress events into the normalized text report: a live current-stage line while a stage runs, a frozen line per finished stage, and a separate before/after Total line.

Stage transitions are inferred from the event stream (a new label closes the previous stage), so the same accumulator works for conway's phases and Share's format-agnostic stages (download/parse/convert/...).

Constructors

Methods

  • The full report: model line (if known), finished stage lines, then the Total line. Call closeCurrentStage() first at load end.

    Returns string[]

    All report lines.

  • Close any open stage (e.g. at load end) and freeze its line. When an end point is given, the stage is extended to it first (a stage ends when the next begins, or when the load finishes).

    Parameters

    • OptionalatElapsedMs: number

      Elapsed ms to extend the stage to before freezing.

    • OptionalatMemoryMb: number

      Heap MB to extend the stage to before freezing.

    Returns undefined | string

    The closed stage's line, if one was open.

  • The live line for the running stage, if any.

    Returns undefined | string

    The current stage's animated line.

  • Lines for finished stages, in completion order.

    Returns string[]

    The frozen stage lines.

  • Feed one progress event; returns the finished stage's line when this event closed a stage (so callers can mirror it to a console/log once).

    Parameters

    Returns undefined | string

    The line for a just-finished stage, if any.

  • Record the model line (from header info) — kept with the report.

    Parameters

    Returns string

    The formatted model line.

  • The separate before/after Total line: overall wall clock and heap observation, not a sum of stages.

    Returns string

    e.g. "Total: 44.7s, 512 → 1110 MB heap"