incyclist-services 1.7.76 → 1.7.78

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.
Files changed (66) hide show
  1. package/lib/cjs/activities/list/service.js +1 -1
  2. package/lib/cjs/activities/ride/service.js +2 -1
  3. package/lib/cjs/workouts/base/graph/index.js +18 -0
  4. package/lib/cjs/workouts/base/graph/series.js +205 -0
  5. package/lib/cjs/workouts/base/graph/types.js +2 -0
  6. package/lib/cjs/workouts/base/model/index.js +0 -1
  7. package/lib/cjs/workouts/calendar/service.js +14 -0
  8. package/lib/cjs/workouts/index.js +2 -0
  9. package/lib/cjs/workouts/list/cards/index.js +0 -1
  10. package/lib/cjs/workouts/list/index.js +0 -1
  11. package/lib/cjs/workouts/list/pageService.js +362 -5
  12. package/lib/cjs/workouts/list/service.js +39 -12
  13. package/lib/cjs/workouts/page/index.js +17 -0
  14. package/lib/cjs/workouts/page/service.js +455 -0
  15. package/lib/cjs/workouts/page/types.js +2 -0
  16. package/lib/cjs/workouts/ride/index.js +1 -0
  17. package/lib/cjs/workouts/ride/page/index.js +18 -0
  18. package/lib/cjs/workouts/ride/page/service.js +498 -0
  19. package/lib/cjs/workouts/ride/page/types.js +2 -0
  20. package/lib/cjs/workouts/ride/service.js +1 -1
  21. package/lib/cjs/workouts/types.js +2 -0
  22. package/lib/esm/activities/list/service.js +1 -1
  23. package/lib/esm/activities/ride/service.js +2 -1
  24. package/lib/esm/workouts/base/graph/index.js +2 -0
  25. package/lib/esm/workouts/base/graph/series.js +197 -0
  26. package/lib/esm/workouts/base/graph/types.js +1 -0
  27. package/lib/esm/workouts/base/model/index.js +0 -1
  28. package/lib/esm/workouts/calendar/service.js +14 -0
  29. package/lib/esm/workouts/index.js +2 -0
  30. package/lib/esm/workouts/list/cards/index.js +0 -1
  31. package/lib/esm/workouts/list/index.js +0 -1
  32. package/lib/esm/workouts/list/pageService.js +362 -5
  33. package/lib/esm/workouts/list/service.js +39 -12
  34. package/lib/esm/workouts/page/index.js +1 -0
  35. package/lib/esm/workouts/page/service.js +451 -0
  36. package/lib/esm/workouts/page/types.js +1 -0
  37. package/lib/esm/workouts/ride/index.js +1 -0
  38. package/lib/esm/workouts/ride/page/index.js +2 -0
  39. package/lib/esm/workouts/ride/page/service.js +494 -0
  40. package/lib/esm/workouts/ride/page/types.js +1 -0
  41. package/lib/esm/workouts/ride/service.js +1 -1
  42. package/lib/esm/workouts/types.js +1 -0
  43. package/lib/types/types.d.ts +1 -0
  44. package/lib/types/workouts/base/graph/index.d.ts +2 -0
  45. package/lib/types/workouts/base/graph/series.d.ts +18 -0
  46. package/lib/types/workouts/base/graph/types.d.ts +11 -0
  47. package/lib/types/workouts/base/model/index.d.ts +0 -1
  48. package/lib/types/workouts/base/parsers/intervals/parser.d.ts +2 -1
  49. package/lib/types/workouts/calendar/service.d.ts +1 -0
  50. package/lib/types/workouts/index.d.ts +2 -0
  51. package/lib/types/workouts/list/cards/index.d.ts +0 -1
  52. package/lib/types/workouts/list/index.d.ts +0 -1
  53. package/lib/types/workouts/list/pageService.d.ts +136 -4
  54. package/lib/types/workouts/list/service.d.ts +4 -0
  55. package/lib/types/workouts/list/types.d.ts +1 -1
  56. package/lib/types/workouts/page/index.d.ts +1 -0
  57. package/lib/types/workouts/page/service.d.ts +57 -0
  58. package/lib/types/workouts/page/types.d.ts +95 -0
  59. package/lib/types/workouts/ride/index.d.ts +1 -0
  60. package/lib/types/workouts/ride/page/index.d.ts +2 -0
  61. package/lib/types/workouts/ride/page/service.d.ts +70 -0
  62. package/lib/types/workouts/ride/page/types.d.ts +71 -0
  63. package/lib/types/workouts/ride/service.d.ts +2 -1
  64. package/lib/types/workouts/ride/types.d.ts +3 -0
  65. package/lib/types/workouts/types.d.ts +8 -0
  66. package/package.json +1 -1
@@ -1,18 +1,150 @@
1
1
  import { IncyclistPageService } from "../../base/pages";
2
2
  import { IObserver } from "../../types";
3
- export type WorkoutListPageDisplayProps = {
3
+ import { FileInfo } from "../../api";
4
+ import { Workout } from "../base/model/Workout";
5
+ import { WorkoutCard } from "./cards/WorkoutCard";
6
+ import { WorkoutListService } from "./service";
7
+ export type WorkoutListPageDisplayProps = WorkoutListPlaceholderProps | WorkoutListContentProps;
8
+ export interface WorkoutListPlaceholderProps {
4
9
  pageType: 'placeholder';
5
- } | {
10
+ }
11
+ export interface WorkoutListContentProps {
6
12
  pageType: 'list';
7
- };
8
- export interface IWorkoutListPageService {
13
+ loading: boolean;
14
+ upcoming: UpcomingTrainingProps | null;
15
+ groups: GroupFilterProps;
16
+ workouts: WorkoutListItemProps[];
17
+ selectedId: string | null;
18
+ isEmpty: boolean;
19
+ }
20
+ export interface UpcomingTrainingProps {
21
+ items: ScheduledWorkoutItemProps[];
22
+ collapsedCount: number;
23
+ todayId: string | null;
24
+ }
25
+ export interface ScheduledWorkoutItemProps {
26
+ id: string;
27
+ title: string;
28
+ date: Date;
29
+ duration: string;
30
+ isToday: boolean;
31
+ selected: boolean;
32
+ workout: Workout;
33
+ }
34
+ export interface GroupFilterProps {
35
+ available: string[];
36
+ selected: string | null;
37
+ }
38
+ export interface WorkoutListItemProps {
39
+ id: string;
40
+ title: string;
41
+ group: string;
42
+ duration: string;
43
+ selected: boolean;
44
+ canDelete: boolean;
45
+ workout: Workout;
46
+ }
47
+ export interface WorkoutDetailsProps {
48
+ id: string;
49
+ title: string;
50
+ description?: string;
51
+ duration: string;
52
+ workout: Workout;
53
+ ftp: number;
54
+ ftpRequired: boolean;
55
+ useErgMode: boolean;
56
+ canStart: boolean;
57
+ canStartWorkoutOnly: boolean;
58
+ groups: string[];
59
+ group: string;
60
+ canDelete: boolean;
61
+ isScheduled: boolean;
62
+ date?: Date;
63
+ }
64
+ export interface WorkoutImportDisplayProps {
65
+ phase: 'landing' | 'importing' | 'result' | 'error';
66
+ group: string;
67
+ knownGroups: string[];
68
+ importing?: {
69
+ fileName: string;
70
+ };
71
+ result?: {
72
+ workoutName: string;
73
+ group: string;
74
+ };
75
+ error?: string;
76
+ }
77
+ export interface WorkoutListPageCallbacks {
78
+ onSelectGroup: (group: string | null) => void;
79
+ onOpenDetails: (id: string) => void;
80
+ onCloseDetails: () => void;
81
+ onSetFtp: (ftp: number) => void;
82
+ onSetErgMode: (enabled: boolean) => void;
83
+ onChangeGroup: (id: string, group: string) => void;
84
+ onDelete: (id: string) => Promise<boolean>;
85
+ onStart: (id: string, opts: {
86
+ noRoute: boolean;
87
+ }) => void;
88
+ onMarkForRoute?: (id: string) => void;
89
+ onClearSelection: () => void;
90
+ onImportOpen: () => void;
91
+ onImportGroupChange: (name: string) => void;
92
+ onImportFile: (file: FileInfo) => IObserver;
93
+ onImportClose: () => void;
94
+ }
95
+ export interface IWorkoutListPageService extends WorkoutListPageCallbacks {
9
96
  getPageDisplayProps(): WorkoutListPageDisplayProps;
97
+ getWorkoutDetailsProps(id: string): WorkoutDetailsProps | null;
98
+ getImportDisplayProps(): WorkoutImportDisplayProps;
10
99
  }
11
100
  export declare class WorkoutListPageService extends IncyclistPageService implements IWorkoutListPageService {
101
+ protected groupFilter: string | null;
102
+ protected importPhase: 'landing' | 'importing' | 'result' | 'error' | undefined;
103
+ protected importGroup: string;
104
+ protected importingFileName: string;
105
+ protected importResult: {
106
+ workoutName: string;
107
+ group: string;
108
+ };
109
+ protected importError: string;
110
+ protected listObserver: IObserver;
111
+ protected listUpdateHandler: any;
112
+ protected calendarUpdateHandler: any;
12
113
  constructor();
13
114
  openPage(): IObserver;
14
115
  closePage(): void;
15
116
  getPageDisplayProps(): WorkoutListPageDisplayProps;
117
+ getWorkoutDetailsProps(id: string): WorkoutDetailsProps | null;
118
+ getImportDisplayProps(): WorkoutImportDisplayProps;
119
+ onSelectGroup(group: string | null): void;
120
+ onOpenDetails(id: string): void;
121
+ onCloseDetails(): void;
122
+ onSetFtp(ftp: number): void;
123
+ onSetErgMode(enabled: boolean): void;
124
+ onChangeGroup(id: string, group: string): void;
125
+ onDelete(id: string): Promise<boolean>;
126
+ onStart(id: string, opts: {
127
+ noRoute: boolean;
128
+ }): void;
129
+ onMarkForRoute(id: string): void;
130
+ onClearSelection(): void;
131
+ onImportOpen(): void;
132
+ onImportGroupChange(name: string): void;
133
+ onImportFile(file: FileInfo): IObserver;
134
+ onImportClose(): void;
135
+ protected getUpcomingTrainingProps(): UpcomingTrainingProps | null;
136
+ protected getGroupFilterProps(): GroupFilterProps;
137
+ protected getKnownGroups(): string[];
138
+ protected getAllWorkoutItems(): WorkoutListItemProps[];
139
+ protected findWorkoutCard(id: string): WorkoutCard | undefined;
140
+ protected getLastUsedImportGroup(): string;
141
+ protected persistLastUsedImportGroup(group: string): void;
142
+ protected formatDuration(duration: number): string;
143
+ protected emitPageUpdate(): void;
144
+ protected emitImportUpdate(): void;
145
+ protected getWorkoutList(): WorkoutListService;
146
+ protected getWorkoutCalendar(): import("../calendar").WorkoutCalendarService;
147
+ protected getUserSettings(): import("../../settings").UserSettingsService;
16
148
  protected getAppState(): import("../../appstate").AppStateService;
17
149
  }
18
150
  export declare const getWorkoutListPageService: () => WorkoutListPageService;
@@ -22,6 +22,7 @@ export declare class WorkoutListService extends IncyclistService implements ILis
22
22
  protected language: string;
23
23
  protected selectedWorkout: Workout;
24
24
  protected ftp: number;
25
+ protected useErgModeOverride: boolean;
25
26
  protected scheduledToday: WorkoutCalendarEntry;
26
27
  protected scheduledList: CardList<WP>;
27
28
  protected selectedCard: Card<WP>;
@@ -58,6 +59,7 @@ export declare class WorkoutListService extends IncyclistService implements ILis
58
59
  selectCard(card: Card<WP>): void;
59
60
  unselectCard(card: Card<WP>): void;
60
61
  moveCard(card: Card<WP>, source: CardList<WP>, target: string | CardList<WP>): CardList<WP>;
62
+ deleteWorkout(id: string): PromiseObserver<boolean>;
61
63
  canDisplayStart(): boolean;
62
64
  protected createSettingsList(): CardList<WP>;
63
65
  protected resetLists(): void;
@@ -84,6 +86,8 @@ export declare class WorkoutListService extends IncyclistService implements ILis
84
86
  protected getInitTimeout(): number;
85
87
  protected getWorkoutCalendar(): import("../calendar").WorkoutCalendarService;
86
88
  protected getAppState(): import("../../appstate").AppStateService;
89
+ protected isMobile(): boolean;
90
+ protected getBindings(): import("../../api").IncyclistBindings;
87
91
  protected getRepo(): WorkoutsDbLoader;
88
92
  }
89
93
  export declare const useWorkoutList: () => WorkoutListService;
@@ -2,7 +2,7 @@ import { CardList } from "../../base/cardlist";
2
2
  import { ListObserver } from "../../base/types";
3
3
  import { Workout } from "../base/model";
4
4
  import { ScheduledWorkout } from "../calendar";
5
- import { WorkoutSettings } from "./cards";
5
+ import { WorkoutSettings } from "./cards/types";
6
6
  export type WP = Workout | ScheduledWorkout;
7
7
  export interface WorkoutSettingsDisplayProps {
8
8
  observer: ListObserver<WP>;
@@ -0,0 +1 @@
1
+ export * from './service';
@@ -0,0 +1,57 @@
1
+ import { IncyclistPageService } from "../../base/pages";
2
+ import { IObserver } from "../../types";
3
+ import { FileInfo } from "../../api";
4
+ import { WorkoutCard } from "../list/cards/WorkoutCard";
5
+ import { WorkoutListService } from "../list/service";
6
+ import { GroupFilterProps, IWorkoutListPageService, UpcomingTrainingProps, WorkoutDetailsProps, WorkoutImportDisplayProps, WorkoutListItemProps, WorkoutListPageDisplayProps } from "./types";
7
+ export declare class WorkoutListPageService extends IncyclistPageService implements IWorkoutListPageService {
8
+ protected groupFilter: string | null;
9
+ protected importPhase: 'landing' | 'importing' | 'result' | 'error' | undefined;
10
+ protected importGroup: string;
11
+ protected importingFileName: string;
12
+ protected importResult: {
13
+ workoutName: string;
14
+ group: string;
15
+ };
16
+ protected importError: string;
17
+ protected listObserver: IObserver;
18
+ protected listUpdateHandler: any;
19
+ protected calendarUpdateHandler: any;
20
+ constructor();
21
+ openPage(): IObserver;
22
+ closePage(): void;
23
+ getPageDisplayProps(): WorkoutListPageDisplayProps;
24
+ getWorkoutDetailsProps(id: string): WorkoutDetailsProps | null;
25
+ getImportDisplayProps(): WorkoutImportDisplayProps;
26
+ onSelectGroup(group: string | null): void;
27
+ onOpenDetails(id: string): void;
28
+ onCloseDetails(): void;
29
+ onSetFtp(ftp: number): void;
30
+ onSetErgMode(enabled: boolean): void;
31
+ onChangeGroup(id: string, group: string): void;
32
+ onDelete(id: string): Promise<boolean>;
33
+ onStart(id: string, opts: {
34
+ noRoute: boolean;
35
+ }): void;
36
+ onMarkForRoute(id: string): void;
37
+ onClearSelection(): void;
38
+ onImportOpen(): void;
39
+ onImportGroupChange(name: string): void;
40
+ onImportFile(file: FileInfo): IObserver;
41
+ onImportClose(): void;
42
+ protected getUpcomingTrainingProps(): UpcomingTrainingProps | null;
43
+ protected getGroupFilterProps(): GroupFilterProps;
44
+ protected getKnownGroups(): string[];
45
+ protected getAllWorkoutItems(): WorkoutListItemProps[];
46
+ protected findWorkoutCard(id: string): WorkoutCard | undefined;
47
+ protected getLastUsedImportGroup(): string;
48
+ protected persistLastUsedImportGroup(group: string): void;
49
+ protected formatDuration(duration: number): string;
50
+ protected emitPageUpdate(): void;
51
+ protected emitImportUpdate(): void;
52
+ protected getWorkoutList(): WorkoutListService;
53
+ protected getWorkoutCalendar(): import("../calendar").WorkoutCalendarService;
54
+ protected getUserSettings(): import("../../settings").UserSettingsService;
55
+ protected getAppState(): import("../../appstate").AppStateService;
56
+ }
57
+ export declare const getWorkoutListPageService: () => WorkoutListPageService;
@@ -0,0 +1,95 @@
1
+ import { FileInfo, IObserver } from "../../types";
2
+ import { Workout } from "../base/model";
3
+ export type WorkoutListPageDisplayProps = WorkoutListPlaceholderProps | WorkoutListContentProps;
4
+ export interface WorkoutListPlaceholderProps {
5
+ pageType: 'placeholder';
6
+ }
7
+ export interface WorkoutListContentProps {
8
+ pageType: 'list';
9
+ loading: boolean;
10
+ upcoming: UpcomingTrainingProps | null;
11
+ groups: GroupFilterProps;
12
+ workouts: WorkoutListItemProps[];
13
+ selectedId: string | null;
14
+ isEmpty: boolean;
15
+ }
16
+ export interface UpcomingTrainingProps {
17
+ items: ScheduledWorkoutItemProps[];
18
+ collapsedCount: number;
19
+ todayId: string | null;
20
+ }
21
+ export interface ScheduledWorkoutItemProps {
22
+ id: string;
23
+ title: string;
24
+ date: Date;
25
+ duration: string;
26
+ isToday: boolean;
27
+ selected: boolean;
28
+ workout: Workout;
29
+ }
30
+ export interface GroupFilterProps {
31
+ available: string[];
32
+ selected: string | null;
33
+ }
34
+ export interface WorkoutListItemProps {
35
+ id: string;
36
+ title: string;
37
+ group: string;
38
+ duration: string;
39
+ selected: boolean;
40
+ canDelete: boolean;
41
+ workout: Workout;
42
+ }
43
+ export interface WorkoutDetailsProps {
44
+ id: string;
45
+ title: string;
46
+ description?: string;
47
+ duration: string;
48
+ workout: Workout;
49
+ ftp: number;
50
+ ftpRequired: boolean;
51
+ useErgMode: boolean;
52
+ canStart: boolean;
53
+ canStartWorkoutOnly: boolean;
54
+ groups: string[];
55
+ group: string;
56
+ canDelete: boolean;
57
+ isScheduled: boolean;
58
+ date?: Date;
59
+ }
60
+ export interface WorkoutImportDisplayProps {
61
+ phase: 'landing' | 'importing' | 'result' | 'error';
62
+ group: string;
63
+ knownGroups: string[];
64
+ importing?: {
65
+ fileName: string;
66
+ };
67
+ result?: {
68
+ workoutName: string;
69
+ group: string;
70
+ };
71
+ error?: string;
72
+ }
73
+ export interface WorkoutListPageCallbacks {
74
+ onSelectGroup: (group: string | null) => void;
75
+ onOpenDetails: (id: string) => void;
76
+ onCloseDetails: () => void;
77
+ onSetFtp: (ftp: number) => void;
78
+ onSetErgMode: (enabled: boolean) => void;
79
+ onChangeGroup: (id: string, group: string) => void;
80
+ onDelete: (id: string) => Promise<boolean>;
81
+ onStart: (id: string, opts: {
82
+ noRoute: boolean;
83
+ }) => void;
84
+ onMarkForRoute?: (id: string) => void;
85
+ onClearSelection: () => void;
86
+ onImportOpen: () => void;
87
+ onImportGroupChange: (name: string) => void;
88
+ onImportFile: (file: FileInfo) => IObserver;
89
+ onImportClose: () => void;
90
+ }
91
+ export interface IWorkoutListPageService extends WorkoutListPageCallbacks {
92
+ getPageDisplayProps(): WorkoutListPageDisplayProps;
93
+ getWorkoutDetailsProps(id: string): WorkoutDetailsProps | null;
94
+ getImportDisplayProps(): WorkoutImportDisplayProps;
95
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './service';
2
2
  export * from './types';
3
+ export * from './page';
@@ -0,0 +1,2 @@
1
+ export * from './service';
2
+ export * from './types';
@@ -0,0 +1,70 @@
1
+ import { IncyclistPageService } from "../../../base/pages";
2
+ import type { IObserver } from "../../../base/typedefs";
3
+ import type { CurrentRideState, RideType } from "../../../types";
4
+ import type { WorkoutDisplayProperties } from "../types";
5
+ import type { Workout } from "../../base/model";
6
+ import type { StepDefinition } from "../../base/model/types";
7
+ import type { IWorkoutRidePageService, WorkoutDashboardLine, WorkoutGraphActuals, WorkoutGraphPlan, WorkoutRideMenuProps, WorkoutRidePageDisplayProps, WorkoutUpcomingSteps } from "./types";
8
+ export declare class WorkoutRidePageService extends IncyclistPageService implements IWorkoutRidePageService {
9
+ protected rideEventHandler: Record<string, any>;
10
+ protected workoutEventHandler: Record<string, any>;
11
+ protected workoutObserverSubscribed: boolean;
12
+ protected backgroundTimer: NodeJS.Timeout | undefined;
13
+ protected backgroundPausedByService: boolean;
14
+ protected menuProps: WorkoutRideMenuProps | null;
15
+ protected isInitialized: boolean;
16
+ constructor();
17
+ openPage(simulate?: boolean): IObserver;
18
+ closePage(): void;
19
+ pausePage(): Promise<void>;
20
+ resumePage(): Promise<void>;
21
+ getRideObserver(): IObserver | null;
22
+ getPageDisplayProps(): WorkoutRidePageDisplayProps;
23
+ getGraphActuals(): WorkoutGraphActuals;
24
+ onMenuOpen(): void;
25
+ onMenuClose(): void;
26
+ onPause(): void;
27
+ onResume(): void;
28
+ onStop(): void;
29
+ onStepBack(): void;
30
+ onStepForward(): void;
31
+ onIncreaseLoad(): void;
32
+ onDecreaseLoad(): void;
33
+ onRetryStart(): void;
34
+ onIgnoreStart(): void;
35
+ onCancelStart(): void;
36
+ adjustLoad(deltaPct: number): void;
37
+ protected onRideStateUpdate(state: CurrentRideState): void;
38
+ protected onWorkoutUpdate(): void;
39
+ protected onWorkoutFinished(): void;
40
+ protected subscribeToWorkoutObserver(): void;
41
+ protected unsubscribeFromWorkoutObserver(): void;
42
+ protected registerRideEventHandlers(): void;
43
+ protected unregisterRideEventHandlers(): void;
44
+ protected buildBaseProps(): {
45
+ rideState: CurrentRideState;
46
+ rideType: RideType;
47
+ startOverlayProps: import("../../../types").StartOverlayProps;
48
+ menuProps: WorkoutRideMenuProps;
49
+ startGateProps: any;
50
+ };
51
+ protected buildGraphPlan(current: Workout | undefined, ftp: number): WorkoutGraphPlan;
52
+ protected buildUpcomingSteps(current: Workout | undefined, ftp: number): WorkoutUpcomingSteps;
53
+ protected buildDashboardLine(wo: WorkoutDisplayProperties): WorkoutDashboardLine;
54
+ protected getStepAbsolutePower(step: StepDefinition, ftp?: number): number | null;
55
+ protected getStepFlags(): {
56
+ canStepBack: boolean;
57
+ canStepForward: boolean;
58
+ };
59
+ protected getLastLogTime(): number;
60
+ protected getElapsedActivityTime(): number;
61
+ protected getEmptyDisplayProps(): WorkoutRidePageDisplayProps;
62
+ protected updatePageDisplay(): void;
63
+ protected emitNavigateBack(): void;
64
+ protected moveToPreviousPage(): void;
65
+ protected get rideObserver(): IObserver | null;
66
+ protected getRideDisplay(): import("../../../ride/display").RideDisplayService;
67
+ protected getWorkoutRide(): import("../service").WorkoutRide;
68
+ protected getActivityRide(): import("../../../activities").ActivityRideService;
69
+ }
70
+ export declare const getWorkoutRidePageService: () => WorkoutRidePageService;
@@ -0,0 +1,71 @@
1
+ import type { IObserver } from "../../../base/typedefs";
2
+ import type { IPageService } from "../../../base/pages";
3
+ import type { RidePageDisplayProps } from "../../../ride/page/types";
4
+ import type { WorkoutGraphPlanBar } from "../../base/graph/types";
5
+ export interface WorkoutGraphPoint {
6
+ x: number;
7
+ y: number;
8
+ }
9
+ export interface WorkoutGraphPlan {
10
+ bars: WorkoutGraphPlanBar[];
11
+ ftp: number;
12
+ ftpLine: number;
13
+ domain: {
14
+ x: [number, number];
15
+ y: [number, number];
16
+ };
17
+ }
18
+ export interface WorkoutGraphActuals {
19
+ power: WorkoutGraphPoint[];
20
+ heartrate: WorkoutGraphPoint[];
21
+ position: number;
22
+ }
23
+ export interface WorkoutStepDisplay {
24
+ label: string;
25
+ targetPower: number | null;
26
+ duration: number;
27
+ remaining: number | null;
28
+ isCurrent: boolean;
29
+ }
30
+ export interface WorkoutUpcomingSteps {
31
+ previous: WorkoutStepDisplay | null;
32
+ current: WorkoutStepDisplay | null;
33
+ upcoming: WorkoutStepDisplay[];
34
+ hasMore: boolean;
35
+ }
36
+ export interface WorkoutDashboardLine {
37
+ text: string;
38
+ mode: string | null;
39
+ }
40
+ export interface WorkoutRideMenuProps {
41
+ showResume: boolean;
42
+ canStepBack: boolean;
43
+ canStepForward: boolean;
44
+ }
45
+ export interface WorkoutRidePageDisplayProps extends RidePageDisplayProps {
46
+ menuProps: WorkoutRideMenuProps | null;
47
+ graph: WorkoutGraphPlan;
48
+ steps: WorkoutUpcomingSteps;
49
+ dashboard: WorkoutDashboardLine;
50
+ title: string;
51
+ }
52
+ export interface WorkoutRidePageCallbacks {
53
+ onMenuOpen(): void;
54
+ onMenuClose(): void;
55
+ onPause(): void;
56
+ onResume(): void;
57
+ onStop(): void;
58
+ onStepBack(): void;
59
+ onStepForward(): void;
60
+ onIncreaseLoad(): void;
61
+ onDecreaseLoad(): void;
62
+ onRetryStart(): void;
63
+ onIgnoreStart(): void;
64
+ onCancelStart(): void;
65
+ }
66
+ export interface IWorkoutRidePageService extends WorkoutRidePageCallbacks, IPageService {
67
+ getRideObserver(): IObserver | null;
68
+ getPageDisplayProps(): WorkoutRidePageDisplayProps;
69
+ getGraphActuals(): WorkoutGraphActuals;
70
+ adjustLoad(deltaPct: number): void;
71
+ }
@@ -1,6 +1,7 @@
1
1
  import { IncyclistService } from "../../base/service";
2
2
  import { Observer } from "../../base/types/observer";
3
- import { CurrentStep, PowerLimit, StepDefinition, Workout } from "../base/model";
3
+ import { Workout } from "../base/model";
4
+ import { CurrentStep, PowerLimit, StepDefinition } from "../base/model/types";
4
5
  import { WorkoutListService } from "../list";
5
6
  import { WorkoutSettings } from "../list/cards/types";
6
7
  import { ActiveWorkoutLimit, WorkoutDisplayProperties } from "./types";
@@ -1,4 +1,5 @@
1
1
  import { Workout } from "../base/model";
2
+ import { StepDefinition } from "../base/model/types";
2
3
  export interface WorkoutRequest {
3
4
  time: number;
4
5
  minPower?: number;
@@ -12,6 +13,7 @@ export interface WorkoutRequest {
12
13
  export interface ActiveWorkoutLimit extends WorkoutRequest {
13
14
  duration: number;
14
15
  remaining: number;
16
+ step?: StepDefinition;
15
17
  }
16
18
  export interface WorkoutDisplayProperties {
17
19
  workout?: Workout;
@@ -20,6 +22,7 @@ export interface WorkoutDisplayProperties {
20
22
  current?: ActiveWorkoutLimit;
21
23
  start?: number;
22
24
  stop?: number;
25
+ mode?: string;
23
26
  canShowBackward?: boolean;
24
27
  canShowForward?: boolean;
25
28
  }
@@ -0,0 +1,8 @@
1
+ export type * from './page/types';
2
+ export type * from './list/types';
3
+ export type * from './base/graph/types';
4
+ export type * from './ride/page/types';
5
+ export type { ScheduledWorkoutSettingsDisplayProps, WorkoutCardDisplayProperties, ScheduledWorkoutCardDisplayProperties, WorkoutCardType, WorkoutImportProps, WorkoutCreateProps, ActiveImportProps, WorkoutSettings, WorkoutSettingsDisplayProps as WorkoutCardSettingsDisplayProps } from './list/cards/types';
6
+ export type * from './calendar/types';
7
+ export type * from './ride/types';
8
+ export type { Limit, PowerLimitType, PowerLimit, DataType, StepDefinition, CurrentStep, SegmentDefinition, Category, WorkoutDefinition, PlanDefinition, ScheduledWorkout as PlanScheduledWorkout } from './base/model/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.7.76",
3
+ "version": "1.7.78",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },