@drincs/nqtr 0.1.15 → 0.1.17

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 (212) hide show
  1. package/dist/ActivityProps-BoJeWa2B.d.mts +124 -0
  2. package/dist/ActivityProps-_79x9-BX.d.ts +124 -0
  3. package/dist/{index-Cu8ZAiqF.d.ts → Commitment-BObBFSTM.d.ts} +237 -220
  4. package/dist/{index-DhsRZJ3g.d.mts → Commitment-BrnOOgEN.d.mts} +237 -220
  5. package/dist/{index-gJ26gdgL.d.mts → Quest-Bdm0R9LA.d.mts} +7 -12
  6. package/dist/{index-BjOzVDyw.d.ts → Quest-CxJcXETG.d.ts} +7 -12
  7. package/dist/classes/Activity.d.mts +41 -127
  8. package/dist/classes/Activity.d.ts +41 -127
  9. package/dist/classes/Activity.js +2 -151
  10. package/dist/classes/Activity.js.map +1 -1
  11. package/dist/classes/Activity.mjs +2 -148
  12. package/dist/classes/Activity.mjs.map +1 -1
  13. package/dist/classes/ActivityStoredAbstract.d.mts +3 -0
  14. package/dist/classes/ActivityStoredAbstract.d.ts +3 -0
  15. package/dist/classes/ActivityStoredAbstract.js +399 -0
  16. package/dist/classes/ActivityStoredAbstract.js.map +1 -0
  17. package/dist/classes/ActivityStoredAbstract.mjs +397 -0
  18. package/dist/classes/ActivityStoredAbstract.mjs.map +1 -0
  19. package/dist/classes/Commitment.d.mts +4 -1
  20. package/dist/classes/Commitment.d.ts +4 -1
  21. package/dist/classes/Commitment.js +21 -4
  22. package/dist/classes/Commitment.js.map +1 -1
  23. package/dist/classes/Commitment.mjs +21 -4
  24. package/dist/classes/Commitment.mjs.map +1 -1
  25. package/dist/classes/index.d.mts +9 -2
  26. package/dist/classes/index.d.ts +9 -2
  27. package/dist/classes/index.js +884 -5
  28. package/dist/classes/index.js.map +1 -1
  29. package/dist/classes/index.mjs +879 -6
  30. package/dist/classes/index.mjs.map +1 -1
  31. package/dist/classes/navigation/ActivityRoom.d.mts +5 -2
  32. package/dist/classes/navigation/ActivityRoom.d.ts +5 -2
  33. package/dist/classes/navigation/ActivityRoom.js +3 -3
  34. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  35. package/dist/classes/navigation/ActivityRoom.mjs +3 -3
  36. package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
  37. package/dist/classes/navigation/Location.d.mts +5 -2
  38. package/dist/classes/navigation/Location.d.ts +5 -2
  39. package/dist/classes/navigation/Location.js.map +1 -1
  40. package/dist/classes/navigation/Location.mjs.map +1 -1
  41. package/dist/classes/navigation/Map.d.mts +5 -2
  42. package/dist/classes/navigation/Map.d.ts +5 -2
  43. package/dist/classes/navigation/Map.js.map +1 -1
  44. package/dist/classes/navigation/Map.mjs.map +1 -1
  45. package/dist/classes/navigation/Room.d.mts +4 -1
  46. package/dist/classes/navigation/Room.d.ts +4 -1
  47. package/dist/classes/navigation/Room.js +3 -3
  48. package/dist/classes/navigation/Room.js.map +1 -1
  49. package/dist/classes/navigation/Room.mjs +3 -3
  50. package/dist/classes/navigation/Room.mjs.map +1 -1
  51. package/dist/classes/quest/Goal.d.mts +3 -6
  52. package/dist/classes/quest/Goal.d.ts +3 -6
  53. package/dist/classes/quest/Goal.js.map +1 -1
  54. package/dist/classes/quest/Goal.mjs.map +1 -1
  55. package/dist/classes/quest/Quest.d.mts +3 -1
  56. package/dist/classes/quest/Quest.d.ts +3 -1
  57. package/dist/classes/quest/Quest.js.map +1 -1
  58. package/dist/classes/quest/Quest.mjs.map +1 -1
  59. package/dist/classes/quest/Stage.d.mts +3 -1
  60. package/dist/classes/quest/Stage.d.ts +3 -1
  61. package/dist/classes/quest/Stage.js.map +1 -1
  62. package/dist/classes/quest/Stage.mjs.map +1 -1
  63. package/dist/decorators/ActivityDecorator.d.mts +16 -0
  64. package/dist/decorators/ActivityDecorator.d.ts +16 -0
  65. package/dist/decorators/ActivityDecorator.js.map +1 -1
  66. package/dist/decorators/ActivityDecorator.mjs.map +1 -1
  67. package/dist/decorators/CommitmentDecorator.d.mts +5 -2
  68. package/dist/decorators/CommitmentDecorator.d.ts +5 -2
  69. package/dist/decorators/CommitmentDecorator.js +3 -3
  70. package/dist/decorators/CommitmentDecorator.js.map +1 -1
  71. package/dist/decorators/CommitmentDecorator.mjs +3 -3
  72. package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
  73. package/dist/decorators/RoomDecorator.d.mts +9 -2
  74. package/dist/decorators/RoomDecorator.d.ts +9 -2
  75. package/dist/decorators/RoomDecorator.js.map +1 -1
  76. package/dist/decorators/RoomDecorator.mjs.map +1 -1
  77. package/dist/decorators/index.d.mts +4 -1
  78. package/dist/decorators/index.d.ts +4 -1
  79. package/dist/decorators/index.js +3 -3
  80. package/dist/decorators/index.js.map +1 -1
  81. package/dist/decorators/index.mjs +3 -3
  82. package/dist/decorators/index.mjs.map +1 -1
  83. package/dist/functions/ActivityFunctions.d.mts +5 -2
  84. package/dist/functions/ActivityFunctions.d.ts +5 -2
  85. package/dist/functions/ActivityFunctions.js.map +1 -1
  86. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  87. package/dist/functions/NavigationFunctions.d.mts +5 -2
  88. package/dist/functions/NavigationFunctions.d.ts +5 -2
  89. package/dist/functions/NavigationFunctions.js.map +1 -1
  90. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  91. package/dist/functions/RoutineFunctions.d.mts +5 -2
  92. package/dist/functions/RoutineFunctions.d.ts +5 -2
  93. package/dist/functions/RoutineFunctions.js.map +1 -1
  94. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  95. package/dist/functions/index.d.mts +5 -2
  96. package/dist/functions/index.d.ts +5 -2
  97. package/dist/functions/index.js.map +1 -1
  98. package/dist/functions/index.mjs.map +1 -1
  99. package/dist/index.d.mts +9 -4
  100. package/dist/index.d.ts +9 -4
  101. package/dist/index.js +171 -154
  102. package/dist/index.js.map +1 -1
  103. package/dist/index.mjs +171 -154
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interface/ActivityProps.d.mts +3 -0
  106. package/dist/interface/ActivityProps.d.ts +3 -0
  107. package/dist/{override/OnRunActivityProps.js → interface/ActivityProps.js} +1 -1
  108. package/dist/interface/ActivityProps.mjs +3 -0
  109. package/dist/interface/CommitmentProps.d.mts +8 -0
  110. package/dist/interface/CommitmentProps.d.ts +8 -0
  111. package/dist/interface/CommitmentProps.js +4 -0
  112. package/dist/interface/CommitmentProps.js.map +1 -0
  113. package/dist/interface/CommitmentProps.mjs +3 -0
  114. package/dist/interface/CommitmentProps.mjs.map +1 -0
  115. package/dist/interface/RoomActivityMemory.d.mts +9 -0
  116. package/dist/interface/RoomActivityMemory.d.ts +9 -0
  117. package/dist/interface/RoomActivityMemory.js +4 -0
  118. package/dist/interface/RoomActivityMemory.js.map +1 -0
  119. package/dist/interface/RoomActivityMemory.mjs +3 -0
  120. package/dist/interface/RoomActivityMemory.mjs.map +1 -0
  121. package/dist/interface/RoomProps.d.mts +8 -0
  122. package/dist/interface/RoomProps.d.ts +8 -0
  123. package/dist/interface/RoomProps.js +4 -0
  124. package/dist/interface/RoomProps.js.map +1 -0
  125. package/dist/interface/RoomProps.mjs +3 -0
  126. package/dist/interface/RoomProps.mjs.map +1 -0
  127. package/dist/interface/index.d.mts +12 -0
  128. package/dist/interface/index.d.ts +12 -0
  129. package/dist/interface/index.js +4 -0
  130. package/dist/interface/index.js.map +1 -0
  131. package/dist/interface/index.mjs +3 -0
  132. package/dist/interface/index.mjs.map +1 -0
  133. package/dist/interface/navigation/LocationProps.d.mts +8 -0
  134. package/dist/interface/navigation/LocationProps.d.ts +8 -0
  135. package/dist/interface/navigation/LocationProps.js +4 -0
  136. package/dist/interface/navigation/LocationProps.js.map +1 -0
  137. package/dist/interface/navigation/LocationProps.mjs +3 -0
  138. package/dist/interface/navigation/LocationProps.mjs.map +1 -0
  139. package/dist/interface/navigation/MapProps.d.mts +8 -0
  140. package/dist/interface/navigation/MapProps.d.ts +8 -0
  141. package/dist/interface/navigation/MapProps.js +4 -0
  142. package/dist/interface/navigation/MapProps.js.map +1 -0
  143. package/dist/interface/navigation/MapProps.mjs +3 -0
  144. package/dist/interface/navigation/MapProps.mjs.map +1 -0
  145. package/dist/interface/quest/GoalProps.d.mts +7 -0
  146. package/dist/interface/quest/GoalProps.d.ts +7 -0
  147. package/dist/interface/quest/GoalProps.js +4 -0
  148. package/dist/interface/quest/GoalProps.js.map +1 -0
  149. package/dist/interface/quest/GoalProps.mjs +3 -0
  150. package/dist/interface/quest/GoalProps.mjs.map +1 -0
  151. package/dist/interface/quest/QuestProps.d.mts +9 -0
  152. package/dist/interface/quest/QuestProps.d.ts +9 -0
  153. package/dist/interface/quest/QuestProps.js +4 -0
  154. package/dist/interface/quest/QuestProps.js.map +1 -0
  155. package/dist/interface/quest/QuestProps.mjs +3 -0
  156. package/dist/interface/quest/QuestProps.mjs.map +1 -0
  157. package/dist/interface/quest/StageProps.d.mts +5 -0
  158. package/dist/interface/quest/StageProps.d.ts +5 -0
  159. package/dist/interface/quest/StageProps.js +4 -0
  160. package/dist/interface/quest/StageProps.js.map +1 -0
  161. package/dist/interface/quest/StageProps.mjs +3 -0
  162. package/dist/interface/quest/StageProps.mjs.map +1 -0
  163. package/dist/managers/TimeManager.d.mts +1 -1
  164. package/dist/managers/TimeManager.d.ts +1 -1
  165. package/dist/managers/TimeManager.js +1 -1
  166. package/dist/managers/TimeManager.js.map +1 -1
  167. package/dist/managers/TimeManager.mjs +1 -1
  168. package/dist/managers/TimeManager.mjs.map +1 -1
  169. package/dist/managers/index.js +1 -1
  170. package/dist/managers/index.js.map +1 -1
  171. package/dist/managers/index.mjs +1 -1
  172. package/dist/managers/index.mjs.map +1 -1
  173. package/dist/override/{OnRunActivityProps.d.mts → OnRunProps.d.mts} +3 -3
  174. package/dist/override/{OnRunActivityProps.d.ts → OnRunProps.d.ts} +3 -3
  175. package/dist/override/OnRunProps.js +4 -0
  176. package/dist/override/OnRunProps.js.map +1 -0
  177. package/dist/override/OnRunProps.mjs +3 -0
  178. package/dist/override/OnRunProps.mjs.map +1 -0
  179. package/dist/override/index.d.mts +1 -1
  180. package/dist/override/index.d.ts +1 -1
  181. package/dist/types/OnRunActivityEvent.d.mts +8 -0
  182. package/dist/types/OnRunActivityEvent.d.ts +8 -0
  183. package/dist/types/OnRunActivityEvent.js +4 -0
  184. package/dist/types/OnRunActivityEvent.js.map +1 -0
  185. package/dist/types/OnRunActivityEvent.mjs +3 -0
  186. package/dist/types/OnRunActivityEvent.mjs.map +1 -0
  187. package/dist/types/OnRunCommitmentEvent.d.mts +8 -0
  188. package/dist/types/OnRunCommitmentEvent.d.ts +8 -0
  189. package/dist/types/OnRunCommitmentEvent.js +4 -0
  190. package/dist/types/OnRunCommitmentEvent.js.map +1 -0
  191. package/dist/types/OnRunCommitmentEvent.mjs +3 -0
  192. package/dist/types/OnRunCommitmentEvent.mjs.map +1 -0
  193. package/dist/types/QuestsRequired.d.mts +4 -2
  194. package/dist/types/QuestsRequired.d.ts +4 -2
  195. package/dist/types/index.d.mts +4 -2
  196. package/dist/types/index.d.ts +4 -2
  197. package/package.json +2 -2
  198. package/dist/classes/navigation/index.d.mts +0 -5
  199. package/dist/classes/navigation/index.d.ts +0 -5
  200. package/dist/classes/navigation/index.js +0 -987
  201. package/dist/classes/navigation/index.js.map +0 -1
  202. package/dist/classes/navigation/index.mjs +0 -983
  203. package/dist/classes/navigation/index.mjs.map +0 -1
  204. package/dist/classes/quest/index.d.mts +0 -3
  205. package/dist/classes/quest/index.d.ts +0 -3
  206. package/dist/classes/quest/index.js +0 -133
  207. package/dist/classes/quest/index.js.map +0 -1
  208. package/dist/classes/quest/index.mjs +0 -129
  209. package/dist/classes/quest/index.mjs.map +0 -1
  210. package/dist/override/OnRunActivityProps.mjs +0 -3
  211. /package/dist/{override/OnRunActivityProps.js.map → interface/ActivityProps.js.map} +0 -0
  212. /package/dist/{override/OnRunActivityProps.mjs.map → interface/ActivityProps.mjs.map} +0 -0
@@ -1,129 +1,43 @@
1
- import { GraphicItemType, OnRenderGraphicItemProps, OnRunActivityProps } from '@drincs/nqtr/dist/override';
1
+ import { OnRenderGraphicItemProps, GraphicItemType, OnRunProps } from '@drincs/nqtr/dist/override';
2
+ import { A as ActivityProps, a as ActivityStoredAbstract } from '../ActivityProps-BoJeWa2B.mjs';
3
+ import { OnRunActivityEvent } from '../types/OnRunActivityEvent.mjs';
2
4
 
3
- interface ActivityProps {
4
- /**
5
- * The name
6
- * @default ""
7
- */
8
- name?: string;
9
- /**
10
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
11
- * If you set 3, the activity will be hidden into hours 1 and 2, and will be shown from hour 3.
12
- * @default TimeManager.minDayHours
13
- */
14
- fromHour?: number;
15
- /**
16
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
17
- * If you set 3, the activity will be shown into hours 1 and 2 and will be hidden from hour 3.
18
- * @default TimeManager.maxDayHours + 1
19
- */
20
- toHour?: number;
21
- /**
22
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
23
- * If you set 3, the activity will be hidden into days 1 and 2, and will be shown from day 3.
24
- * @default undefined
25
- */
26
- fromDay?: number;
27
- /**
28
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
29
- * If you set 3, the activity will be shown into days 1 and 2 and will be deleted or hidden from day 3.
30
- * @default undefined
31
- */
32
- toDay?: number;
33
- /**
34
- * Whether is disabled. You can also pass a Pixi'VN flag name.
35
- * @default false
36
- */
37
- disabled?: boolean | string;
38
- /**
39
- * Whether is hidden. You can also pass a Pixi'VN flag name.
40
- * @default false
41
- */
42
- hidden?: boolean | string;
43
- /**
44
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
45
- * @default undefined
46
- */
47
- renderIcon?: GraphicItemType | ((activity: ActivityStoredAbstract, props?: OnRenderGraphicItemProps) => GraphicItemType);
48
- }
49
- /**
50
- * The function that is called when the activity is runned.
51
- */
52
- type OnRunActivityEvent<T> = (activity: T, props?: OnRunActivityProps) => void;
53
- declare abstract class ActivityStoredAbstract {
54
- /**
55
- * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
56
- * @param props The activity properties.
57
- */
58
- constructor(onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
59
- abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
60
- abstract getStorageProperty<T>(propertyName: string): T | undefined;
61
- abstract get id(): string;
62
- private defaultName?;
63
- /**
64
- * The name
65
- */
66
- get name(): string;
67
- set name(value: string | undefined);
68
- private defaultFromHour?;
69
- /**
70
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
71
- */
72
- get fromHour(): number;
73
- set fromHour(value: number | undefined);
74
- private defaultToHour?;
75
- /**
76
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
77
- */
78
- get toHour(): number;
79
- set toHour(value: number | undefined);
80
- private defaultFromDay?;
81
- /**
82
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
83
- */
84
- get fromDay(): number | undefined;
85
- set fromDay(value: number | undefined);
86
- private defaultToDay?;
87
- /**
88
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
89
- */
90
- get toDay(): number | undefined;
91
- set toDay(value: number | undefined);
92
- private defaultDisabled;
93
- /**
94
- * Whether is disabled.
95
- */
96
- get disabled(): boolean;
97
- set disabled(value: boolean | string);
98
- private defaultHidden;
99
- /**
100
- * Whether is hidden. If the activity is not started yet, it will be hidden.
101
- */
102
- get hidden(): boolean;
103
- set hidden(value: boolean | string);
104
- private _renderIcon?;
105
- /**
106
- * The function for rendering the icon of the activity.
107
- */
108
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
109
- private _onRun;
110
- /**
111
- * The function that is called when the activity is runned.
112
- */
113
- get onRun(): (props?: OnRunActivityProps) => void;
114
- /**
115
- * Whether the activity is a deadline.
116
- * @returns Whether the activity is a deadline.
117
- */
118
- isExpired(): boolean;
119
- /**
120
- * Export the activity properties.
121
- * @returns The activity properties.
122
- */
123
- export(): ActivityProps;
124
- }
125
5
  /**
126
- * The activity model.
6
+ * The activity model. It is used to create an activity.
7
+ * @example
8
+ * ```tsx
9
+ * export const nap = new ActivityModel("nap",
10
+ * (_, event) => {
11
+ * if (event) {
12
+ * event.navigate("/game")
13
+ * callLabelWithGoNavigationCallBack(napLabel, event)
14
+ * }
15
+ * else {
16
+ * console.error("Event is undefined")
17
+ * }
18
+ * },
19
+ * {
20
+ * name: "Nap",
21
+ * fromHour: 5,
22
+ * toHour: 23,
23
+ * renderIcon: (activity, props) => {
24
+ * return <Button
25
+ * disabled={activity.disabled}
26
+ * onClick={() => {
27
+ * if (!props) {
28
+ * console.error("Props is undefined")
29
+ * return
30
+ * }
31
+ * activity.onRun(props)
32
+ * }}
33
+ * ariaLabel={activity.name}
34
+ * >
35
+ * <BedIcon />
36
+ * </Button>
37
+ * },
38
+ * }
39
+ * )
40
+ * ```
127
41
  */
128
42
  declare class ActivityModel {
129
43
  /**
@@ -176,13 +90,13 @@ declare class ActivityModel {
176
90
  /**
177
91
  * The function for rendering the icon of the activity.
178
92
  */
179
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
93
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
180
94
  private _onRun;
181
95
  get _initialOnRun(): OnRunActivityEvent<ActivityStoredAbstract>;
182
96
  /**
183
97
  * The function that is called when the activity is runned.
184
98
  */
185
- get onRun(): (props?: OnRunActivityProps) => void;
99
+ get onRun(): (props: OnRunProps) => void;
186
100
  /**
187
101
  * Whether the activity is a deadline.
188
102
  * @returns Whether the activity is a deadline.
@@ -195,4 +109,4 @@ declare class ActivityModel {
195
109
  export(): ActivityProps;
196
110
  }
197
111
 
198
- export { type ActivityProps, ActivityStoredAbstract, type OnRunActivityEvent, ActivityModel as default };
112
+ export { ActivityModel as default };
@@ -1,129 +1,43 @@
1
- import { GraphicItemType, OnRenderGraphicItemProps, OnRunActivityProps } from '@drincs/nqtr/dist/override';
1
+ import { OnRenderGraphicItemProps, GraphicItemType, OnRunProps } from '@drincs/nqtr/dist/override';
2
+ import { A as ActivityProps, a as ActivityStoredAbstract } from '../ActivityProps-_79x9-BX.js';
3
+ import { OnRunActivityEvent } from '../types/OnRunActivityEvent.js';
2
4
 
3
- interface ActivityProps {
4
- /**
5
- * The name
6
- * @default ""
7
- */
8
- name?: string;
9
- /**
10
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
11
- * If you set 3, the activity will be hidden into hours 1 and 2, and will be shown from hour 3.
12
- * @default TimeManager.minDayHours
13
- */
14
- fromHour?: number;
15
- /**
16
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
17
- * If you set 3, the activity will be shown into hours 1 and 2 and will be hidden from hour 3.
18
- * @default TimeManager.maxDayHours + 1
19
- */
20
- toHour?: number;
21
- /**
22
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
23
- * If you set 3, the activity will be hidden into days 1 and 2, and will be shown from day 3.
24
- * @default undefined
25
- */
26
- fromDay?: number;
27
- /**
28
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
29
- * If you set 3, the activity will be shown into days 1 and 2 and will be deleted or hidden from day 3.
30
- * @default undefined
31
- */
32
- toDay?: number;
33
- /**
34
- * Whether is disabled. You can also pass a Pixi'VN flag name.
35
- * @default false
36
- */
37
- disabled?: boolean | string;
38
- /**
39
- * Whether is hidden. You can also pass a Pixi'VN flag name.
40
- * @default false
41
- */
42
- hidden?: boolean | string;
43
- /**
44
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
45
- * @default undefined
46
- */
47
- renderIcon?: GraphicItemType | ((activity: ActivityStoredAbstract, props?: OnRenderGraphicItemProps) => GraphicItemType);
48
- }
49
- /**
50
- * The function that is called when the activity is runned.
51
- */
52
- type OnRunActivityEvent<T> = (activity: T, props?: OnRunActivityProps) => void;
53
- declare abstract class ActivityStoredAbstract {
54
- /**
55
- * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
56
- * @param props The activity properties.
57
- */
58
- constructor(onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
59
- abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
60
- abstract getStorageProperty<T>(propertyName: string): T | undefined;
61
- abstract get id(): string;
62
- private defaultName?;
63
- /**
64
- * The name
65
- */
66
- get name(): string;
67
- set name(value: string | undefined);
68
- private defaultFromHour?;
69
- /**
70
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
71
- */
72
- get fromHour(): number;
73
- set fromHour(value: number | undefined);
74
- private defaultToHour?;
75
- /**
76
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
77
- */
78
- get toHour(): number;
79
- set toHour(value: number | undefined);
80
- private defaultFromDay?;
81
- /**
82
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
83
- */
84
- get fromDay(): number | undefined;
85
- set fromDay(value: number | undefined);
86
- private defaultToDay?;
87
- /**
88
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
89
- */
90
- get toDay(): number | undefined;
91
- set toDay(value: number | undefined);
92
- private defaultDisabled;
93
- /**
94
- * Whether is disabled.
95
- */
96
- get disabled(): boolean;
97
- set disabled(value: boolean | string);
98
- private defaultHidden;
99
- /**
100
- * Whether is hidden. If the activity is not started yet, it will be hidden.
101
- */
102
- get hidden(): boolean;
103
- set hidden(value: boolean | string);
104
- private _renderIcon?;
105
- /**
106
- * The function for rendering the icon of the activity.
107
- */
108
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
109
- private _onRun;
110
- /**
111
- * The function that is called when the activity is runned.
112
- */
113
- get onRun(): (props?: OnRunActivityProps) => void;
114
- /**
115
- * Whether the activity is a deadline.
116
- * @returns Whether the activity is a deadline.
117
- */
118
- isExpired(): boolean;
119
- /**
120
- * Export the activity properties.
121
- * @returns The activity properties.
122
- */
123
- export(): ActivityProps;
124
- }
125
5
  /**
126
- * The activity model.
6
+ * The activity model. It is used to create an activity.
7
+ * @example
8
+ * ```tsx
9
+ * export const nap = new ActivityModel("nap",
10
+ * (_, event) => {
11
+ * if (event) {
12
+ * event.navigate("/game")
13
+ * callLabelWithGoNavigationCallBack(napLabel, event)
14
+ * }
15
+ * else {
16
+ * console.error("Event is undefined")
17
+ * }
18
+ * },
19
+ * {
20
+ * name: "Nap",
21
+ * fromHour: 5,
22
+ * toHour: 23,
23
+ * renderIcon: (activity, props) => {
24
+ * return <Button
25
+ * disabled={activity.disabled}
26
+ * onClick={() => {
27
+ * if (!props) {
28
+ * console.error("Props is undefined")
29
+ * return
30
+ * }
31
+ * activity.onRun(props)
32
+ * }}
33
+ * ariaLabel={activity.name}
34
+ * >
35
+ * <BedIcon />
36
+ * </Button>
37
+ * },
38
+ * }
39
+ * )
40
+ * ```
127
41
  */
128
42
  declare class ActivityModel {
129
43
  /**
@@ -176,13 +90,13 @@ declare class ActivityModel {
176
90
  /**
177
91
  * The function for rendering the icon of the activity.
178
92
  */
179
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
93
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
180
94
  private _onRun;
181
95
  get _initialOnRun(): OnRunActivityEvent<ActivityStoredAbstract>;
182
96
  /**
183
97
  * The function that is called when the activity is runned.
184
98
  */
185
- get onRun(): (props?: OnRunActivityProps) => void;
99
+ get onRun(): (props: OnRunProps) => void;
186
100
  /**
187
101
  * Whether the activity is a deadline.
188
102
  * @returns Whether the activity is a deadline.
@@ -195,4 +109,4 @@ declare class ActivityModel {
195
109
  export(): ActivityProps;
196
110
  }
197
111
 
198
- export { type ActivityProps, ActivityStoredAbstract, type OnRunActivityEvent, ActivityModel as default };
112
+ export { ActivityModel as default };
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var pixiVn = require('@drincs/pixi-vn');
6
4
 
7
5
  // src/classes/Activity.ts
@@ -182,7 +180,7 @@ var TimeManager = class _TimeManager {
182
180
  * Get the current TimeManager.timeSlots index.
183
181
  * You can use this property to create "Image that changes based on the time period":
184
182
  * @example
185
- * ```ts
183
+ * ```tsx
186
184
  * import { TimeManager } from '@drincs/nqtr';
187
185
  *
188
186
  * function changeBackground() {
@@ -249,152 +247,6 @@ var TimeManager = class _TimeManager {
249
247
  };
250
248
 
251
249
  // src/classes/Activity.ts
252
- var ActivityStoredAbstract = class {
253
- /**
254
- * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
255
- * @param props The activity properties.
256
- */
257
- constructor(onRun, props) {
258
- this.defaultName = props.name;
259
- this.defaultFromHour = props.fromHour;
260
- this.defaultToHour = props.toHour;
261
- this.defaultFromDay = props.fromDay;
262
- this.defaultToDay = props.toDay;
263
- this.defaultDisabled = props.disabled || false;
264
- this.defaultHidden = props.hidden || false;
265
- this._renderIcon = props.renderIcon;
266
- this._onRun = onRun;
267
- }
268
- /**
269
- * The name
270
- */
271
- get name() {
272
- return this.getStorageProperty("name") || this.defaultName || "";
273
- }
274
- set name(value) {
275
- this.setStorageProperty("name", value);
276
- }
277
- /**
278
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
279
- */
280
- get fromHour() {
281
- return this.getStorageProperty("fromHour") || this.defaultFromHour || TimeManager.minDayHours;
282
- }
283
- set fromHour(value) {
284
- this.setStorageProperty("fromHour", value);
285
- }
286
- /**
287
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
288
- */
289
- get toHour() {
290
- return this.getStorageProperty("toHour") || this.defaultToHour || TimeManager.maxDayHours + 1;
291
- }
292
- set toHour(value) {
293
- this.setStorageProperty("toHour", value);
294
- }
295
- /**
296
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
297
- */
298
- get fromDay() {
299
- return this.getStorageProperty("fromDay") || this.defaultFromDay;
300
- }
301
- set fromDay(value) {
302
- this.setStorageProperty("fromDay", value);
303
- }
304
- /**
305
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
306
- */
307
- get toDay() {
308
- return this.getStorageProperty("toDay") || this.defaultToDay;
309
- }
310
- set toDay(value) {
311
- this.setStorageProperty("toDay", value);
312
- }
313
- /**
314
- * Whether is disabled.
315
- */
316
- get disabled() {
317
- let value = this.getStorageProperty("disabled") || this.defaultDisabled;
318
- if (typeof value === "string") {
319
- return pixiVn.getFlag(value);
320
- }
321
- return value;
322
- }
323
- set disabled(value) {
324
- this.setStorageProperty("disabled", value);
325
- }
326
- /**
327
- * Whether is hidden. If the activity is not started yet, it will be hidden.
328
- */
329
- get hidden() {
330
- if (this.fromDay && this.fromDay > TimeManager.currentDay) {
331
- return true;
332
- }
333
- if (!TimeManager.nowIsBetween(this.fromHour, this.toHour)) {
334
- return true;
335
- }
336
- if (!this.isExpired) {
337
- return true;
338
- }
339
- let value = this.getStorageProperty("hidden") || this.defaultHidden;
340
- if (typeof value === "string") {
341
- return pixiVn.getFlag(value);
342
- }
343
- return value;
344
- }
345
- set hidden(value) {
346
- this.setStorageProperty("hidden", value);
347
- }
348
- /**
349
- * The function for rendering the icon of the activity.
350
- */
351
- get renderIcon() {
352
- let render = this._renderIcon;
353
- if (render === void 0) {
354
- return void 0;
355
- }
356
- if (typeof render === "function") {
357
- return (props) => {
358
- return render(this, props);
359
- };
360
- }
361
- return (props) => render;
362
- }
363
- /**
364
- * The function that is called when the activity is runned.
365
- */
366
- get onRun() {
367
- return (props) => {
368
- return this._onRun(this, props);
369
- };
370
- }
371
- /**
372
- * Whether the activity is a deadline.
373
- * @returns Whether the activity is a deadline.
374
- */
375
- isExpired() {
376
- if (this.toDay && this.toDay <= TimeManager.currentDay) {
377
- return true;
378
- }
379
- return false;
380
- }
381
- /**
382
- * Export the activity properties.
383
- * @returns The activity properties.
384
- */
385
- export() {
386
- return {
387
- name: this.getStorageProperty("name") || this.defaultName,
388
- fromHour: this.getStorageProperty("fromHour") || this.defaultFromHour,
389
- toHour: this.getStorageProperty("toHour") || this.defaultToHour,
390
- fromDay: this.getStorageProperty("fromDay") || this.defaultFromDay,
391
- toDay: this.getStorageProperty("toDay") || this.defaultToDay,
392
- disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
393
- hidden: this.getStorageProperty("hidden") || this.defaultHidden,
394
- renderIcon: this._renderIcon
395
- };
396
- }
397
- };
398
250
  var ActivityModel = class {
399
251
  /**
400
252
  * @param id The activity id, that must be unique.
@@ -525,7 +377,6 @@ var ActivityModel = class {
525
377
  }
526
378
  };
527
379
 
528
- exports.ActivityStoredAbstract = ActivityStoredAbstract;
529
- exports.default = ActivityModel;
380
+ module.exports = ActivityModel;
530
381
  //# sourceMappingURL=out.js.map
531
382
  //# sourceMappingURL=Activity.js.map