@pond-ts/fit API Reference
    Preparing search index...

    Interface PreparedActivity

    The streams decoded once into the per-sample arrays every downstream metric reads — track, columns, cumulative distance, derived speed, relative time. Building the pond track + reading columns is the expensive part of the summary compute, so prepareActivity does it once and both the summary (summaryFromPrepared) and the zoom-resolution profiles (windowChannels) reuse it — no second decode per zoom. Opaque shape; treat it as a handle, not a public data contract.

    interface PreparedActivity {
        coastMasks: Partial<Record<ChannelKey, boolean[]>>;
        cols: TrackColumns;
        cum: Float64Array;
        distanceSource: "pool-lengths" | "gps" | "device" | "none";
        extent: { from: number; to: number };
        hasClock: boolean;
        hasTime: boolean;
        hasTrack: boolean;
        imported: ImportedActivity;
        movingMask?: Uint8Array<ArrayBufferLike>;
        movingRule: MovingRule;
        movingSpans?: readonly (readonly [number, number])[];
        n: number;
        poolLengths?: readonly { from: number; meters: number; to: number }[];
        positionGaps: boolean;
        speed: Float64Array;
        step: Float64Array;
        timeRel: Float64Array;
        track: TrackSeries;
    }
    Index

    Properties

    coastMasks: Partial<Record<ChannelKey, boolean[]>>

    Per-sample sustained-coast mask per output channel (speed/power/cadence), computed ONCE here (it's window-independent and the pond-fill pass is the expensive part) and reused by every channel build / zoom.

    cum: Float64Array
    distanceSource: "pool-lengths" | "gps" | "device" | "none"

    Where the distance axis comes from: a pool swim's lengths, the GPS line, the device's own distance, or nothing.

    extent: { from: number; to: number }

    Where the recording starts and ends on the time axis: the activity's start (or an earlier first sample) to the last sample, widened to a pool swim's recorded lengths. With no timestamps, the sample count.

    hasClock: boolean

    Whether the activity has a time axis at all: its samples' timestamps, or a pool swim's timed lengths and rests (which need no pool size and no samples). Elapsed, moving and swimming time need it.

    hasTime: boolean

    Whether the samples carry timestamps (so speed is meaningful and a sample has a place on the time axis).

    hasTrack: boolean

    Whether the activity has a GPS track. False for GPS-less sources (indoor / GPS-off head units): no map, distance comes from the device stream.

    movingMask?: Uint8Array<ArrayBufferLike>

    For a rule other than speed: per sample i ≥ 1, whether the time before it counts as moving.

    movingRule: MovingRule

    How moving is decided for this activity (see activity/moving.ts).

    movingSpans?: readonly (readonly [number, number])[]

    For a rule other than speed: the stretches that count as moving, in seconds from the start. Moving time is the overlap with them, so a sample gap that is half swimming counts half.

    n: number
    poolLengths?: readonly { from: number; meters: number; to: number }[]

    For a pool swim with a known pool length: each swum length, in seconds from the start, and its distance. A section's distance is then the lengths inside it (a length cut in two counts its share).

    positionGaps: boolean

    Some samples of a GPS track have no fix (NaN in cols.lat).

    speed: Float64Array

    Derived instantaneous speed (m/s); NaN where no timestamp delta.

    step: Float64Array
    timeRel: Float64Array

    Elapsed seconds since the first sample.

    The canonical pond series — always present (GPS or GPS-less). hasTrack says whether it carries positions.