UNPKG

@sports-alliance/sports-lib

Version:

A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc

84 lines (83 loc) 3.55 kB
import { DataInterface } from './data.interface'; import { DataAerobicTrainingEffect } from './data-aerobic-training-effect'; import { UserUnitSettingsInterface } from '../users/settings/user.unit.settings.interface'; import { Data } from './data'; export declare class DataTotalTrainingEffectLegacy extends DataAerobicTrainingEffect { static type: string; } /** * Only concrete classes no abstracts */ export declare const DataStore: any; export declare class DynamicDataLoader { private static readonly dataTypeFamilyTriplets; private static readonly jumpSpeedUnitVariantTypes; private static readonly effortPaceUnitVariantTypes; static positionalDataTypes: string[]; static baseDataTypes: string[]; static basicDataTypes: string[]; static advancedDataTypes: string[]; static dataTypeUnitGroups: DataTypeUnitGroups; static speedDerivedDataTypes: string[]; static dataTypeMinDataType: { [type: string]: string; }; static dataTypeMaxDataType: { [type: string]: string; }; static dataTypeAvgDataType: { [type: string]: string; }; static allUnitDerivedDataTypes: string[]; static zoneStatsTypeMap: { type: string; stats: string[]; }[]; static getDataInstanceFromDataType(dataType: string, opts: any): DataInterface; static getDataClassFromDataType(dataType: string): typeof Data; static isUnitDerivedDataType(dataType: string): boolean; static isSpeedDerivedDataType(dataType: string): boolean; static isBlackListedStream(dataType: string): boolean; private static getDistanceUnits; private static getDistanceImperialDataType; private static getDistanceDerivedDataType; private static getJumpSpeedUnitMappings; private static getJumpSpeedUnitDataTypes; private static getJumpSpeedUnitDataFromDataInstance; private static getEffortPaceUnitMappings; private static getEffortPaceUnitDataTypes; private static getEffortPaceUnitDataFromDataInstance; /** * This get's the basic data types for the charts depending or not on the user datatype settings * There are no unit specific datatypes here so if the user has selected pace it implies metric */ static getNonUnitBasedDataTypes(showAllData: boolean, dataTypesToUse: string[]): string[]; /** * This gets the base and extended unit datatypes from a datatype array depending on the user settings * @param dataTypes * @param userUnitSettings */ static getUnitBasedDataTypesFromDataTypes(dataTypes: string[], userUnitSettings?: UserUnitSettingsInterface, options?: { includeDerivedTypes?: boolean; }): string[]; /** * Gets the unitbased types * @param dataType * @param userUnitSettings */ static getUnitBasedDataTypesFromDataType(dataType: string, userUnitSettings?: UserUnitSettingsInterface): string[]; /** * Gets back an array of the unit based data for the data that was asked * For example if the user has for speed selected m/s+km/h doing: * getUnitBasedDataFromData(speedData) will return an array of [DataSpeed, DataSpeedInKilometersPerHour] instances * @param data * @param userUnitSettings * @todo move to solo unit settings eg speed settings */ static getUnitBasedDataFromDataInstance(data: DataInterface, userUnitSettings?: UserUnitSettingsInterface): DataInterface[]; } export interface DataTypeUnitGroups { [type: string]: { [type: string]: (value: number) => number; }; }