Sports Lib API - v17.3.0
    Preparing search index...

    Interface StreamInterface

    A stream consists of an array of data like this for example AltitudeStream: [100, 110, null, 112, 200, null, 300] The sampling rate of streams is fixed to 1s That means that on the above example the duration is seconds would be: [1,2,3,4,5,6,6]

    null means no value and that means missing data.

    interface StreamInterface {
        type: string;
        clearFilters(): this;
        getData(onlyNumeric?: boolean, filterInfinity?: boolean): (number | null)[];
        getStreamDataByDuration(
            offset?: number,
            onlyNumeric?: boolean,
            filterInfinity?: boolean,
        ): StreamDataItem[];
        getStreamDataByTime(
            startDate: Date,
            onlyNumeric?: boolean,
            filterInfinity?: boolean,
        ): StreamDataItem[];
        hasFilter(): boolean;
        isExportable(): boolean;
        setData(data: (number | null)[]): this;
        toJSON(): StreamJSONInterface;
        useFilter(filter: StreamFilterInterface): this;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    type: string

    Type of the stream. Use a canonical Data*.type string such as Distance or Heart Rate.

    Methods

    • Get's back the streams data as an array

      Parameters

      • OptionalonlyNumeric: boolean
      • OptionalfilterInfinity: boolean

      Returns (number | null)[]

    • Gets the data offset on a time

      Parameters

      • Optionaloffset: number
      • OptionalonlyNumeric: boolean
      • OptionalfilterInfinity: boolean

      Returns StreamDataItem[]

    • Gets the data based / offset on a startDate

      Parameters

      • startDate: Date
      • OptionalonlyNumeric: boolean
      • OptionalfilterInfinity: boolean

      Returns StreamDataItem[]

    • Checks if the speed is exportable

      • It should not be speed derived stream
      • It should not be unit derived stream
      • It should not be GNSS distance and other types on blacklist

      Returns boolean