@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
66 lines (65 loc) • 2.71 kB
TypeScript
import { DataInterface } from './data.interface';
import { UserUnitSettingsInterface } from '../users/settings/user.unit.settings.interface';
import { Data } from './data';
/**
* Only concrete classes no abstracts
*/
export declare const DataStore: any;
export declare class DynamicDataLoader {
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;
/**
* 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): 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;
};
}