ts-garmin 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +358 -0
- package/dist/common/HttpClient.d.ts +22 -0
- package/dist/garmin/GarminConnect.d.ts +76 -0
- package/dist/garmin/UrlClass.d.ts +55 -0
- package/dist/garmin/common/DateUtils.d.ts +3 -0
- package/dist/garmin/common/GpxUtils.d.ts +2 -0
- package/dist/garmin/common/HydrationUtils.d.ts +2 -0
- package/dist/garmin/common/WeightUtils.d.ts +4 -0
- package/dist/garmin/types/activity.d.ts +401 -0
- package/dist/garmin/types/calendar.d.ts +108 -0
- package/dist/garmin/types/gear.d.ts +20 -0
- package/dist/garmin/types/gpx.d.ts +171 -0
- package/dist/garmin/types/heartrate.d.ts +22 -0
- package/dist/garmin/types/hydration.d.ts +17 -0
- package/dist/garmin/types/index.d.ts +353 -0
- package/dist/garmin/types/sleep.d.ts +120 -0
- package/dist/garmin/types/weight.d.ts +50 -0
- package/dist/garmin/types/wellness.d.ts +108 -0
- package/dist/garmin/types/workout.d.ts +56 -0
- package/dist/garmin/workout-builder/duration.d.ts +33 -0
- package/dist/garmin/workout-builder/index.d.ts +5 -0
- package/dist/garmin/workout-builder/step.d.ts +15 -0
- package/dist/garmin/workout-builder/target.d.ts +34 -0
- package/dist/garmin/workout-builder/workout-builder.d.ts +8 -0
- package/dist/garmin/workout-builder/workout-type.d.ts +8 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1511 -0
- package/dist/utils.d.ts +3 -0
- package/package.json +48 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare abstract class Duration {
|
|
2
|
+
abstract build(): Record<string, unknown>;
|
|
3
|
+
}
|
|
4
|
+
export declare class NoDuration extends Duration {
|
|
5
|
+
build(): Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class TimeDuration extends Duration {
|
|
8
|
+
constructor(durationInSeconds: number);
|
|
9
|
+
static hhmmss(h: number, m: number, s: number): TimeDuration;
|
|
10
|
+
static fromHours(h: number): TimeDuration;
|
|
11
|
+
static fromMinutes(m: number): TimeDuration;
|
|
12
|
+
static fromSeconds(s: number): TimeDuration;
|
|
13
|
+
build(): Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare class DistanceDuration extends Duration {
|
|
16
|
+
constructor(meters: number);
|
|
17
|
+
static fromKilometers(km: number): DistanceDuration;
|
|
18
|
+
static fromMeters(m: number): DistanceDuration;
|
|
19
|
+
build(): Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export declare class LapPressDuration extends Duration {
|
|
22
|
+
build(): Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export declare class CaloriesDuration extends Duration {
|
|
25
|
+
constructor(calories: number);
|
|
26
|
+
build(): Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export declare class HeartRateDuration extends Duration {
|
|
29
|
+
constructor(bpm: number, compare: 'gt' | 'lt');
|
|
30
|
+
static greaterThan(bpm: number): HeartRateDuration;
|
|
31
|
+
static lessThan(bpm: number): HeartRateDuration;
|
|
32
|
+
build(): Record<string, unknown>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Duration } from './duration';
|
|
2
|
+
import type { Target } from './target';
|
|
3
|
+
export declare class Step {
|
|
4
|
+
constructor(stepType: StepType, duration?: Duration, target?: Target, notes?: string);
|
|
5
|
+
build(index: number): Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class StepType {
|
|
8
|
+
build(): { stepType: { stepTypeId: number, stepTypeKey: string, displayOrder: number } };
|
|
9
|
+
static WarmUp: StepType;
|
|
10
|
+
static Run: StepType;
|
|
11
|
+
static Recovery: StepType;
|
|
12
|
+
static Rest: StepType;
|
|
13
|
+
static Cooldown: StepType;
|
|
14
|
+
static Other: StepType;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare abstract class Target {
|
|
2
|
+
abstract build(): Record<string, unknown>;
|
|
3
|
+
}
|
|
4
|
+
export declare class NoTarget extends Target {
|
|
5
|
+
build(): Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class PaceTarget extends Target {
|
|
8
|
+
constructor(minPace: number, maxPace: number);
|
|
9
|
+
static pace(paceMinutes: number, paceSeconds: number, margin?: number): PaceTarget;
|
|
10
|
+
build(): Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare class CadenceTarget extends Target {
|
|
13
|
+
constructor(minCadence: number, maxCadence: number);
|
|
14
|
+
static cadence(cadence: number, margin: number): CadenceTarget;
|
|
15
|
+
build(): Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare class HrmZoneTarget extends Target {
|
|
18
|
+
constructor(hrmZone: number);
|
|
19
|
+
build(): Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export declare class HrmTarget extends Target {
|
|
22
|
+
constructor(minHrm: number, maxHrm: number);
|
|
23
|
+
static hrm(hrm: number, margin: number): HrmTarget;
|
|
24
|
+
build(): Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
export declare class PowerZoneTarget extends Target {
|
|
27
|
+
constructor(powerZone: number);
|
|
28
|
+
build(): Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export declare class PowerZone extends Target {
|
|
31
|
+
constructor(minPower: number, maxPower: number);
|
|
32
|
+
static power(power: number, margin: number): PowerZone;
|
|
33
|
+
build(): Record<string, unknown>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IWorkoutDetail } from '../types/index';
|
|
2
|
+
import type { Step } from './step';
|
|
3
|
+
import type { WorkoutType } from './workout-type';
|
|
4
|
+
export declare class WorkoutBuilder {
|
|
5
|
+
constructor(workoutType: WorkoutType, workoutName: string, workoutDescription?: string);
|
|
6
|
+
addStep(step: Step): this;
|
|
7
|
+
build(): IWorkoutDetail;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class WorkoutType {
|
|
2
|
+
build(): { sportType: { sportTypeId: number, sportTypeKey: string, displayOrder: number } };
|
|
3
|
+
static Running: WorkoutType;
|
|
4
|
+
static Cycling: WorkoutType;
|
|
5
|
+
static Swimming: WorkoutType;
|
|
6
|
+
static Strength: WorkoutType;
|
|
7
|
+
static Cardio: WorkoutType;
|
|
8
|
+
}
|
package/dist/index.d.ts
ADDED