/** * The shared, normalized text rendition of load progress — one format for * the conway CLI, the browser console, and Share's status-bar expando, so a * user pasting either surface produces the same report. Canonical format * spec: Share design/new/load-log-format.md (conway issue #301). * * Deliberately dependency-free (no Logger/Memory/statistics imports): * Share deep-imports this module via the package's `./src/*` export map and * must not drag the engine graph in with it. Inputs are structurally typed * against core/progress.ts's ProgressEvent shape. * * Example output: * * Model: Arty_Z7.stp — AP214, 38.1 MB, SolidWorks 2021 (SwSTEP 2.0) * Parsing [0%................100%] 3.2s, +210 MB heap * Geometry [0%........56%] 41.0s, +388 MB heap * Total: 44.7s, 512 → 1110 MB heap * * Stage lines own only their deltas (duration, heap growth); Total is not * additive — it is a separate before/after wall-clock + heap observation. */ /** What a header parse can tell us before the full file parse (issue #301). */ export interface ModelInfo { fileName?: string; /** e.g. 'IFC4', 'AP214', or a non-STEP format tag like 'GLB' / 'FBX'. */ schema?: string; preprocessorVersion?: string; originatingSystem?: string; byteLength?: number; } /** * Structural subset of core/progress.ts's ProgressEvent that the * accumulator consumes — kept local so this module stays import-free. */ export interface ProgressEventLike { phase: string; completed: number; total?: number; elapsedMs: number; memoryMb?: number; } /** * Display label for a phase, merging headerParse+dataParse into 'Parsing'. * * @param phase The phase identifier. * @return {string} The stage label. */ export declare function stageLabel(phase: string): string; /** * Render the ASCII progress bar: dots grow with percent, e.g. * "[0%........56%]", completing as "[0%................100%]". * Indeterminate (no percent) renders "[...]". * * @param percent Percent complete 0-100, or undefined when indeterminate. * @return {string} The rendered bar. */ export declare function formatBar(percent?: number): string; /** * One decimal place of seconds, e.g. "3.2s". * * @param milliseconds Elapsed milliseconds. * @return {string} The formatted duration. */ export declare function formatSeconds(milliseconds: number): string; /** * Format a memory value in MB to byte precision (6 decimals). * * @param megabytes The value in MB. * @return {string} e.g. "720.000000" */ export declare function formatMb(megabytes: number): string; /** * The early model line from header-parse info — printable before the full * file parse (issue #301 follow-up, log line 3). * * @param info The model header info. * @return {string} e.g. "Model: Arty_Z7.stp — AP214, 38.1 MB, * SolidWorks 2021 (SwSTEP 2.0)" */ export declare function formatModelLine(info: ModelInfo): string; /** * 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/...). */ export declare class LoadLogAccumulator { private readonly finished_; private current_; private firstElapsedMs_; private lastElapsedMs_; private firstHeapMb_; private lastHeapMb_; private modelLine_; /** * Record the model line (from header info) — kept with the report. * * @param info The model header info. * @return {string} The formatted model line. */ setModelInfo(info: ModelInfo): string; /** * 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). * * @param event The progress event. * @return {string | undefined} The line for a just-finished stage, if any. */ onProgress(event: ProgressEventLike): string | undefined; /** * 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). * * @param atElapsedMs Elapsed ms to extend the stage to before freezing. * @param atMemoryMb Heap MB to extend the stage to before freezing. * @return {string | undefined} The closed stage's line, if one was open. */ closeCurrentStage(atElapsedMs?: number, atMemoryMb?: number): string | undefined; /** * The live line for the running stage, if any. * * @return {string | undefined} The current stage's animated line. */ currentLine(): string | undefined; /** * Lines for finished stages, in completion order. * * @return {string[]} The frozen stage lines. */ finishedLines(): string[]; /** * The separate before/after Total line: overall wall clock and heap * observation, not a sum of stages. * * @return {string} e.g. "Total: 44.7s, 512 → 1110 MB heap" */ totalLine(): string; /** * The full report: model line (if known), finished stage lines, then the * Total line. Call closeCurrentStage() first at load end. * * @return {string[]} All report lines. */ allLines(): string[]; } //# sourceMappingURL=progress_log.d.ts.map