UNPKG

@bitcobblers/wod-wiki-library

Version:

A specialized markdown-like workout syntax editor and runtime for defining workouts

39 lines (38 loc) 1.49 kB
import { ITimerRuntime } from '../ITimerRuntime'; import { RuntimeMetric } from '../RuntimeMetric'; import { JitStatement } from '../JitStatement'; import { BlockKey } from '../BlockKey'; import { MetricValue } from '../MetricValue'; /** * Unified class for building metrics for runtime blocks. * Uses the latest fragment applyToMetric logic for extensibility and round-awareness. */ export declare class RuntimeBlockMetrics { private statements; constructor(statements?: JitStatement[]); /** * Adds one or more statements to the builder. */ addStatements(statements: JitStatement[]): this; /** * Builds metrics from the collected statements. * Extracts all metric values using applyToMetric on each fragment. * @param blockKey The BlockKey to use for fragment indexing */ build(blockKey: BlockKey): RuntimeMetric[]; /** * Static utility for building metrics from a runtime and statements array. * @param runtime The timer runtime * @param sources Array of JitStatements */ static buildMetrics(runtime: ITimerRuntime, sources: JitStatement[]): RuntimeMetric[]; /** * Extracts all metric values from a statement using applyToMetric on each fragment. * Passes round context to each fragment. */ static extractMetricValues(statement: JitStatement, blockKey: BlockKey): MetricValue[]; /** * Gets a meaningful effort name from a statement. */ private getEffortName; }