@drincs/nqtr 0.6.0 → 0.7.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.
Files changed (55) hide show
  1. package/dist/handlers.cjs +1 -0
  2. package/dist/handlers.d.mts +606 -0
  3. package/dist/handlers.d.ts +606 -0
  4. package/dist/handlers.mjs +1 -0
  5. package/dist/index.cjs +1 -2
  6. package/dist/index.d.mts +1391 -23
  7. package/dist/index.d.ts +1391 -23
  8. package/dist/index.mjs +1 -2
  9. package/dist/ink.cjs +1 -0
  10. package/dist/ink.mjs +0 -0
  11. package/dist/registries.cjs +1 -0
  12. package/dist/registries.d.mts +516 -0
  13. package/dist/registries.d.ts +516 -0
  14. package/dist/registries.mjs +1 -0
  15. package/package.json +40 -8
  16. package/dist/RoomInterface-BhP3JgjH.d.ts +0 -182
  17. package/dist/RoomInterface-V1-hwph_.d.mts +0 -182
  18. package/dist/StageInterface-v96_K9Tg.d.mts +0 -188
  19. package/dist/StageInterface-v96_K9Tg.d.ts +0 -188
  20. package/dist/classes/index.cjs +0 -2
  21. package/dist/classes/index.cjs.map +0 -1
  22. package/dist/classes/index.d.mts +0 -515
  23. package/dist/classes/index.d.ts +0 -515
  24. package/dist/classes/index.mjs +0 -2
  25. package/dist/classes/index.mjs.map +0 -1
  26. package/dist/decorators/index.cjs +0 -2
  27. package/dist/decorators/index.cjs.map +0 -1
  28. package/dist/decorators/index.d.mts +0 -164
  29. package/dist/decorators/index.d.ts +0 -164
  30. package/dist/decorators/index.mjs +0 -2
  31. package/dist/decorators/index.mjs.map +0 -1
  32. package/dist/index-B8O3zxyP.d.ts +0 -269
  33. package/dist/index-BgY2U2li.d.mts +0 -199
  34. package/dist/index-CzOd-Rin.d.mts +0 -269
  35. package/dist/index-cbTx3r0P.d.ts +0 -199
  36. package/dist/index.cjs.map +0 -1
  37. package/dist/index.mjs.map +0 -1
  38. package/dist/interface/index.cjs +0 -2
  39. package/dist/interface/index.cjs.map +0 -1
  40. package/dist/interface/index.d.mts +0 -6
  41. package/dist/interface/index.d.ts +0 -6
  42. package/dist/interface/index.mjs +0 -2
  43. package/dist/interface/index.mjs.map +0 -1
  44. package/dist/managers/index.cjs +0 -2
  45. package/dist/managers/index.cjs.map +0 -1
  46. package/dist/managers/index.d.mts +0 -7
  47. package/dist/managers/index.d.ts +0 -7
  48. package/dist/managers/index.mjs +0 -2
  49. package/dist/managers/index.mjs.map +0 -1
  50. package/dist/types/index.cjs +0 -2
  51. package/dist/types/index.cjs.map +0 -1
  52. package/dist/types/index.d.mts +0 -65
  53. package/dist/types/index.d.ts +0 -65
  54. package/dist/types/index.mjs +0 -2
  55. package/dist/types/index.mjs.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,27 +1,1395 @@
1
- import { N as NavigatorManager, Q as QuestManager, R as RoutineManager, T as TimeManager } from './index-cbTx3r0P.js';
2
- export { n as navigator, q as questsNotebook, r as routine, t as timeTracker } from './index-cbTx3r0P.js';
3
- import { ActivityBaseModel, ActivityStoredClass, CommitmentBaseModel, CommitmentStoredClass, LocationBaseModel, LocationStoredClass, MapBaseModel, MapStoredClass, RoomBaseModel, RoomStoredClass, QuestBaseModel, QuestStoredClass, StageBaseModel, StageStoredClass } from './classes/index.js';
4
- export { ActivityStoredClassProps, CommitmentStoredClassProps, QuestStoredClassProps, StageStoredClassProps } from './classes/index.js';
5
- import { RegisteredActivities, RegisteredCommitments, RegisteredLocations, RegisteredMaps, RegisteredQuests as RegisteredQuest, RegisteredRooms } from './decorators/index.js';
6
- export { A as ActivityInterface, C as CommitmentInterface, D as DateSchedulingInterface, L as LocationInterface, M as MapInterface, R as RoomInterface, T as TimeSchedulingInterface } from './RoomInterface-BhP3JgjH.js';
7
- export { A as ActivityProps, C as CommitmentProps, L as LocationBaseModelProps, M as MapBaseModelProps, Q as QuestProps, R as RoomBaseModelProps, S as StageProps } from './index-B8O3zxyP.js';
8
- export { E as ExecutionType, O as OnRunAsyncFunction, a as OnRunEvent, b as OnRunFunction, c as OnRunProps, Q as QuestInterface, d as QuestsRequiredType, S as StageInterface } from './StageInterface-v96_K9Tg.js';
9
- export { ITimeStlot, TimeSettings } from './types/index.js';
10
- import '@drincs/nqtr';
11
- import '@drincs/pixi-vn';
12
- import '@drincs/pixi-vn/storage';
1
+ export * from '@drincs/nqtr/handlers';
2
+ import * as registries from '@drincs/nqtr/registries';
3
+ export { RegisteredActivities, RegisteredCommitments, RegisteredLocations, RegisteredMaps, RegisteredQuests, RegisteredRooms } from '@drincs/nqtr/registries';
4
+ import { OnRunProps as OnRunProps$1, ActivityInterface as ActivityInterface$1, CommitmentInterface as CommitmentInterface$1, LocationInterface as LocationInterface$1, MapInterface as MapInterface$1, RoomInterface as RoomInterface$1, QuestInterface as QuestInterface$1, StageInterface as StageInterface$1 } from '@drincs/nqtr';
5
+ import { StoredClassModel } from '@drincs/pixi-vn/storage';
6
+ import { CharacterInterface } from '@drincs/pixi-vn';
7
+
8
+ type ExecutionType = "automatic" | "interaction";
9
+
10
+ type OnRunProps = OnRunProps$1;
11
+ /**
12
+ * The function that is called when the class is runned.
13
+ */
14
+ type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
15
+ type OnRunFunction = (props: OnRunProps) => any | Promise<any>;
16
+ type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
17
+
18
+ type QuestsRequiredType = {
19
+ quest: QuestInterface;
20
+ stageNumber: number;
21
+ };
22
+
23
+ type TimeSlotInterface = {
24
+ name: string;
25
+ startTime: number;
26
+ };
27
+ /**
28
+ * Time Settings, which can be set using {@link timeTracker.editSettings}
29
+ */
30
+ type TimeSettings = {
31
+ /**
32
+ * Minimum time of the day
33
+ * @default 0
34
+ */
35
+ dayStartTime?: number;
36
+ /**
37
+ * Maximum time of the day
38
+ * @default 24
39
+ */
40
+ dayEndTime?: number;
41
+ /**
42
+ * Default time spent
43
+ * @default 1
44
+ */
45
+ defaultTimeSpent?: number;
46
+ /**
47
+ * Time slots
48
+ * @default []
49
+ * @example
50
+ * ```ts
51
+ * [
52
+ * { name: 'Morning', startTime: 5 },
53
+ * { name: 'Afternoon', startTime: 12 },
54
+ * { name: 'Evening', startTime: 18 },
55
+ * { name: 'Night', startTime: 22 }
56
+ * ]
57
+ */
58
+ timeSlots?: TimeSlotInterface[];
59
+ /**
60
+ * Week length
61
+ * @default 7
62
+ */
63
+ weekLength?: number;
64
+ /**
65
+ * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6
66
+ * @default weekLength - 1
67
+ */
68
+ weekendStartDay?: number;
69
+ /**
70
+ * Week days name
71
+ * @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
72
+ * @returns The name of the week day.
73
+ * @example
74
+ * ```ts
75
+ * (weekDayNumber: number) => {
76
+ * const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
77
+ * return weekDaysNames[weekDayNumber];
78
+ * }
79
+ * ```
80
+ */
81
+ getDayName?: (weekDayNumber: number) => string;
82
+ };
83
+
84
+ interface DateSchedulingInterface {
85
+ /**
86
+ * The start date. If the item hasn't started yet, it will be hidden.
87
+ * If you set it to 3, the item will be hidden on dates 1 and 2 and will be shown starting on date 3.
88
+ */
89
+ from: number;
90
+ /**
91
+ * The date when the item ends. If the item is ended yet, it will be deleted or hidden.
92
+ * If you set { from: 0, to: 3 }, the item will be shown into dates 1 and 2 and will be deleted or hidden from date 3.
93
+ * @default undefined
94
+ */
95
+ to?: number;
96
+ }
97
+
98
+ interface TimeSchedulingInterface {
99
+ /**
100
+ * The time when the item starts. If the item is not started yet, it will be hidden.
101
+ * If you set 3, the item will be hidden into times 1 and 2, and will be shown from time 3.
102
+ */
103
+ from: number;
104
+ /**
105
+ * The time when the item ends. If the item is ended yet, it will be hidden.
106
+ * If you set 3, the item will be shown into times 1 and 2 and will be hidden from time 3.
107
+ * @default timeTracker.dayEndTime + 1
108
+ */
109
+ to?: number;
110
+ }
111
+
112
+ interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 {
113
+ }
114
+ interface ActivityBaseInternalInterface {
115
+ /**
116
+ * The id of the activity/commitment.
117
+ */
118
+ readonly id: string;
119
+ /**
120
+ * Time slot in which activity/commitment will be active.
121
+ */
122
+ readonly timeSlot: TimeSchedulingInterface | undefined;
123
+ /**
124
+ * Used to schedule what date it will be added and removed.
125
+ */
126
+ readonly dateScheduling: DateSchedulingInterface | undefined;
127
+ /**
128
+ * The function that is called when the activity/commitment is runned.
129
+ */
130
+ readonly run: OnRunAsyncFunction;
131
+ /**
132
+ * Whether the activity/commitment is a deadline, so it will then be removed or hidden.
133
+ *
134
+ * It **depends only on the date**, not the time. So if you set { dateScheduling: { from: 0, to: 3 }, timeSlot { from: 10, to: 20 } } the activity/commitment hidden or deleted on date 3 at 0.
135
+ */
136
+ readonly expired: boolean;
137
+ /**
138
+ * Whether the activity/commitment is active.
139
+ */
140
+ readonly isActive: boolean;
141
+ }
142
+
143
+ interface ActivityProps {
144
+ /**
145
+ * The name
146
+ * @default ""
147
+ */
148
+ name?: string;
149
+ /**
150
+ * Time slot in which activity/commitment will be active.
151
+ */
152
+ timeSlot?: TimeSchedulingInterface;
153
+ /**
154
+ * Used to schedule what date it will be added and removed.
155
+ */
156
+ dateScheduling?: DateSchedulingInterface;
157
+ /**
158
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
159
+ * @default false
160
+ */
161
+ disabled?: boolean | string;
162
+ /**
163
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
164
+ * @default false
165
+ */
166
+ hidden?: boolean | string;
167
+ /**
168
+ * The icon of the activity.
169
+ * @default undefined
170
+ */
171
+ renderIcon?: string;
172
+ }
173
+
174
+ interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 {
175
+ }
176
+ interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface {
177
+ /**
178
+ * The character or characters that are in the commitment and so in the room.
179
+ */
180
+ readonly characters: CharacterInterface[];
181
+ /**
182
+ * The room where the commitment is.
183
+ */
184
+ readonly room: RoomInterface;
185
+ /**
186
+ * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
187
+ * If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
188
+ */
189
+ executionType: ExecutionType;
190
+ /**
191
+ * The priority. The higher the number, the higher the priority.
192
+ * To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.
193
+ */
194
+ priority: number;
195
+ }
196
+
197
+ interface CommitmentProps {
198
+ /**
199
+ * The name
200
+ * @default ""
201
+ */
202
+ name?: string;
203
+ /**
204
+ * Time slot in which activity/commitment will be active.
205
+ */
206
+ readonly timeSlot?: TimeSchedulingInterface | undefined;
207
+ /**
208
+ * Used to schedule what date it will be added and removed.
209
+ */
210
+ readonly dateScheduling?: DateSchedulingInterface | undefined;
211
+ /**
212
+ * The image ofthe Commitment.
213
+ */
214
+ image?: string;
215
+ /**
216
+ * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
217
+ * If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
218
+ * @default "interaction"
219
+ */
220
+ executionType?: ExecutionType;
221
+ /**
222
+ * Is a function that is called when the player interacts with the character.
223
+ * @param commitment
224
+ * @returns
225
+ * @default undefined
226
+ */
227
+ onRun?: OnRunEvent<CommitmentInterface>;
228
+ /**
229
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
230
+ * If it is disabled this commitment will not be taken into consideration. So the characters will not be in the room, but will be busy with other commitments.
231
+ * @default false
232
+ */
233
+ disabled?: boolean | string;
234
+ /**
235
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
236
+ * @default false
237
+ */
238
+ hidden?: boolean | string;
239
+ /**
240
+ * The icon of the commitment.
241
+ */
242
+ icon?: string;
243
+ /**
244
+ * The priority. The higher the number, the higher the priority.
245
+ * To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.
246
+ * @default 0
247
+ */
248
+ priority?: number;
249
+ }
250
+
251
+ interface LocationBaseModelProps {
252
+ /**
253
+ * The name
254
+ * @default ""
255
+ */
256
+ name?: string;
257
+ /**
258
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
259
+ * @default false
260
+ */
261
+ disabled?: boolean | string;
262
+ /**
263
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
264
+ * @default false
265
+ */
266
+ hidden?: boolean | string;
267
+ /**
268
+ * The icon of the location.
269
+ * @default undefined
270
+ */
271
+ icon?: string;
272
+ /**
273
+ * The activities that are available in this location.
274
+ * @default []
275
+ */
276
+ activities?: ActivityInterface[];
277
+ }
278
+
279
+ interface NavigationAbstractInterface extends StoredClassModel {
280
+ /**
281
+ * Connects the activity to the class.
282
+ * @param activity The activity to connect to the class.
283
+ * @param options
284
+ * @returns
285
+ */
286
+ addActivity(activity: ActivityInterface, options?: {
287
+ /**
288
+ * Time slot in which activity will be active.
289
+ */
290
+ timeSlot?: TimeSchedulingInterface;
291
+ /**
292
+ * Used to schedule what date it will be added and removed.
293
+ */
294
+ dateScheduling?: DateSchedulingInterface;
295
+ }): void;
296
+ /**
297
+ * Disconnects the activity from the class.
298
+ * @param activity The activity to disconnect from the class.
299
+ * @param options
300
+ */
301
+ removeActivity(activity: ActivityInterface | string, options?: Pick<DateSchedulingInterface, "to">): void;
302
+ /**
303
+ * Removes the useless activities.
304
+ */
305
+ clearExpiredActivities(): void;
306
+ /**
307
+ * All the ids of the activities associated with this class. Compared to {@link activities}, they are not filtered based on their scheduling.
308
+ */
309
+ readonly activitiesIds: string[];
310
+ /**
311
+ * The activities associated with this class, filtered based on their scheduling.
312
+ */
313
+ activities: ActivityInterface[];
314
+ }
315
+
316
+ interface LocationInterface extends LocationInternalInterface, LocationInterface$1 {
317
+ }
318
+ interface LocationInternalInterface extends NavigationAbstractInterface {
319
+ /**
320
+ * The id of the location.
321
+ */
322
+ readonly id: string;
323
+ /**
324
+ * The map where the location is.
325
+ */
326
+ readonly map: MapInterface;
327
+ /**
328
+ * Get all rooms in the location.
329
+ * @returns The rooms in the location.
330
+ */
331
+ readonly rooms: RoomInterface[];
332
+ }
333
+
334
+ interface MapBaseModelProps {
335
+ /**
336
+ * The name
337
+ * @default ""
338
+ */
339
+ name?: string;
340
+ /**
341
+ * The image of the map.
342
+ * @default undefined
343
+ */
344
+ image?: string;
345
+ /**
346
+ * The activities that are available in this map.
347
+ * @default []
348
+ */
349
+ activities?: ActivityInterface[];
350
+ }
351
+
352
+ interface MapInterface extends MapBaseInternalInterface, MapInterface$1 {
353
+ }
354
+ interface MapBaseInternalInterface extends NavigationAbstractInterface {
355
+ /**
356
+ * The id of the map.
357
+ */
358
+ readonly id: string;
359
+ /**
360
+ * Get all locations in the map.
361
+ * @returns The locations in the map.
362
+ */
363
+ readonly locations: LocationInterface[];
364
+ }
365
+
366
+ interface RoomBaseModelProps {
367
+ /**
368
+ * The name
369
+ * @default ""
370
+ */
371
+ name?: string;
372
+ /**
373
+ * The image of the room.
374
+ * @default undefined
375
+ */
376
+ image?: string;
377
+ /**
378
+ * The activities that are available in this room.
379
+ * @default []
380
+ */
381
+ activities?: ActivityInterface[];
382
+ /**
383
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
384
+ * @default false
385
+ */
386
+ disabled?: boolean | string;
387
+ /**
388
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
389
+ * @default false
390
+ */
391
+ hidden?: boolean | string;
392
+ /**
393
+ * The icon of the room.
394
+ * @default undefined
395
+ */
396
+ icon?: string;
397
+ }
398
+
399
+ interface RoomInterface extends RoomBaseInternalInterface, RoomInterface$1 {
400
+ }
401
+ interface RoomBaseInternalInterface extends NavigationAbstractInterface {
402
+ /**
403
+ * The id of the room.
404
+ */
405
+ readonly id: string;
406
+ /**
407
+ * The location where the room is.
408
+ */
409
+ readonly location: LocationInterface;
410
+ /**
411
+ * Get the character commitments of the room.
412
+ */
413
+ readonly routine: CommitmentInterface[];
414
+ /**
415
+ * Get the characters in the room.
416
+ */
417
+ readonly characters: CharacterInterface[];
418
+ /**
419
+ * Get the functions that will be executed when the room is visited.
420
+ */
421
+ readonly automaticFunctions: OnRunAsyncFunction[];
422
+ }
423
+
424
+ interface QuestInterface extends QuestBaseInternalInterface, QuestInterface$1 {
425
+ }
426
+ interface QuestBaseInternalInterface {
427
+ /**
428
+ * The id of the quest.
429
+ */
430
+ readonly id: string;
431
+ /**
432
+ * The stages of the quest.
433
+ */
434
+ readonly stages: StageInterface[];
435
+ /**
436
+ * The index of the current stage.
437
+ */
438
+ currentStageIndex?: number;
439
+ /**
440
+ * The current stage.
441
+ */
442
+ readonly currentStage?: StageInterface;
443
+ /**
444
+ * If the quest is started.
445
+ */
446
+ readonly started: boolean;
447
+ /**
448
+ * If the quest is started and not completed and not failed.
449
+ */
450
+ readonly inProgress: boolean;
451
+ /**
452
+ * If the quest is completed.
453
+ */
454
+ readonly completed: boolean;
455
+ /**
456
+ * If the quest is failed.
457
+ */
458
+ readonly failed: boolean;
459
+ /**
460
+ * The function that will be called when the quest starts.
461
+ */
462
+ readonly onStart?: OnRunEvent<QuestInterface>;
463
+ /**
464
+ * The function that will be called when the quest goes to the next stage.
465
+ */
466
+ readonly onNextStage?: OnRunEvent<QuestInterface>;
467
+ /**
468
+ * Start the quest.
469
+ * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
470
+ * @returns
471
+ */
472
+ start(props: OnRunProps$1): Promise<void>;
473
+ /**
474
+ * Go to the next stage if the current stage is completed.
475
+ * If you want to force the change of stage, use {@link advanceUnconditionally}.
476
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
477
+ * @returns true if the stage was changed, false otherwise.
478
+ */
479
+ advanceIfCompleted(props: OnRunProps$1): Promise<boolean>;
480
+ /**
481
+ * Complete the current stage and go to the next stage with {@link advanceUnconditionally}.
482
+ * If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}.
483
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
484
+ * @returns true if the stage was changed, false otherwise.
485
+ */
486
+ continue(props: OnRunProps$1): Promise<boolean>;
487
+ /**
488
+ * Ignore the completed state of the current stage and go to the next stage without checking if the current stage is completed.
489
+ * If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}.
490
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
491
+ * @returns returns true if the stage was changed, false otherwise.
492
+ */
493
+ advanceUnconditionally(props: OnRunProps$1): Promise<boolean>;
494
+ /**
495
+ * If the current stage must start. It is true if the current stage is not started, can start and not completed.
496
+ */
497
+ readonly currentStageMustStart: boolean;
498
+ /**
499
+ * Start the current stage. This is a system function, do not use it directly.
500
+ * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
501
+ */
502
+ startCurrentStage(props: OnRunProps$1): Promise<void>;
503
+ }
504
+
505
+ interface QuestProps {
506
+ /**
507
+ * The name of the quest.
508
+ * @default ""
509
+ */
510
+ name?: string;
511
+ /**
512
+ * The description of the quest.
513
+ * @default ""
514
+ */
515
+ description?: string;
516
+ /**
517
+ * The icon of the quest.
518
+ * @default undefined
519
+ */
520
+ icon?: string;
521
+ /**
522
+ * The image of the quest.
523
+ */
524
+ image?: string;
525
+ /**
526
+ * If the quest is in development.
527
+ * @default false
528
+ */
529
+ inDevelopment?: boolean;
530
+ /**
531
+ * The function that will be executed when the quest starts.
532
+ */
533
+ onStart?: OnRunEvent<QuestInterface>;
534
+ /**
535
+ * The function that will be executed when a stage end in the quest.
536
+ */
537
+ onNextStage?: OnRunEvent<QuestInterface>;
538
+ }
539
+
540
+ interface StageInterface extends StageBaseInternalInterface, StageInterface$1 {
541
+ }
542
+ interface StageBaseInternalInterface {
543
+ /**
544
+ * The id of the stage.
545
+ */
546
+ readonly id: string;
547
+ /**
548
+ * The function that will be called when the stage starts.
549
+ */
550
+ readonly onStart?: OnRunEvent<StageInterface>;
551
+ /**
552
+ * The function that will be called when the stage ends.
553
+ */
554
+ readonly onEnd?: OnRunEvent<StageInterface>;
555
+ /**
556
+ * Check if the flag and goals are completed.
557
+ * You can force the completion of the stage by setting the completed property to true.
558
+ * @example
559
+ * ```ts
560
+ * export default class Stage extends StageStoredClass {
561
+ * override get completed(): boolean {
562
+ * if (super.completed) {
563
+ * return true;
564
+ * }
565
+ * if (this.flags.length > 0) {
566
+ * if (!this.flags.every((flag) => storage.getFlag(flag.flag))) {
567
+ * return false;
568
+ * }
569
+ * return true;
570
+ * }
571
+ * return false;
572
+ * }
573
+ * override set completed(value: boolean) {
574
+ * super.completed = value;
575
+ * }
576
+ * }
577
+ * ```
578
+ */
579
+ completed: boolean;
580
+ /**
581
+ * If the stage is started.
582
+ */
583
+ started: boolean;
584
+ /**
585
+ * The date when the stage starts.
586
+ */
587
+ readonly startDate?: number;
588
+ /**
589
+ * Check if the stage can start.
590
+ * @example
591
+ * ```ts
592
+ * export default class Stage extends StageStoredClass {
593
+ * override get canStart(): boolean {
594
+ * if (this.flagsRequired.length > 0 && !this.flagsRequired.every((flag) => storage.getFlag(flag.flag))) {
595
+ * return false;
596
+ * }
597
+ * return super.canStart;
598
+ * }
599
+ * }
600
+ * ```
601
+ */
602
+ readonly canStart: boolean;
603
+ /**
604
+ * The function that will be called when the stage starts.
605
+ */
606
+ start(props: OnRunProps$1): Promise<void>;
607
+ /**
608
+ * The number of day/date required to start the stage.
609
+ */
610
+ readonly deltaDateRequired: number;
611
+ /**
612
+ * The list of quests required to start the stage.
613
+ */
614
+ readonly questsRequired: QuestsRequiredType[];
615
+ }
616
+
617
+ interface StageFlags {
618
+ /**
619
+ * The flag for checking if the condition is met.
620
+ */
621
+ flag: string;
622
+ /**
623
+ * The description of the flag.
624
+ */
625
+ description: string;
626
+ }
627
+
628
+ interface StageProps {
629
+ /**
630
+ * The flags of the stage.
631
+ * @default []
632
+ */
633
+ flags?: StageFlags[];
634
+ /**
635
+ * The name of the stage.
636
+ * @default ""
637
+ */
638
+ name?: string;
639
+ /**
640
+ * The description of the stage.
641
+ * @default ""
642
+ */
643
+ description?: string;
644
+ /**
645
+ * The advice description of the stage.
646
+ * @default ""
647
+ */
648
+ adviceDescription?: string;
649
+ /**
650
+ * The image of the stage.
651
+ */
652
+ image?: string;
653
+ /**
654
+ * The number of day/date required to start the stage.
655
+ * @example If the value is 3, and the previous stage ends on date 1, the stage will start on date 4.
656
+ */
657
+ deltaDateRequired?: number;
658
+ /**
659
+ * The flags required to start the stage.
660
+ * @default []
661
+ */
662
+ flagsRequired?: StageFlags[];
663
+ /**
664
+ * The quests required to start the stage.
665
+ * @default []
666
+ */
667
+ questsRequired?: QuestsRequiredType[];
668
+ /**
669
+ * The description to request to start the stage.
670
+ * @default ""
671
+ */
672
+ requestDescriptionToStart?: string;
673
+ /**
674
+ * The function that will be executed when the stage starts.
675
+ */
676
+ onStart?: OnRunEvent<StageInterface>;
677
+ /**
678
+ * The function that will be executed when the stage ends.
679
+ */
680
+ onEnd?: OnRunEvent<StageInterface>;
681
+ }
682
+
683
+ interface ActivityStoredClassProps {
684
+ /**
685
+ * Time slot in which activity/commitment will be active.
686
+ */
687
+ timeSlot?: TimeSchedulingInterface;
688
+ /**
689
+ * Used to schedule what date it will be added and removed.
690
+ */
691
+ dateScheduling?: DateSchedulingInterface;
692
+ }
693
+ declare class ActivityStoredClass<OnRunEventType = ActivityInterface> extends StoredClassModel implements ActivityBaseInternalInterface {
694
+ private readonly _onRun;
695
+ constructor(id: string, _onRun: OnRunEvent<OnRunEventType>, props: ActivityStoredClassProps, category?: string);
696
+ private _timeSlot?;
697
+ get timeSlot(): TimeSchedulingInterface | undefined;
698
+ private _dateScheduling?;
699
+ get dateScheduling(): DateSchedulingInterface | undefined;
700
+ protected addTempHistoryItem(): void;
701
+ get run(): OnRunAsyncFunction;
702
+ get expired(): boolean;
703
+ get isActive(): boolean;
704
+ }
705
+
706
+ /**
707
+ * The activity model. It is used to create an activity.
708
+ * @example
709
+ * ```tsx
710
+ * export const nap = new ActivityModel("nap",
711
+ * (_, event) => {
712
+ * if (event) {
713
+ * event.navigate("/game")
714
+ * callLabelWithGoNavigationCallBack(napLabel, event)
715
+ * }
716
+ * else {
717
+ * console.error("Event is undefined")
718
+ * }
719
+ * },
720
+ * {
721
+ * name: "Nap",
722
+ * timeSlot: {
723
+ * from: 5,
724
+ * to: 23,
725
+ * },
726
+ * icon: "https://icon.jpg",
727
+ * }
728
+ * )
729
+ * ```
730
+ */
731
+ declare class ActivityBaseModel extends ActivityStoredClass<ActivityInterface> {
732
+ /**
733
+ * @param id The activity id, that must be unique.
734
+ * @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.
735
+ * @param props The activity properties.
736
+ */
737
+ constructor(id: string, onRun: OnRunEvent<ActivityInterface>, props: ActivityProps);
738
+ private defaultName;
739
+ /**
740
+ * The name of the activity.
741
+ */
742
+ get name(): string;
743
+ set name(value: string | undefined);
744
+ private defaultDisabled;
745
+ /**
746
+ * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
747
+ */
748
+ get disabled(): boolean;
749
+ set disabled(value: boolean | string);
750
+ private defaultHidden;
751
+ /**
752
+ * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
753
+ */
754
+ get hidden(): boolean;
755
+ set hidden(value: boolean | string);
756
+ private _icon?;
757
+ /**
758
+ * The icon of the activity.
759
+ */
760
+ get icon(): string | undefined;
761
+ }
762
+
763
+ interface CommitmentStoredClassProps {
764
+ /**
765
+ * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
766
+ * If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
767
+ */
768
+ executionType?: ExecutionType;
769
+ /**
770
+ * The priority. The higher the number, the higher the priority.
771
+ * To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.
772
+ */
773
+ priority?: number;
774
+ /**
775
+ * Time slot in which activity/commitment will be active.
776
+ */
777
+ timeSlot?: TimeSchedulingInterface;
778
+ /**
779
+ * Used to schedule what date it will be added and removed.
780
+ */
781
+ dateScheduling?: DateSchedulingInterface;
782
+ }
783
+ declare class CommitmentStoredClass extends ActivityStoredClass<CommitmentInterface> implements CommitmentBaseInternalInterface {
784
+ private readonly _characters;
785
+ private readonly _room;
786
+ constructor(id: string, _characters: CharacterInterface[], _room: RoomInterface, onRun: OnRunEvent<CommitmentInterface> | undefined, props: CommitmentStoredClassProps);
787
+ private readonly defaultExecutionType;
788
+ private readonly defaultPriority?;
789
+ get characters(): CharacterInterface[];
790
+ get room(): RoomInterface;
791
+ get executionType(): ExecutionType;
792
+ set executionType(value: ExecutionType);
793
+ get priority(): number;
794
+ set priority(value: number);
795
+ protected addTempHistoryItem(): void;
796
+ }
797
+
798
+ /**
799
+ * The base model of a commitment. I suggest you extend this class to create your own commitment model.
800
+ * You must use the saveRoom function to save the commitment in the registered commitments.
801
+ * @example
802
+ * ```ts
803
+ * export const mcRoom = new CommitmentBaseModel("test", character, room, {
804
+ * name: "Test",
805
+ * image: "https://image.jpg",
806
+ * executionType: ExecutionTypeEnum.INTERACTION,
807
+ * onRun: (commitment) => {
808
+ * // Do something
809
+ * }
810
+ * })
811
+ * saveCommitment(mcRoom)
812
+ * ```
813
+ */
814
+ declare class CommitmentBaseModel extends CommitmentStoredClass {
815
+ /**
816
+ * @param id The id of the commitment, it must be unique.
817
+ * @param character The character or characters that are in the commitment and so in the room.
818
+ * @param room The room where the commitment is.
819
+ * @param props The properties of the commitment.
820
+ */
821
+ constructor(id: string, character: CharacterInterface | CharacterInterface[] | undefined, room: RoomInterface, props: CommitmentProps);
822
+ private _name;
823
+ /**
824
+ * The name of the commitment.
825
+ */
826
+ get name(): string;
827
+ private _image?;
828
+ /**
829
+ * The image of the commitment.
830
+ */
831
+ get image(): string | undefined;
832
+ private _icon?;
833
+ /**
834
+ * The icon of the commitment.
835
+ */
836
+ get icon(): string | undefined;
837
+ private defaultDisabled;
838
+ /**
839
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
840
+ */
841
+ get disabled(): boolean;
842
+ set disabled(value: boolean | string);
843
+ private defaultHidden;
844
+ /**
845
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
846
+ */
847
+ get hidden(): boolean;
848
+ set hidden(value: boolean | string);
849
+ }
850
+
851
+ declare abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {
852
+ private defaultActivities;
853
+ constructor(categoryId: string, id: string, defaultActivities?: ActivityInterface[]);
854
+ private get defaultActivitiesIds();
855
+ private get activeActivityScheduling();
856
+ private get excludedActivitiesScheduling();
857
+ private removeActivityScheduling;
858
+ private editActivityScheduling;
859
+ private editExcludedActivityScheduling;
860
+ private get additionalActivitiesIds();
861
+ private get excludedActivitiesIds();
862
+ get activitiesIds(): string[];
863
+ addActivity(activity: ActivityInterface, options?: {
864
+ timeSlot?: TimeSchedulingInterface;
865
+ dateScheduling?: DateSchedulingInterface;
866
+ }): void;
867
+ removeActivity(activity: ActivityInterface | string, options?: Pick<DateSchedulingInterface, "to">): void;
868
+ clearExpiredActivities(): void;
869
+ get activities(): ActivityInterface[];
870
+ }
871
+
872
+ declare class LocationStoredClass extends NavigationAbstractClass implements LocationInternalInterface {
873
+ /**
874
+ * The map where the location is.
875
+ */
876
+ private readonly _map;
877
+ constructor(id: string,
878
+ /**
879
+ * The map where the location is.
880
+ */
881
+ _map: MapInterface, activities?: ActivityInterface[]);
882
+ get map(): MapInterface;
883
+ get rooms(): RoomInterface[];
884
+ }
885
+
886
+ /**
887
+ * The base model of a location. I suggest you extend this class to create your own location model.
888
+ * @example
889
+ * ```typescript
890
+ * export const mcHome = new LocationBaseModel('mc_home', mainMap, {
891
+ * name: 'MC Home',
892
+ * icon: "https://icon.jpg",
893
+ * });
894
+ * ```
895
+ */
896
+ declare class LocationBaseModel extends LocationStoredClass implements LocationInternalInterface {
897
+ /**
898
+ * @param id The id of the location, it must be unique.
899
+ * @param map The map where the location is.
900
+ * @param props The properties of the location.
901
+ */
902
+ constructor(id: string, map: MapInterface, props?: LocationBaseModelProps);
903
+ private defaultName;
904
+ /**
905
+ * The name of the location.
906
+ * If you set undefined, it will return the initial value of name.
907
+ */
908
+ get name(): string;
909
+ set name(value: string | undefined);
910
+ private defaultDisabled;
911
+ /**
912
+ * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
913
+ */
914
+ get disabled(): boolean;
915
+ set disabled(value: boolean | string);
916
+ private defaultHidden;
917
+ /**
918
+ * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
919
+ */
920
+ get hidden(): boolean;
921
+ set hidden(value: boolean | string);
922
+ private _icon?;
923
+ /**
924
+ * The icon of the location.
925
+ */
926
+ get icon(): string | undefined;
927
+ }
928
+
929
+ declare class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface {
930
+ constructor(id: string, activities?: ActivityInterface[]);
931
+ get locations(): LocationInterface[];
932
+ }
933
+
934
+ /**
935
+ * The base model of a map. I suggest you extend this class to create your own map model.
936
+ * @example
937
+ * ```typescript
938
+ * export const mainMap = new MapBaseModel('main_map', {
939
+ * name: 'Main Map',
940
+ * image: "https://image.jpg",
941
+ * });
942
+ * ```
943
+ */
944
+ declare class MapBaseModel extends MapStoredClass implements MapBaseInternalInterface {
945
+ /**
946
+ * @param id The id of the map, it must be unique.
947
+ * @param props The properties of the map.
948
+ */
949
+ constructor(id: string, props?: MapBaseModelProps);
950
+ private defaultName;
951
+ /**
952
+ * The name of the map.
953
+ * If you set undefined, it will return the initial value of name.
954
+ */
955
+ get name(): string;
956
+ set name(value: string | undefined);
957
+ private _image?;
958
+ /**
959
+ * The image of the map.
960
+ */
961
+ get image(): string | undefined;
962
+ }
963
+
964
+ declare class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface {
965
+ /**
966
+ * The location where the room is.
967
+ */
968
+ private readonly _location;
969
+ constructor(id: string,
970
+ /**
971
+ * The location where the room is.
972
+ */
973
+ _location: LocationInterface, activities?: ActivityInterface[]);
974
+ get routine(): CommitmentInterface[];
975
+ get location(): LocationInterface;
976
+ get characters(): CharacterInterface[];
977
+ get automaticFunctions(): OnRunAsyncFunction[];
978
+ }
979
+
980
+ /**
981
+ * The base model of a room. I suggest you extend this class to create your own room model.
982
+ * **You must use the {@link RegisteredRooms.add} function to save the room in the registered rooms.**
983
+ * @example
984
+ * ```ts
985
+ * export const mcRoom = new RoomBaseModel('mc_room', mcHome, {
986
+ * name: "MC Room",
987
+ * icon: "https://icon.jpg",
988
+ * image: "https://image.jpg",
989
+ * })
990
+ * RegisteredRooms.add(mcRoom)
991
+ * ```
992
+ */
993
+ declare class RoomBaseModel extends RoomStoredClass {
994
+ /**
995
+ * @param id The id of the room, it must be unique.
996
+ * @param location The location where the room is.
997
+ * @param props The properties of the room.
998
+ */
999
+ constructor(id: string, location: LocationInterface, props?: RoomBaseModelProps);
1000
+ private defaultName;
1001
+ /**
1002
+ * The name.
1003
+ * If you set undefined, it will return the initial value of name.
1004
+ */
1005
+ get name(): string;
1006
+ set name(value: string | undefined);
1007
+ private _image?;
1008
+ /**
1009
+ * The image of the room.
1010
+ */
1011
+ get image(): string | undefined;
1012
+ private defaultDisabled;
1013
+ /**
1014
+ * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
1015
+ */
1016
+ get disabled(): boolean;
1017
+ set disabled(value: boolean | string);
1018
+ private defaultHidden;
1019
+ /**
1020
+ * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
1021
+ */
1022
+ get hidden(): boolean;
1023
+ set hidden(value: boolean | string);
1024
+ private _icon?;
1025
+ /**
1026
+ * The function for rendering the icon of the room.
1027
+ */
1028
+ get icon(): string | undefined;
1029
+ }
1030
+
1031
+ interface QuestStoredClassProps {
1032
+ /**
1033
+ * The function that will be executed when the quest starts.
1034
+ */
1035
+ onStart?: OnRunEvent<QuestInterface>;
1036
+ /**
1037
+ * The function that will be executed when a stage end in the quest.
1038
+ */
1039
+ onNextStage?: OnRunEvent<QuestInterface>;
1040
+ }
1041
+ declare class QuestStoredClass extends StoredClassModel implements QuestBaseInternalInterface {
1042
+ private readonly _stages;
1043
+ constructor(id: string, _stages: StageInterface[], props?: QuestStoredClassProps);
1044
+ get stages(): StageInterface[];
1045
+ get currentStageIndex(): number | undefined;
1046
+ private set currentStageIndex(value);
1047
+ get currentStage(): StageInterface | undefined;
1048
+ get started(): boolean;
1049
+ get completed(): boolean;
1050
+ get inProgress(): boolean;
1051
+ get failed(): boolean;
1052
+ set failed(value: boolean);
1053
+ private _onStart?;
1054
+ get onStart(): undefined | OnRunEvent<QuestInterface>;
1055
+ private _onNextStage?;
1056
+ get onNextStage(): undefined | OnRunEvent<QuestInterface>;
1057
+ start(props: OnRunProps$1): Promise<void>;
1058
+ /**
1059
+ * @deprecated Use {@link advanceIfCompleted} instead.
1060
+ */
1061
+ goNextIfCompleted(props: OnRunProps$1): Promise<boolean>;
1062
+ advanceIfCompleted(props: OnRunProps$1): Promise<boolean>;
1063
+ /**
1064
+ * @deprecated Use {@link continue} instead.
1065
+ */
1066
+ goNext(props: OnRunProps$1): Promise<boolean>;
1067
+ continue(props: OnRunProps$1): Promise<boolean>;
1068
+ /**
1069
+ * @deprecated Use {@link advanceUnconditionally} instead.
1070
+ */
1071
+ forceGoNext(props: OnRunProps$1): Promise<boolean>;
1072
+ advanceUnconditionally(props: OnRunProps$1): Promise<boolean>;
1073
+ get currentStageMustStart(): boolean;
1074
+ startCurrentStage(props: OnRunProps$1): Promise<void>;
1075
+ }
1076
+
1077
+ declare class QuestBaseModel extends QuestStoredClass {
1078
+ constructor(id: string, stages: StageInterface[], props: QuestProps);
1079
+ private _name;
1080
+ /**
1081
+ * The name of the quest.
1082
+ */
1083
+ get name(): string;
1084
+ private _description;
1085
+ /**
1086
+ * The description of the quest.
1087
+ */
1088
+ get description(): string;
1089
+ private _icon?;
1090
+ /**
1091
+ * Icon of the quest.
1092
+ */
1093
+ get icon(): string | undefined;
1094
+ private _image?;
1095
+ /**
1096
+ * Image of the quest.
1097
+ */
1098
+ get image(): string | undefined;
1099
+ private _inDevelopment;
1100
+ /**
1101
+ * If the quest is in development.
1102
+ */
1103
+ get inDevelopment(): boolean;
1104
+ }
1105
+
1106
+ interface StageStoredClassProps {
1107
+ /**
1108
+ * The function that will be executed when the stage starts.
1109
+ */
1110
+ onStart?: OnRunEvent<StageInterface>;
1111
+ /**
1112
+ * The function that will be executed when the stage ends.
1113
+ */
1114
+ onEnd?: OnRunEvent<StageInterface>;
1115
+ /**
1116
+ * The number of day/date required to start the stage.
1117
+ * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.
1118
+ */
1119
+ deltaDateRequired?: number;
1120
+ /**
1121
+ * The quests required to start the stage.
1122
+ * @default []
1123
+ */
1124
+ questsRequired?: QuestsRequiredType[];
1125
+ }
1126
+ declare class StageStoredClass extends StoredClassModel implements StageBaseInternalInterface {
1127
+ constructor(id: string, props?: StageStoredClassProps);
1128
+ private _onStart?;
1129
+ get onStart(): undefined | OnRunEvent<StageInterface>;
1130
+ private _onEnd?;
1131
+ get onEnd(): undefined | OnRunEvent<StageInterface>;
1132
+ get completed(): boolean;
1133
+ set completed(value: boolean);
1134
+ get started(): boolean;
1135
+ set started(value: boolean);
1136
+ private get inizializeDate();
1137
+ private set inizializeDate(value);
1138
+ get startDate(): number | undefined;
1139
+ get canStart(): boolean;
1140
+ inizialize(): void;
1141
+ start(props: OnRunProps$1): Promise<void>;
1142
+ private _deltaDateRequired?;
1143
+ get deltaDateRequired(): number;
1144
+ private _questsRequired;
1145
+ get questsRequired(): QuestsRequiredType[];
1146
+ }
1147
+
1148
+ declare class StageBaseModel extends StageStoredClass {
1149
+ constructor(id: string, props: StageProps);
1150
+ private _name;
1151
+ /**
1152
+ * The name of the stage.
1153
+ */
1154
+ get name(): string;
1155
+ private _description;
1156
+ /**
1157
+ * The description of the stage.
1158
+ */
1159
+ get description(): string;
1160
+ private _adviceDescription;
1161
+ /**
1162
+ * The advice description of the stage.
1163
+ */
1164
+ get adviceDescription(): string;
1165
+ private _image?;
1166
+ /**
1167
+ * The image of the stage.
1168
+ */
1169
+ get image(): string | undefined;
1170
+ private _flags;
1171
+ /**
1172
+ * The list of flags that the player must complete to finish the stage.
1173
+ */
1174
+ get flags(): StageFlags[];
1175
+ private _flagsRequired;
1176
+ /**
1177
+ * The list of flags required to start the stage.
1178
+ */
1179
+ get flagsRequired(): StageFlags[];
1180
+ private _requestDescriptionToStart;
1181
+ /**
1182
+ * The description of the request to start the stage.
1183
+ */
1184
+ get requestDescriptionToStart(): string;
1185
+ get completed(): boolean;
1186
+ set completed(value: boolean);
1187
+ get canStart(): boolean;
1188
+ }
1189
+
1190
+ declare class NavigatorHandler {
1191
+ get rooms(): RoomInterface[];
1192
+ get locations(): LocationInterface[];
1193
+ get maps(): MapInterface[];
1194
+ get currentRoomId(): string | undefined;
1195
+ get currentRoom(): RoomInterface | undefined;
1196
+ set currentRoom(room: RoomInterface | string);
1197
+ get currentLocation(): LocationInterface | undefined;
1198
+ get currentMap(): MapInterface | undefined;
1199
+ /**
1200
+ * Clear all the expired activities.
1201
+ */
1202
+ clearExpiredActivities(): void;
1203
+ }
1204
+
1205
+ declare class QuestHandler {
1206
+ /**
1207
+ * The quests registered in the game.
1208
+ */
1209
+ get quests(): QuestInterface[];
1210
+ /**
1211
+ * The quests that are started, so they are in progress or completed or failed.
1212
+ */
1213
+ get startedQuests(): QuestInterface[];
1214
+ /**
1215
+ * The quests that are in progress.
1216
+ */
1217
+ get inProgressQuests(): QuestInterface[];
1218
+ /**
1219
+ * The quests that are completed.
1220
+ */
1221
+ get completedQuests(): QuestInterface[];
1222
+ /**
1223
+ * The quests that are failed.
1224
+ */
1225
+ get failedQuests(): QuestInterface[];
1226
+ /**
1227
+ * The quests that are not started.
1228
+ */
1229
+ get notStartedQuests(): QuestInterface[];
1230
+ /**
1231
+ * Get the quest by the id.
1232
+ * @param id The id of the quest.
1233
+ * @returns The quest with the id.
1234
+ */
1235
+ find(id: string): QuestInterface | undefined;
1236
+ /**
1237
+ * Start the quests that must start on the current stage.
1238
+ */
1239
+ startsStageMustBeStarted(props: OnRunProps$1): Promise<void>;
1240
+ }
1241
+
1242
+ declare class RoutineHandler {
1243
+ get fixedRoutine(): CommitmentInterface[];
1244
+ /**
1245
+ * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.
1246
+ */
1247
+ set fixedRoutine(commitments: CommitmentInterface[]);
1248
+ /**
1249
+ * Get the temporary commitments by its id.
1250
+ * @returns The temporary commitments.
1251
+ */
1252
+ get temporaryRoutine(): CommitmentInterface[];
1253
+ get allRoutine(): CommitmentInterface[];
1254
+ /**
1255
+ * This feature adds the commitments during the game session.
1256
+ * @param commitment The commitment or commitments to add.
1257
+ */
1258
+ add(commitment: CommitmentInterface[] | CommitmentInterface): void;
1259
+ /**
1260
+ * Get the commitments added during the game session.
1261
+ * @param id The id of the commitment.
1262
+ * @returns The commitment or undefined if not found.
1263
+ */
1264
+ find(id: string): CommitmentInterface | undefined;
1265
+ /**
1266
+ * Remove the commitments added during the game session.
1267
+ * @param commitment The commitment or commitments to remove.
1268
+ */
1269
+ remove(commitment: CommitmentInterface[] | CommitmentInterface): void;
1270
+ /**
1271
+ * Clear all the expired commitments.
1272
+ */
1273
+ clearExpiredRoutine(): void;
1274
+ /**
1275
+ * Get the current commitments. The hidden commitments are not included.
1276
+ * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.
1277
+ * Higher priority commitments are calculated using the following steps:
1278
+ * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.
1279
+ * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.
1280
+ * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.
1281
+ * @returns The current commitments.
1282
+ */
1283
+ get currentRoutine(): CommitmentInterface[];
1284
+ /**
1285
+ * Get the character commitment.
1286
+ * @param character The character.
1287
+ * @returns The commitment or undefined if not found.
1288
+ */
1289
+ getCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined;
1290
+ }
1291
+
1292
+ declare class TimeHandler {
1293
+ initialize(settings: TimeSettings): void;
1294
+ get dayStartTime(): number;
1295
+ get dayEndTime(): number;
1296
+ get defaultTimeSpent(): number;
1297
+ get timeSlots(): TimeSlotInterface[];
1298
+ get weekLength(): number;
1299
+ get weekendStartDay(): number;
1300
+ /**
1301
+ * Week days name
1302
+ * @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
1303
+ * @returns The name of the week day.
1304
+ * @example
1305
+ * ```ts
1306
+ * (weekDayNumber: number) => {
1307
+ * const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
1308
+ * return weekDaysNames[weekDayNumber];
1309
+ * }
1310
+ * ```
1311
+ */
1312
+ get getDayName(): ((weekDayNumber: number) => string) | undefined;
1313
+ /**
1314
+ * Get the current time. Time is a numeric variable used to determine and manage time during a day/date.
1315
+ * It's recommended to use currentTime as if it were the current time. If you also want to manage minutes, you can use a float value.
1316
+ */
1317
+ get currentTime(): number;
1318
+ set currentTime(value: number | undefined);
1319
+ /**
1320
+ * Get the current date. Date is a numeric variable used to determine and manage the number of days passed.
1321
+ * It's recommended to use currentDate as if it were the current day.
1322
+ */
1323
+ get currentDate(): number;
1324
+ set currentDate(value: number | undefined);
1325
+ /**
1326
+ * If the current day is greater than or equal to the weekend start day, then it will return true.
1327
+ */
1328
+ get isWeekend(): boolean;
1329
+ /**
1330
+ * Get the current week day number (from: 1 - to: {@link weekLength}).
1331
+ * For example, if the week length is 7 and the current day is 10, then the result will be 4.
1332
+ */
1333
+ get currentWeekDayNumber(): number;
1334
+ /**
1335
+ * Get the current week day name. If the week days names are not defined, then it will return undefined.
1336
+ * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.
1337
+ * @default ""
1338
+ */
1339
+ get currentDayName(): string;
1340
+ /**
1341
+ * Get the current {@link timeSlots} index.
1342
+ * You can use this property to create "Image that changes based on the time period":
1343
+ * @example
1344
+ * ```tsx
1345
+ * import { weekLength } from '@drincs/nqtr';
1346
+ *
1347
+ * function changeBackground() {
1348
+ * return (
1349
+ * <img src={`background-currentTimeSlot.currentTimeSlot.png`} />
1350
+ * )
1351
+ * }
1352
+ */
1353
+ get currentTimeSlot(): number;
1354
+ /**
1355
+ * This function will increase the current time by the given time spent.
1356
+ * If the new time is greater than or equal to the max day times, then it will increase the day and set the new time.
1357
+ * @param delta is the time spent in times (default: {@link defaultTimeSpent})
1358
+ * @returns currentTimeSlot.currentTime
1359
+ */
1360
+ increaseTime(delta?: number): number;
1361
+ /**
1362
+ * This function will increase the current date by the given delta.
1363
+ * @param delta is the number of days to increase (default: 1)
1364
+ * @param time is the time of the new day (default: {@link dayStartTime})
1365
+ * @returns timeTracker.currentDate
1366
+ */
1367
+ increaseDate(delta?: number, time?: number): number;
1368
+ /**
1369
+ * This function will check if the current time is between the given times.
1370
+ * @param fromTime the starting time. If the {@link currentTime} is equal to this time, the function will return true.
1371
+ * @param toTime the ending time.
1372
+ * @returns true if the current time is between the given times, otherwise false.
1373
+ */
1374
+ nowIsBetween(fromTime: number | undefined, toTime: number | undefined): boolean;
1375
+ }
1376
+
1377
+ declare const timeTracker: TimeHandler;
1378
+ declare const navigator: NavigatorHandler;
1379
+ declare const routine: RoutineHandler;
1380
+ declare const questsNotebook: QuestHandler;
1381
+
1382
+ declare const handlers_navigator: typeof navigator;
1383
+ declare const handlers_questsNotebook: typeof questsNotebook;
1384
+ declare const handlers_routine: typeof routine;
1385
+ declare const handlers_timeTracker: typeof timeTracker;
1386
+ declare namespace handlers {
1387
+ export { handlers_navigator as navigator, handlers_questsNotebook as questsNotebook, handlers_routine as routine, handlers_timeTracker as timeTracker };
1388
+ }
13
1389
 
14
1390
  declare const nqtr: {
15
- navigator: NavigatorManager;
16
- questsNotebook: QuestManager;
17
- routine: RoutineManager;
18
- timeTracker: TimeManager;
19
- RegisteredActivities: typeof RegisteredActivities;
20
- RegisteredCommitments: typeof RegisteredCommitments;
21
- RegisteredLocations: typeof RegisteredLocations;
22
- RegisteredMaps: typeof RegisteredMaps;
23
- RegisteredQuests: typeof RegisteredQuest;
24
- RegisteredRooms: typeof RegisteredRooms;
1391
+ handlers: typeof handlers;
1392
+ registries: typeof registries;
25
1393
  ActivityBaseModel: typeof ActivityBaseModel;
26
1394
  ActivityStoredClass: typeof ActivityStoredClass;
27
1395
  CommitmentBaseModel: typeof CommitmentBaseModel;
@@ -38,4 +1406,4 @@ declare const nqtr: {
38
1406
  StageStoredClass: typeof StageStoredClass;
39
1407
  };
40
1408
 
41
- export { ActivityBaseModel, ActivityStoredClass, CommitmentBaseModel, CommitmentStoredClass, LocationBaseModel, LocationStoredClass, MapBaseModel, MapStoredClass, QuestBaseModel, QuestStoredClass, RegisteredActivities, RegisteredCommitments, RegisteredLocations, RegisteredMaps, RegisteredQuest as RegisteredQuests, RegisteredRooms, RoomBaseModel, RoomStoredClass, StageBaseModel, StageStoredClass, nqtr as default };
1409
+ export { ActivityBaseModel, type ActivityInterface, type ActivityProps, ActivityStoredClass, type ActivityStoredClassProps, CommitmentBaseModel, type CommitmentInterface, type CommitmentProps, CommitmentStoredClass, type CommitmentStoredClassProps, type DateSchedulingInterface, type ExecutionType, type TimeSlotInterface as ITimeStlot, LocationBaseModel, type LocationBaseModelProps, type LocationInterface, LocationStoredClass, MapBaseModel, type MapBaseModelProps, type MapInterface, MapStoredClass, type OnRunAsyncFunction, type OnRunEvent, type OnRunFunction, type OnRunProps, QuestBaseModel, type QuestInterface, type QuestProps, QuestStoredClass, type QuestStoredClassProps, type QuestsRequiredType, RoomBaseModel, type RoomBaseModelProps, type RoomInterface, RoomStoredClass, StageBaseModel, type StageInterface, type StageProps, StageStoredClass, type StageStoredClassProps, type TimeSchedulingInterface, type TimeSettings, nqtr as default };