@drincs/nqtr 0.8.2 → 1.0.1

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/index.d.mts CHANGED
@@ -1,148 +1,15 @@
1
1
  export * from '@drincs/nqtr/handlers';
2
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';
3
+ import { ActivityIdType, CommitmentIdType } from '@drincs/nqtr/registries';
4
+ export { ActivityIdType, CommitmentIdType, LocationIdType, MapIdType, NqtrActivityIds, NqtrCommitmentIds, NqtrLocationIds, NqtrMapIds, NqtrQuestIds, NqtrRoomIds, QuestIdType, RegisteredActivities, RegisteredCommitments, RegisteredLocations, RegisteredMaps, RegisteredQuests, RegisteredRooms, RoomIdType } from '@drincs/nqtr/registries';
5
+ import { T as TimeSchedulingInterface, D as DateSchedulingInterface, C as CommitmentInterface, E as ExecutionType, O as OnRunEvent, A as ActivityInterface, Q as QuestInterface, a as QuestsRequiredType, S as StageInterface, b as ActivityBaseInternalInterface, c as ActiveScheduling, d as OnRunAsyncFunction, e as CommitmentBaseInternalInterface, f as OnRunProps, N as NavigationAbstractInterface, L as LocationInternalInterface, M as MapInterface, R as RoomInterface, g as MapBaseInternalInterface, h as LocationInterface, i as RoomBaseInternalInterface, j as QuestBaseInternalInterface, k as StageBaseInternalInterface } from './StageInterface-BN_O8nDA.mjs';
6
+ export { l as OnRunFunction } from './StageInterface-BN_O8nDA.mjs';
5
7
  import { StoredClassModel } from '@drincs/pixi-vn/storage';
6
- import { CharacterInterface } from '@drincs/pixi-vn';
7
-
8
- interface DateSchedulingInterface {
9
- /**
10
- * The start date. If the item hasn't started yet, it will be hidden.
11
- * If you set it to 3, the item will be hidden on dates 1 and 2 and will be shown starting on date 3.
12
- */
13
- from: number;
14
- /**
15
- * The date when the item ends. If the item is ended yet, it will be deleted or hidden.
16
- * 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.
17
- * @default undefined
18
- */
19
- to?: number;
20
- }
21
-
22
- interface TimeSchedulingInterface {
23
- /**
24
- * The time when the item starts. If the item is not started yet, it will be hidden.
25
- * If you set 3, the item will be hidden into times 1 and 2, and will be shown from time 3.
26
- */
27
- from: number;
28
- /**
29
- * The time when the item ends. If the item is ended yet, it will be hidden.
30
- * If you set 3, the item will be shown into times 1 and 2 and will be hidden from time 3.
31
- * @default timeTracker.dayEndTime + 1
32
- */
33
- to?: number;
34
- }
35
-
36
- interface ActiveScheduling {
37
- /**
38
- * Time slot in which activity/commitment will be active.
39
- */
40
- readonly timeSlot?: TimeSchedulingInterface[] | TimeSchedulingInterface;
41
- /**
42
- * Used to schedule what date it will be added and removed.
43
- */
44
- readonly dateScheduling?: DateSchedulingInterface;
45
- }
46
-
47
- type ExecutionType = "automatic" | "interaction";
48
-
49
- type OnRunProps = OnRunProps$1;
50
- /**
51
- * The function that is called when the class is runned.
52
- */
53
- type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
54
- type OnRunFunction = (props: OnRunProps) => any | Promise<any>;
55
- type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
56
-
57
- type QuestsRequiredType = {
58
- quest: QuestInterface;
59
- stageNumber: number;
60
- };
61
-
62
- type TimeSlotInterface = {
63
- name: string;
64
- startTime: number;
65
- };
66
- /**
67
- * Time Settings, which can be set using {@link timeTracker.editSettings}
68
- */
69
- type TimeSettings = {
70
- /**
71
- * Minimum time of the day
72
- * @default 0
73
- */
74
- dayStartTime?: number;
75
- /**
76
- * Maximum time of the day
77
- * @default 24
78
- */
79
- dayEndTime?: number;
80
- /**
81
- * Default time spent
82
- * @default 1
83
- */
84
- defaultTimeSpent?: number;
85
- /**
86
- * Time slots
87
- * @default []
88
- * @example
89
- * ```ts
90
- * [
91
- * { name: 'Morning', startTime: 5 },
92
- * { name: 'Afternoon', startTime: 12 },
93
- * { name: 'Evening', startTime: 18 },
94
- * { name: 'Night', startTime: 22 }
95
- * ]
96
- */
97
- timeSlots?: TimeSlotInterface[];
98
- /**
99
- * Week length
100
- * @default 7
101
- */
102
- weekLength?: number;
103
- /**
104
- * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6
105
- * @default weekLength - 1
106
- */
107
- weekendStartDay?: number;
108
- /**
109
- * Week days name
110
- * @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
111
- * @returns The name of the week day.
112
- * @example
113
- * ```ts
114
- * (weekDayNumber: number) => {
115
- * const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
116
- * return weekDaysNames[weekDayNumber];
117
- * }
118
- * ```
119
- */
120
- getDayName?: (weekDayNumber: number) => string;
121
- };
122
-
123
- interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 {
124
- }
125
- interface ActivityBaseInternalInterface extends ActiveScheduling {
126
- /**
127
- * The id of the activity/commitment.
128
- */
129
- readonly id: string;
130
- /**
131
- * The function that is called when the activity/commitment is runned.
132
- */
133
- readonly run: OnRunAsyncFunction;
134
- /**
135
- * Whether the activity/commitment is a deadline, so it will then be removed or hidden.
136
- *
137
- * 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.
138
- */
139
- readonly expired: boolean;
140
- /**
141
- * Whether the activity/commitment is active, so it will be shown in the routine and can be runned.
142
- * @param options The options to check if the activity/commitment is active.
143
- */
144
- isActive(options?: ActiveScheduling): boolean;
145
- }
8
+ import { CharacterInterface, CharacterIdType } from '@drincs/pixi-vn/characters';
9
+ import { CharacterInterface as CharacterInterface$1, CharacterIdType as CharacterIdType$1 } from '@drincs/pixi-vn';
10
+ import { h as handlers$1 } from './index-D0T0L2IE.mjs';
11
+ export { T as ITimeStlot, a as TimeSettings } from './index-D0T0L2IE.mjs';
12
+ import '@drincs/nqtr';
146
13
 
147
14
  interface ActivityProps {
148
15
  /**
@@ -175,25 +42,6 @@ interface ActivityProps {
175
42
  renderIcon?: string;
176
43
  }
177
44
 
178
- interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 {
179
- }
180
- interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface {
181
- /**
182
- * The character or characters that are in the commitment and so in the room.
183
- */
184
- readonly characters: CharacterInterface[];
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
45
  interface CommitmentInfo {
198
46
  commitment: CommitmentInterface;
199
47
  roomId: string;
@@ -278,53 +126,7 @@ interface LocationBaseModelProps {
278
126
  * The activities that are available in this location.
279
127
  * @default []
280
128
  */
281
- activities?: ActivityInterface[];
282
- }
283
-
284
- interface NavigationAbstractInterface extends StoredClassModel {
285
- /**
286
- * Connects the activity to the class.
287
- * @param activity The activity to connect to the class.
288
- * @param options
289
- * @returns
290
- */
291
- addActivity(activity: ActivityInterface, options?: ActiveScheduling): void;
292
- /**
293
- * Disconnects the activity from the class.
294
- * @param activity The activity to disconnect from the class.
295
- * @param options
296
- */
297
- removeActivity(activity: ActivityInterface | string): void;
298
- /**
299
- * Removes the useless activities.
300
- */
301
- clearExpiredActivities(): void;
302
- /**
303
- * All the ids of the activities associated with this class. Compared to {@link activities}, they are not filtered based on their scheduling.
304
- */
305
- readonly activitiesIds: string[];
306
- /**
307
- * The activities associated with this class, filtered based on their scheduling.
308
- */
309
- activities: ActivityInterface[];
310
- }
311
-
312
- interface LocationInterface extends LocationInternalInterface, LocationInterface$1 {
313
- }
314
- interface LocationInternalInterface extends NavigationAbstractInterface {
315
- /**
316
- * The id of the location.
317
- */
318
- readonly id: string;
319
- /**
320
- * The map where the location is.
321
- */
322
- readonly map: MapInterface;
323
- /**
324
- * Get all rooms in the location.
325
- * @returns The rooms in the location.
326
- */
327
- readonly rooms: RoomInterface[];
129
+ activities?: (ActivityInterface | ActivityIdType)[];
328
130
  }
329
131
 
330
132
  interface MapBaseModelProps {
@@ -342,21 +144,7 @@ interface MapBaseModelProps {
342
144
  * The activities that are available in this map.
343
145
  * @default []
344
146
  */
345
- activities?: ActivityInterface[];
346
- }
347
-
348
- interface MapInterface extends MapBaseInternalInterface, MapInterface$1 {
349
- }
350
- interface MapBaseInternalInterface extends NavigationAbstractInterface {
351
- /**
352
- * The id of the map.
353
- */
354
- readonly id: string;
355
- /**
356
- * Get all locations in the map.
357
- * @returns The locations in the map.
358
- */
359
- readonly locations: LocationInterface[];
147
+ activities?: (ActivityInterface | ActivityIdType)[];
360
148
  }
361
149
 
362
150
  interface RoomBaseModelProps {
@@ -374,12 +162,12 @@ interface RoomBaseModelProps {
374
162
  * The activities that are available in this room.
375
163
  * @default []
376
164
  */
377
- activities?: ActivityInterface[];
165
+ activities?: (ActivityInterface | ActivityIdType)[];
378
166
  /**
379
167
  * The routine of the room, it is an array of commitments that are executed in the room. You can also add commitments during the game session, but this property is useful to set the initial routine of the room.
380
168
  * @default undefined
381
169
  */
382
- routine?: CommitmentInterface[];
170
+ routine?: (CommitmentInterface | CommitmentIdType)[];
383
171
  /**
384
172
  * Whether is disabled. You can also pass a Pixi'VN flag name.
385
173
  * @default false
@@ -397,129 +185,6 @@ interface RoomBaseModelProps {
397
185
  icon?: string;
398
186
  }
399
187
 
400
- interface RoomInterface extends RoomBaseInternalInterface, RoomInterface$1 {
401
- }
402
- interface RoomBaseInternalInterface extends NavigationAbstractInterface {
403
- /**
404
- * The id of the room.
405
- */
406
- readonly id: string;
407
- /**
408
- * The location where the room is.
409
- */
410
- readonly location: LocationInterface;
411
- /**
412
- * Connects the commitment to the class.
413
- * @param commitment The commitment to connect to the class.
414
- * @param options
415
- * @returns
416
- */
417
- addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void;
418
- /**
419
- * Disconnects the commitment from the class.
420
- * @param commitment The commitment to disconnect from the class.
421
- * @param options
422
- */
423
- removeCommitment(commitment: CommitmentInterface | string): void;
424
- /**
425
- * Get the character commitments of the room.
426
- */
427
- readonly routine: CommitmentInterface[];
428
- /**
429
- * Get the characters in the room.
430
- */
431
- readonly characters: CharacterInterface[];
432
- /**
433
- * Get the functions that will be executed when the room is visited.
434
- */
435
- readonly automaticFunctions: OnRunAsyncFunction[];
436
- }
437
-
438
- interface QuestInterface extends QuestBaseInternalInterface, QuestInterface$1 {
439
- }
440
- interface QuestBaseInternalInterface {
441
- /**
442
- * The id of the quest.
443
- */
444
- readonly id: string;
445
- /**
446
- * The stages of the quest.
447
- */
448
- readonly stages: StageInterface[];
449
- /**
450
- * The index of the current stage.
451
- */
452
- currentStageIndex?: number;
453
- /**
454
- * The current stage.
455
- */
456
- readonly currentStage?: StageInterface;
457
- /**
458
- * If the quest is started.
459
- */
460
- readonly started: boolean;
461
- /**
462
- * If the quest is started and not completed and not failed.
463
- */
464
- readonly inProgress: boolean;
465
- /**
466
- * If the quest is completed.
467
- */
468
- readonly completed: boolean;
469
- /**
470
- * If the quest is failed.
471
- */
472
- readonly failed: boolean;
473
- /**
474
- * The function that will be called when the quest starts.
475
- */
476
- readonly onStart?: OnRunEvent<QuestInterface>;
477
- /**
478
- * @deprecated Use {@link onContinue} instead. The function that will be called when the quest goes to the next stage.
479
- */
480
- readonly onNextStage?: OnRunEvent<QuestInterface>;
481
- /**
482
- * The function that will be called when the quest goes to the next stage.
483
- */
484
- readonly onContinue?: OnRunEvent<QuestInterface>;
485
- /**
486
- * Start the quest.
487
- * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
488
- * @returns
489
- */
490
- start(props: OnRunProps$1): Promise<void>;
491
- /**
492
- * Go to the next stage if the current stage is completed.
493
- * If you want to force the change of stage, use {@link advanceUnconditionally}.
494
- * @param props The properties. If you not want to pass any property, you can pass an {}.
495
- * @returns true if the stage was changed, false otherwise.
496
- */
497
- advanceIfCompleted(props: OnRunProps$1): Promise<boolean>;
498
- /**
499
- * Complete the current stage and go to the next stage with {@link advanceUnconditionally}.
500
- * If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}.
501
- * @param props The properties. If you not want to pass any property, you can pass an {}.
502
- * @returns true if the stage was changed, false otherwise.
503
- */
504
- continue(props: OnRunProps$1): Promise<boolean>;
505
- /**
506
- * Ignore the completed state of the current stage and go to the next stage without checking if the current stage is completed.
507
- * If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}.
508
- * @param props The properties. If you not want to pass any property, you can pass an {}.
509
- * @returns returns true if the stage was changed, false otherwise.
510
- */
511
- advanceUnconditionally(props: OnRunProps$1): Promise<boolean>;
512
- /**
513
- * If the current stage must start. It is true if the current stage is not started, can start and not completed.
514
- */
515
- readonly currentStageMustStart: boolean;
516
- /**
517
- * Start the current stage. This is a system function, do not use it directly.
518
- * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
519
- */
520
- startCurrentStage(props: OnRunProps$1): Promise<void>;
521
- }
522
-
523
188
  interface QuestProps {
524
189
  /**
525
190
  * The name of the quest.
@@ -559,83 +224,6 @@ interface QuestProps {
559
224
  onContinue?: OnRunEvent<QuestInterface>;
560
225
  }
561
226
 
562
- interface StageInterface extends StageBaseInternalInterface, StageInterface$1 {
563
- }
564
- interface StageBaseInternalInterface {
565
- /**
566
- * The id of the stage.
567
- */
568
- readonly id: string;
569
- /**
570
- * The function that will be called when the stage starts.
571
- */
572
- readonly onStart?: OnRunEvent<StageInterface>;
573
- /**
574
- * The function that will be called when the stage ends.
575
- */
576
- readonly onEnd?: OnRunEvent<StageInterface>;
577
- /**
578
- * Check if the flag and goals are completed.
579
- * You can force the completion of the stage by setting the completed property to true.
580
- * @example
581
- * ```ts
582
- * export default class Stage extends StageStoredClass {
583
- * override get completed(): boolean {
584
- * if (super.completed) {
585
- * return true;
586
- * }
587
- * if (this.flags.length > 0) {
588
- * if (!this.flags.every((flag) => storage.getFlag(flag.flag))) {
589
- * return false;
590
- * }
591
- * return true;
592
- * }
593
- * return false;
594
- * }
595
- * override set completed(value: boolean) {
596
- * super.completed = value;
597
- * }
598
- * }
599
- * ```
600
- */
601
- completed: boolean;
602
- /**
603
- * If the stage is started.
604
- */
605
- started: boolean;
606
- /**
607
- * The date when the stage starts.
608
- */
609
- readonly startDate?: number;
610
- /**
611
- * Check if the stage can start.
612
- * @example
613
- * ```ts
614
- * export default class Stage extends StageStoredClass {
615
- * override get canStart(): boolean {
616
- * if (this.flagsRequired.length > 0 && !this.flagsRequired.every((flag) => storage.getFlag(flag.flag))) {
617
- * return false;
618
- * }
619
- * return super.canStart;
620
- * }
621
- * }
622
- * ```
623
- */
624
- readonly canStart: boolean;
625
- /**
626
- * The function that will be called when the stage starts.
627
- */
628
- start(props: OnRunProps$1): Promise<void>;
629
- /**
630
- * The number of day/date required to start the stage.
631
- */
632
- readonly deltaDateRequired: number;
633
- /**
634
- * The list of quests required to start the stage.
635
- */
636
- readonly questsRequired: QuestsRequiredType[];
637
- }
638
-
639
227
  interface StageFlags {
640
228
  /**
641
229
  * The flag for checking if the condition is met.
@@ -705,7 +293,7 @@ interface StageProps {
705
293
  interface ActivityStoredClassProps extends ActiveScheduling {
706
294
  }
707
295
  declare class ActivityStoredClass<OnRunEventType = ActivityInterface> extends StoredClassModel implements ActivityBaseInternalInterface {
708
- private readonly _onRun;
296
+ protected readonly _onRun: OnRunEvent<OnRunEventType>;
709
297
  constructor(id: string, _onRun: OnRunEvent<OnRunEventType>, props: ActivityStoredClassProps, category?: string);
710
298
  private _timeSlot?;
711
299
  get timeSlot(): TimeSchedulingInterface[] | TimeSchedulingInterface | undefined;
@@ -795,16 +383,37 @@ interface CommitmentStoredClassProps {
795
383
  dateScheduling?: DateSchedulingInterface;
796
384
  }
797
385
  declare class CommitmentStoredClass extends ActivityStoredClass<CommitmentInterface> implements CommitmentBaseInternalInterface {
798
- private readonly _characters;
799
- constructor(id: string, _characters: CharacterInterface[], onRun: OnRunEvent<CommitmentInterface> | undefined, props: CommitmentStoredClassProps);
386
+ constructor(id: string, characters: (CharacterInterface | CharacterIdType)[], onRun: OnRunEvent<CommitmentInterface> | undefined, props: CommitmentStoredClassProps);
800
387
  private readonly defaultExecutionType;
801
388
  private readonly defaultPriority?;
802
- get characters(): CharacterInterface[];
389
+ readonly characters: CharacterInterface[];
803
390
  get executionType(): ExecutionType;
804
391
  set executionType(value: ExecutionType);
805
392
  get priority(): number;
806
393
  set priority(value: number);
807
394
  protected addTempHistoryItem(): void;
395
+ /**
396
+ * Options for {@link run}.
397
+ */
398
+ runOptions?: CommitmentRunOptions;
399
+ /**
400
+ * Executes the commitment's `onRun` callback.
401
+ * @param props - Standard run props.
402
+ * @param options - Additional options.
403
+ * @param options.removeFromRoutine - Whether to call `routine.remove` for this commitment.
404
+ * Defaults to `true` when {@link executionType} is `"automatic"`, `false` otherwise.
405
+ */
406
+ get run(): (props: OnRunProps, options?: CommitmentRunOptions) => Promise<any>;
407
+ }
408
+ /**
409
+ * Options accepted by {@link CommitmentStoredClass.run}.
410
+ */
411
+ interface CommitmentRunOptions {
412
+ /**
413
+ * Whether to call `routine.remove` for this commitment after running.
414
+ * Defaults to `true` when {@link CommitmentStoredClass.executionType} is `"automatic"`, `false` otherwise.
415
+ */
416
+ removeFromRoutine?: boolean;
808
417
  }
809
418
 
810
419
  /**
@@ -829,7 +438,7 @@ declare class CommitmentBaseModel extends CommitmentStoredClass {
829
438
  * @param character The character or characters that are in the commitment and so in the room.
830
439
  * @param props The properties of the commitment.
831
440
  */
832
- constructor(id: string, character: CharacterInterface | CharacterInterface[] | undefined, props: CommitmentProps);
441
+ constructor(id: string, character: (CharacterInterface$1 | CharacterIdType$1) | (CharacterInterface$1 | CharacterIdType$1)[] | undefined, props: CommitmentProps);
833
442
  private _name;
834
443
  /**
835
444
  * The name of the commitment.
@@ -860,9 +469,8 @@ declare class CommitmentBaseModel extends CommitmentStoredClass {
860
469
  }
861
470
 
862
471
  declare abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {
863
- private defaultActivities;
864
- constructor(categoryId: string, id: string, defaultActivities?: ActivityInterface[]);
865
- private get defaultActivitiesIds();
472
+ constructor(categoryId: string, id: string, activities?: (ActivityInterface | ActivityIdType)[]);
473
+ private readonly defaultActivitiesIds;
866
474
  private get activeActivityScheduling();
867
475
  private get excludedActivitiesScheduling();
868
476
  private removeActivityScheduling;
@@ -871,8 +479,8 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
871
479
  private get additionalActivitiesIds();
872
480
  private get excludedActivitiesIds();
873
481
  get activitiesIds(): string[];
874
- addActivity(activity: ActivityInterface, options?: ActiveScheduling): void;
875
- removeActivity(activity: ActivityInterface | string): void;
482
+ addActivity(activity: ActivityInterface | ActivityIdType, options?: ActiveScheduling): void;
483
+ removeActivity(activity: ActivityInterface | ActivityIdType): void;
876
484
  clearExpiredActivities(): void;
877
485
  get activities(): ActivityInterface[];
878
486
  }
@@ -886,7 +494,7 @@ declare class LocationStoredClass extends NavigationAbstractClass implements Loc
886
494
  /**
887
495
  * The map where the location is.
888
496
  */
889
- _map: MapInterface, activities?: ActivityInterface[]);
497
+ _map: MapInterface, activities?: (ActivityInterface | ActivityIdType)[]);
890
498
  get map(): MapInterface;
891
499
  get rooms(): RoomInterface[];
892
500
  }
@@ -935,7 +543,7 @@ declare class LocationBaseModel extends LocationStoredClass implements LocationI
935
543
  }
936
544
 
937
545
  declare class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface {
938
- constructor(id: string, activities?: ActivityInterface[]);
546
+ constructor(id: string, activities?: (ActivityInterface | ActivityIdType)[]);
939
547
  get locations(): LocationInterface[];
940
548
  }
941
549
 
@@ -970,23 +578,20 @@ declare class MapBaseModel extends MapStoredClass implements MapBaseInternalInte
970
578
  }
971
579
 
972
580
  declare class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface {
973
- /**
974
- * The location where the room is.
975
- */
976
581
  private readonly _location;
977
582
  constructor(id: string,
978
583
  /**
979
584
  * The location where the room is.
980
585
  */
981
- _location: LocationInterface, activities?: ActivityInterface[] | {
982
- activities: ActivityInterface[];
983
- routine: CommitmentInterface[];
586
+ location: LocationInterface, activities?: (ActivityInterface | ActivityIdType)[] | {
587
+ activities: (ActivityInterface | ActivityIdType)[];
588
+ routine: (CommitmentInterface | CommitmentIdType)[];
984
589
  });
985
590
  get routine(): CommitmentInterface[];
986
- addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void;
987
- removeCommitment(commitment: CommitmentInterface | string): void;
591
+ addCommitment(commitment: CommitmentInterface | CommitmentIdType, options?: ActiveScheduling): void;
592
+ removeCommitment(commitment: CommitmentInterface | CommitmentIdType): void;
988
593
  get location(): LocationInterface;
989
- get characters(): CharacterInterface[];
594
+ get characters(): CharacterInterface$1[];
990
595
  get automaticFunctions(): OnRunAsyncFunction[];
991
596
  }
992
597
 
@@ -1072,24 +677,24 @@ declare class QuestStoredClass extends StoredClassModel implements QuestBaseInte
1072
677
  private _onContinue?;
1073
678
  get onContinue(): undefined | OnRunEvent<QuestInterface>;
1074
679
  get onNextStage(): undefined | OnRunEvent<QuestInterface>;
1075
- start(props: OnRunProps$1): Promise<void>;
680
+ start(props: OnRunProps): Promise<void>;
1076
681
  /**
1077
682
  * @deprecated Use {@link advanceIfCompleted} instead.
1078
683
  */
1079
- goNextIfCompleted(props: OnRunProps$1): Promise<boolean>;
1080
- advanceIfCompleted(props: OnRunProps$1): Promise<boolean>;
684
+ goNextIfCompleted(props: OnRunProps): Promise<boolean>;
685
+ advanceIfCompleted(props: OnRunProps): Promise<boolean>;
1081
686
  /**
1082
687
  * @deprecated Use {@link continue} instead.
1083
688
  */
1084
- goNext(props: OnRunProps$1): Promise<boolean>;
1085
- continue(props: OnRunProps$1): Promise<boolean>;
689
+ goNext(props: OnRunProps): Promise<boolean>;
690
+ continue(props: OnRunProps): Promise<boolean>;
1086
691
  /**
1087
692
  * @deprecated Use {@link advanceUnconditionally} instead.
1088
693
  */
1089
- forceGoNext(props: OnRunProps$1): Promise<boolean>;
1090
- advanceUnconditionally(props: OnRunProps$1): Promise<boolean>;
694
+ forceGoNext(props: OnRunProps): Promise<boolean>;
695
+ advanceUnconditionally(props: OnRunProps): Promise<boolean>;
1091
696
  get currentStageMustStart(): boolean;
1092
- startCurrentStage(props: OnRunProps$1): Promise<void>;
697
+ startCurrentStage(props: OnRunProps): Promise<void>;
1093
698
  }
1094
699
 
1095
700
  declare class QuestBaseModel extends QuestStoredClass {
@@ -1156,7 +761,7 @@ declare class StageStoredClass extends StoredClassModel implements StageBaseInte
1156
761
  get startDate(): number | undefined;
1157
762
  get canStart(): boolean;
1158
763
  inizialize(): void;
1159
- start(props: OnRunProps$1): Promise<void>;
764
+ start(props: OnRunProps): Promise<void>;
1160
765
  private _deltaDateRequired?;
1161
766
  get deltaDateRequired(): number;
1162
767
  private _questsRequired;
@@ -1205,211 +810,8 @@ declare class StageBaseModel extends StageStoredClass {
1205
810
  get canStart(): boolean;
1206
811
  }
1207
812
 
1208
- declare class NavigatorHandler {
1209
- get rooms(): RoomInterface[];
1210
- get locations(): LocationInterface[];
1211
- get maps(): MapInterface[];
1212
- get currentRoomId(): string | undefined;
1213
- get currentRoom(): RoomInterface | undefined;
1214
- set currentRoom(room: RoomInterface | string);
1215
- get currentLocation(): LocationInterface | undefined;
1216
- get currentMap(): MapInterface | undefined;
1217
- /**
1218
- * Clear all the expired activities.
1219
- */
1220
- clearExpiredActivities(): void;
1221
- }
1222
-
1223
- declare class QuestHandler {
1224
- /**
1225
- * The quests registered in the game.
1226
- */
1227
- get quests(): QuestInterface[];
1228
- /**
1229
- * The quests that are started, so they are in progress or completed or failed.
1230
- */
1231
- get startedQuests(): QuestInterface[];
1232
- /**
1233
- * The quests that are in progress.
1234
- */
1235
- get inProgressQuests(): QuestInterface[];
1236
- /**
1237
- * The quests that are completed.
1238
- */
1239
- get completedQuests(): QuestInterface[];
1240
- /**
1241
- * The quests that are failed.
1242
- */
1243
- get failedQuests(): QuestInterface[];
1244
- /**
1245
- * The quests that are not started.
1246
- */
1247
- get notStartedQuests(): QuestInterface[];
1248
- /**
1249
- * Get the quest by the id.
1250
- * @param id The id of the quest.
1251
- * @returns The quest with the id.
1252
- */
1253
- find(id: string): QuestInterface | undefined;
1254
- /**
1255
- * Start the quests that must start on the current stage.
1256
- */
1257
- startsStageMustBeStarted(props: OnRunProps$1): Promise<void>;
1258
- }
1259
-
1260
- declare class RoutineHandler {
1261
- /**
1262
- * Get the temporary commitments by its id.
1263
- * @returns The temporary commitments.
1264
- */
1265
- private get temporaryRoutine();
1266
- get commitmentsIds(): string[];
1267
- /**
1268
- * This feature adds the commitments during the game session.
1269
- * @param commitment The commitment or commitments to add.
1270
- * @param roomId The id of the room where the commitment is.
1271
- */
1272
- add(commitment: CommitmentInterface[] | CommitmentInterface, roomId: string, options?: ActiveScheduling): void;
1273
- /**
1274
- * Get the commitments added during the game session.
1275
- * @param id The id of the commitment.
1276
- * @returns The commitment or undefined if not found.
1277
- */
1278
- find(id: string): CommitmentInterface | undefined;
1279
- /**
1280
- * Remove the commitments added during the game session.
1281
- * @param commitment The commitment or commitment id to remove.
1282
- * @param roomId The id of the room where the commitment is.
1283
- */
1284
- remove(commitment: CommitmentInterface | string, roomId?: string): void;
1285
- /**
1286
- * Clear all the expired commitments.
1287
- */
1288
- clearExpiredRoutine(): void;
1289
- get characterCommitments(): {
1290
- [character: string]: [CommitmentInterface, string];
1291
- };
1292
- /**
1293
- * Get the current commitments. The hidden commitments are not included.
1294
- * 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.
1295
- * Higher priority commitments are calculated using the following steps:
1296
- * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.
1297
- * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.
1298
- * 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.
1299
- * @returns The current commitments.
1300
- */
1301
- get currentRoutine(): CommitmentInterface[];
1302
- get roomCommitments(): {
1303
- [roomId: string]: CommitmentInterface[];
1304
- };
1305
- /**
1306
- * Get the character commitment.
1307
- * @param character The character.
1308
- * @returns The commitment or undefined if not found.
1309
- */
1310
- getCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined;
1311
- }
1312
-
1313
- declare class TimeHandler {
1314
- initialize(settings: TimeSettings): void;
1315
- get dayStartTime(): number;
1316
- get dayEndTime(): number;
1317
- get defaultTimeSpent(): number;
1318
- get timeSlots(): TimeSlotInterface[];
1319
- get weekLength(): number;
1320
- get weekendStartDay(): number;
1321
- /**
1322
- * Week days name
1323
- * @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
1324
- * @returns The name of the week day.
1325
- * @example
1326
- * ```ts
1327
- * (weekDayNumber: number) => {
1328
- * const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
1329
- * return weekDaysNames[weekDayNumber];
1330
- * }
1331
- * ```
1332
- */
1333
- get getDayName(): ((weekDayNumber: number) => string) | undefined;
1334
- /**
1335
- * Get the current time. Time is a numeric variable used to determine and manage time during a day/date.
1336
- * 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.
1337
- */
1338
- get currentTime(): number;
1339
- set currentTime(value: number | undefined);
1340
- /**
1341
- * Get the current date. Date is a numeric variable used to determine and manage the number of days passed.
1342
- * It's recommended to use currentDate as if it were the current day.
1343
- */
1344
- get currentDate(): number;
1345
- set currentDate(value: number | undefined);
1346
- /**
1347
- * If the current day is greater than or equal to the weekend start day, then it will return true.
1348
- */
1349
- get isWeekend(): boolean;
1350
- /**
1351
- * Get the current week day number (from: 1 - to: {@link weekLength}).
1352
- * For example, if the week length is 7 and the current day is 10, then the result will be 4.
1353
- */
1354
- get currentWeekDayNumber(): number;
1355
- /**
1356
- * Get the current week day name. If the week days names are not defined, then it will return undefined.
1357
- * 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'.
1358
- * @default ""
1359
- */
1360
- get currentDayName(): string;
1361
- /**
1362
- * Get the current {@link timeSlots} index.
1363
- * You can use this property to create "Image that changes based on the time period":
1364
- * @example
1365
- * ```tsx
1366
- * import { weekLength } from '@drincs/nqtr';
1367
- *
1368
- * function changeBackground() {
1369
- * return (
1370
- * <img src={`background-currentTimeSlot.currentTimeSlot.png`} />
1371
- * )
1372
- * }
1373
- */
1374
- get currentTimeSlot(): number;
1375
- /**
1376
- * This function will increase the current time by the given time spent.
1377
- * 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.
1378
- * @param delta is the time spent in times (default: {@link defaultTimeSpent})
1379
- * @returns currentTimeSlot.currentTime
1380
- */
1381
- increaseTime(delta?: number): number;
1382
- /**
1383
- * This function will increase the current date by the given delta.
1384
- * @param delta is the number of days to increase (default: 1)
1385
- * @param time is the time of the new day (default: {@link dayStartTime})
1386
- * @returns timeTracker.currentDate
1387
- */
1388
- increaseDate(delta?: number, time?: number): number;
1389
- /**
1390
- * This function will check if the current time is between the given times.
1391
- * @param fromTime the starting time. If the {@link currentTime} is equal to this time, the function will return true.
1392
- * @param toTime the ending time.
1393
- * @returns true if the current time is between the given times, otherwise false.
1394
- */
1395
- nowIsBetween(fromTime: number | undefined, toTime: number | undefined): boolean;
1396
- }
1397
-
1398
- declare const timeTracker: TimeHandler;
1399
- declare const navigator: NavigatorHandler;
1400
- declare const routine: RoutineHandler;
1401
- declare const questsNotebook: QuestHandler;
1402
-
1403
- declare const handlers_navigator: typeof navigator;
1404
- declare const handlers_questsNotebook: typeof questsNotebook;
1405
- declare const handlers_routine: typeof routine;
1406
- declare const handlers_timeTracker: typeof timeTracker;
1407
- declare namespace handlers {
1408
- export { handlers_navigator as navigator, handlers_questsNotebook as questsNotebook, handlers_routine as routine, handlers_timeTracker as timeTracker };
1409
- }
1410
-
1411
813
  declare const nqtr: {
1412
- handlers: typeof handlers;
814
+ handlers: typeof handlers$1;
1413
815
  registries: typeof registries;
1414
816
  ActivityBaseModel: typeof ActivityBaseModel;
1415
817
  ActivityStoredClass: typeof ActivityStoredClass;
@@ -1427,4 +829,4 @@ declare const nqtr: {
1427
829
  StageStoredClass: typeof StageStoredClass;
1428
830
  };
1429
831
 
1430
- export { type ActiveScheduling, ActivityBaseModel, type ActivityInterface, type ActivityProps, ActivityStoredClass, type ActivityStoredClassProps, CommitmentBaseModel, type CommitmentInfo, 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 };
832
+ export { ActiveScheduling, ActivityBaseModel, ActivityInterface, type ActivityProps, ActivityStoredClass, type ActivityStoredClassProps, CommitmentBaseModel, type CommitmentInfo, CommitmentInterface, type CommitmentProps, CommitmentStoredClass, type CommitmentStoredClassProps, DateSchedulingInterface, ExecutionType, LocationBaseModel, type LocationBaseModelProps, LocationInterface, LocationStoredClass, MapBaseModel, type MapBaseModelProps, MapInterface, MapStoredClass, OnRunAsyncFunction, OnRunEvent, OnRunProps, QuestBaseModel, QuestInterface, type QuestProps, QuestStoredClass, type QuestStoredClassProps, QuestsRequiredType, RoomBaseModel, type RoomBaseModelProps, RoomInterface, RoomStoredClass, StageBaseModel, StageInterface, type StageProps, StageStoredClass, type StageStoredClassProps, TimeSchedulingInterface, nqtr as default };