@hy-capital/api-habit-tracker-types 1.0.64 → 1.0.65
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/dist/habit.d.ts +15 -0
- package/package.json +1 -1
- package/src/habit.ts +17 -0
package/dist/habit.d.ts
CHANGED
@@ -68,6 +68,21 @@ export interface DbHabit extends BaseHabit {
|
|
68
68
|
created_at: string;
|
69
69
|
updated_at: string;
|
70
70
|
}
|
71
|
+
export interface HabitStats {
|
72
|
+
mostMasteredHabit: {
|
73
|
+
habit: DbHabit | null;
|
74
|
+
count: number;
|
75
|
+
};
|
76
|
+
longestStreak: {
|
77
|
+
habit: DbHabit | null;
|
78
|
+
streak: number;
|
79
|
+
};
|
80
|
+
totalHabitsCompleted: number;
|
81
|
+
}
|
82
|
+
export interface HabitsResponse {
|
83
|
+
habits: DbHabit[];
|
84
|
+
stats: HabitStats;
|
85
|
+
}
|
71
86
|
export declare const habitTimeToClockTime: Record<HabitTime, {
|
72
87
|
hour: number;
|
73
88
|
minute: number;
|
package/package.json
CHANGED
package/src/habit.ts
CHANGED
@@ -121,6 +121,23 @@ export interface DbHabit extends BaseHabit {
|
|
121
121
|
updated_at: string
|
122
122
|
}
|
123
123
|
|
124
|
+
export interface HabitStats {
|
125
|
+
mostMasteredHabit: {
|
126
|
+
habit: DbHabit | null,
|
127
|
+
count: number
|
128
|
+
};
|
129
|
+
longestStreak: {
|
130
|
+
habit: DbHabit | null,
|
131
|
+
streak: number
|
132
|
+
};
|
133
|
+
totalHabitsCompleted: number;
|
134
|
+
}
|
135
|
+
|
136
|
+
export interface HabitsResponse {
|
137
|
+
habits: DbHabit[];
|
138
|
+
stats: HabitStats;
|
139
|
+
}
|
140
|
+
|
124
141
|
export const habitTimeToClockTime: Record<HabitTime, { hour: number, minute: number }> = {
|
125
142
|
Morning: {
|
126
143
|
hour: 9,
|