@hy-capital/api-habit-tracker-types 1.0.27 → 1.0.29
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 +22 -5
- package/package.json +1 -1
- package/src/habit.ts +25 -5
package/dist/habit.d.ts
CHANGED
@@ -2,8 +2,8 @@ import { TopicType } from './user-topic';
|
|
2
2
|
export type HabitTime = 'Morning' | 'Afternoon' | 'Evening' | 'Anytime';
|
3
3
|
export type HabitDifficulty = 1 | 2 | 3;
|
4
4
|
export type HabitFrequency = 'Daily' | 'Monthly';
|
5
|
-
export type
|
6
|
-
export declare const allHabitDays:
|
5
|
+
export type HabitDay = 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
|
6
|
+
export declare const allHabitDays: HabitDay[];
|
7
7
|
export interface HabitType {
|
8
8
|
name: string;
|
9
9
|
habitTime: HabitTime;
|
@@ -11,7 +11,7 @@ export interface HabitType {
|
|
11
11
|
difficulty: HabitDifficulty;
|
12
12
|
description: string;
|
13
13
|
frequency: HabitFrequency;
|
14
|
-
habitDays:
|
14
|
+
habitDays: HabitDay[];
|
15
15
|
}
|
16
16
|
export interface BaseHabit {
|
17
17
|
user_id: number;
|
@@ -23,11 +23,28 @@ export interface BaseHabit {
|
|
23
23
|
difficulty: HabitDifficulty;
|
24
24
|
description: string;
|
25
25
|
remind_me: boolean;
|
26
|
-
remind_me_at_times:
|
26
|
+
remind_me_at_times: RemindMeAtTime[];
|
27
27
|
frequency: HabitFrequency;
|
28
|
-
habit_days:
|
28
|
+
habit_days: HabitDay[];
|
29
29
|
habit_dates: number[];
|
30
30
|
}
|
31
|
+
export type RemindMeAtTime = RemindMeAtDailyTime | RemindMeAtMonthlyTime;
|
32
|
+
export interface RemindMeAtDailyTime {
|
33
|
+
type: 'Daily';
|
34
|
+
habit_days: HabitDay[];
|
35
|
+
hour: number;
|
36
|
+
minute: number;
|
37
|
+
isEnabled: boolean;
|
38
|
+
notificationId: string;
|
39
|
+
}
|
40
|
+
export interface RemindMeAtMonthlyTime {
|
41
|
+
type: 'Monthly';
|
42
|
+
habit_dates: number[];
|
43
|
+
hour: number;
|
44
|
+
minute: number;
|
45
|
+
isEnabled: boolean;
|
46
|
+
notificationId: string;
|
47
|
+
}
|
31
48
|
export interface DbHabit extends BaseHabit {
|
32
49
|
id: number;
|
33
50
|
created_at: string;
|
package/package.json
CHANGED
package/src/habit.ts
CHANGED
@@ -3,8 +3,8 @@ import {TopicType} from './user-topic';
|
|
3
3
|
export type HabitTime = 'Morning' | 'Afternoon' | 'Evening' | 'Anytime';
|
4
4
|
export type HabitDifficulty = 1 | 2 | 3;
|
5
5
|
export type HabitFrequency = 'Daily' | 'Monthly';
|
6
|
-
export type
|
7
|
-
export const allHabitDays:
|
6
|
+
export type HabitDay = 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
|
7
|
+
export const allHabitDays: HabitDay[] = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
8
8
|
|
9
9
|
export interface HabitType {
|
10
10
|
name: string;
|
@@ -13,7 +13,7 @@ export interface HabitType {
|
|
13
13
|
difficulty: HabitDifficulty;
|
14
14
|
description: string;
|
15
15
|
frequency: HabitFrequency;
|
16
|
-
habitDays:
|
16
|
+
habitDays: HabitDay[];
|
17
17
|
}
|
18
18
|
|
19
19
|
export interface BaseHabit {
|
@@ -26,12 +26,32 @@ export interface BaseHabit {
|
|
26
26
|
difficulty: HabitDifficulty;
|
27
27
|
description: string;
|
28
28
|
remind_me: boolean;
|
29
|
-
remind_me_at_times:
|
29
|
+
remind_me_at_times: RemindMeAtTime[];
|
30
30
|
frequency: HabitFrequency;
|
31
|
-
habit_days:
|
31
|
+
habit_days: HabitDay[];
|
32
32
|
habit_dates: number[];
|
33
33
|
}
|
34
34
|
|
35
|
+
export type RemindMeAtTime = RemindMeAtDailyTime | RemindMeAtMonthlyTime;
|
36
|
+
|
37
|
+
export interface RemindMeAtDailyTime {
|
38
|
+
type: 'Daily';
|
39
|
+
habit_days: HabitDay[];
|
40
|
+
hour: number;
|
41
|
+
minute: number;
|
42
|
+
isEnabled: boolean;
|
43
|
+
notificationId: string;
|
44
|
+
}
|
45
|
+
|
46
|
+
export interface RemindMeAtMonthlyTime {
|
47
|
+
type: 'Monthly';
|
48
|
+
habit_dates: number[];
|
49
|
+
hour: number;
|
50
|
+
minute: number;
|
51
|
+
isEnabled: boolean;
|
52
|
+
notificationId: string;
|
53
|
+
}
|
54
|
+
|
35
55
|
export interface DbHabit extends BaseHabit {
|
36
56
|
id: number;
|
37
57
|
created_at: string
|