@drincs/nqtr 0.8.1 → 1.0.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.
- package/README.md +8 -21
- package/dist/StageInterface-BN_O8nDA.d.mts +363 -0
- package/dist/StageInterface-BN_O8nDA.d.ts +363 -0
- package/dist/handlers.cjs +1 -1
- package/dist/handlers.d.mts +6 -613
- package/dist/handlers.d.ts +6 -613
- package/dist/handlers.mjs +1 -1
- package/dist/index-CtxMgD9N.d.ts +270 -0
- package/dist/index-D0T0L2IE.d.mts +270 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +72 -657
- package/dist/index.d.ts +72 -657
- package/dist/index.mjs +1 -1
- package/dist/ink.cjs +66 -1
- package/dist/ink.d.mts +58 -10
- package/dist/ink.d.ts +58 -10
- package/dist/ink.mjs +66 -1
- package/dist/registries.cjs +1 -1
- package/dist/registries.d.mts +143 -362
- package/dist/registries.d.ts +143 -362
- package/dist/registries.mjs +1 -1
- package/dist/vite.cjs +2 -0
- package/dist/vite.d.mts +160 -0
- package/dist/vite.d.ts +160 -0
- package/dist/vite.mjs +2 -0
- package/package.json +33 -12
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
|
-
|
|
4
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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,125 +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
|
-
* The function that will be called when the quest goes to the next stage.
|
|
479
|
-
*/
|
|
480
|
-
readonly onNextStage?: OnRunEvent<QuestInterface>;
|
|
481
|
-
/**
|
|
482
|
-
* Start the quest.
|
|
483
|
-
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
484
|
-
* @returns
|
|
485
|
-
*/
|
|
486
|
-
start(props: OnRunProps$1): Promise<void>;
|
|
487
|
-
/**
|
|
488
|
-
* Go to the next stage if the current stage is completed.
|
|
489
|
-
* If you want to force the change of stage, use {@link advanceUnconditionally}.
|
|
490
|
-
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
491
|
-
* @returns true if the stage was changed, false otherwise.
|
|
492
|
-
*/
|
|
493
|
-
advanceIfCompleted(props: OnRunProps$1): Promise<boolean>;
|
|
494
|
-
/**
|
|
495
|
-
* Complete the current stage and go to the next stage with {@link advanceUnconditionally}.
|
|
496
|
-
* If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}.
|
|
497
|
-
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
498
|
-
* @returns true if the stage was changed, false otherwise.
|
|
499
|
-
*/
|
|
500
|
-
continue(props: OnRunProps$1): Promise<boolean>;
|
|
501
|
-
/**
|
|
502
|
-
* Ignore the completed state of the current stage and go to the next stage without checking if the current stage is completed.
|
|
503
|
-
* If you want to go to the next stage only if the current stage is completed, use {@link advanceIfCompleted}.
|
|
504
|
-
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
505
|
-
* @returns returns true if the stage was changed, false otherwise.
|
|
506
|
-
*/
|
|
507
|
-
advanceUnconditionally(props: OnRunProps$1): Promise<boolean>;
|
|
508
|
-
/**
|
|
509
|
-
* If the current stage must start. It is true if the current stage is not started, can start and not completed.
|
|
510
|
-
*/
|
|
511
|
-
readonly currentStageMustStart: boolean;
|
|
512
|
-
/**
|
|
513
|
-
* Start the current stage. This is a system function, do not use it directly.
|
|
514
|
-
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
515
|
-
*/
|
|
516
|
-
startCurrentStage(props: OnRunProps$1): Promise<void>;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
188
|
interface QuestProps {
|
|
520
189
|
/**
|
|
521
190
|
* The name of the quest.
|
|
@@ -546,86 +215,13 @@ interface QuestProps {
|
|
|
546
215
|
*/
|
|
547
216
|
onStart?: OnRunEvent<QuestInterface>;
|
|
548
217
|
/**
|
|
549
|
-
* The function that will be executed when a stage end in the quest.
|
|
218
|
+
* @deprecated Use {@link onContinue} instead. The function that will be executed when a stage end in the quest.
|
|
550
219
|
*/
|
|
551
220
|
onNextStage?: OnRunEvent<QuestInterface>;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
interface StageInterface extends StageBaseInternalInterface, StageInterface$1 {
|
|
555
|
-
}
|
|
556
|
-
interface StageBaseInternalInterface {
|
|
557
|
-
/**
|
|
558
|
-
* The id of the stage.
|
|
559
|
-
*/
|
|
560
|
-
readonly id: string;
|
|
561
|
-
/**
|
|
562
|
-
* The function that will be called when the stage starts.
|
|
563
|
-
*/
|
|
564
|
-
readonly onStart?: OnRunEvent<StageInterface>;
|
|
565
|
-
/**
|
|
566
|
-
* The function that will be called when the stage ends.
|
|
567
|
-
*/
|
|
568
|
-
readonly onEnd?: OnRunEvent<StageInterface>;
|
|
569
221
|
/**
|
|
570
|
-
*
|
|
571
|
-
* You can force the completion of the stage by setting the completed property to true.
|
|
572
|
-
* @example
|
|
573
|
-
* ```ts
|
|
574
|
-
* export default class Stage extends StageStoredClass {
|
|
575
|
-
* override get completed(): boolean {
|
|
576
|
-
* if (super.completed) {
|
|
577
|
-
* return true;
|
|
578
|
-
* }
|
|
579
|
-
* if (this.flags.length > 0) {
|
|
580
|
-
* if (!this.flags.every((flag) => storage.getFlag(flag.flag))) {
|
|
581
|
-
* return false;
|
|
582
|
-
* }
|
|
583
|
-
* return true;
|
|
584
|
-
* }
|
|
585
|
-
* return false;
|
|
586
|
-
* }
|
|
587
|
-
* override set completed(value: boolean) {
|
|
588
|
-
* super.completed = value;
|
|
589
|
-
* }
|
|
590
|
-
* }
|
|
591
|
-
* ```
|
|
592
|
-
*/
|
|
593
|
-
completed: boolean;
|
|
594
|
-
/**
|
|
595
|
-
* If the stage is started.
|
|
596
|
-
*/
|
|
597
|
-
started: boolean;
|
|
598
|
-
/**
|
|
599
|
-
* The date when the stage starts.
|
|
600
|
-
*/
|
|
601
|
-
readonly startDate?: number;
|
|
602
|
-
/**
|
|
603
|
-
* Check if the stage can start.
|
|
604
|
-
* @example
|
|
605
|
-
* ```ts
|
|
606
|
-
* export default class Stage extends StageStoredClass {
|
|
607
|
-
* override get canStart(): boolean {
|
|
608
|
-
* if (this.flagsRequired.length > 0 && !this.flagsRequired.every((flag) => storage.getFlag(flag.flag))) {
|
|
609
|
-
* return false;
|
|
610
|
-
* }
|
|
611
|
-
* return super.canStart;
|
|
612
|
-
* }
|
|
613
|
-
* }
|
|
614
|
-
* ```
|
|
615
|
-
*/
|
|
616
|
-
readonly canStart: boolean;
|
|
617
|
-
/**
|
|
618
|
-
* The function that will be called when the stage starts.
|
|
619
|
-
*/
|
|
620
|
-
start(props: OnRunProps$1): Promise<void>;
|
|
621
|
-
/**
|
|
622
|
-
* The number of day/date required to start the stage.
|
|
623
|
-
*/
|
|
624
|
-
readonly deltaDateRequired: number;
|
|
625
|
-
/**
|
|
626
|
-
* The list of quests required to start the stage.
|
|
222
|
+
* The function that will be executed when a stage end in the quest.
|
|
627
223
|
*/
|
|
628
|
-
|
|
224
|
+
onContinue?: OnRunEvent<QuestInterface>;
|
|
629
225
|
}
|
|
630
226
|
|
|
631
227
|
interface StageFlags {
|
|
@@ -697,7 +293,7 @@ interface StageProps {
|
|
|
697
293
|
interface ActivityStoredClassProps extends ActiveScheduling {
|
|
698
294
|
}
|
|
699
295
|
declare class ActivityStoredClass<OnRunEventType = ActivityInterface> extends StoredClassModel implements ActivityBaseInternalInterface {
|
|
700
|
-
|
|
296
|
+
protected readonly _onRun: OnRunEvent<OnRunEventType>;
|
|
701
297
|
constructor(id: string, _onRun: OnRunEvent<OnRunEventType>, props: ActivityStoredClassProps, category?: string);
|
|
702
298
|
private _timeSlot?;
|
|
703
299
|
get timeSlot(): TimeSchedulingInterface[] | TimeSchedulingInterface | undefined;
|
|
@@ -787,16 +383,37 @@ interface CommitmentStoredClassProps {
|
|
|
787
383
|
dateScheduling?: DateSchedulingInterface;
|
|
788
384
|
}
|
|
789
385
|
declare class CommitmentStoredClass extends ActivityStoredClass<CommitmentInterface> implements CommitmentBaseInternalInterface {
|
|
790
|
-
|
|
791
|
-
constructor(id: string, _characters: CharacterInterface[], onRun: OnRunEvent<CommitmentInterface> | undefined, props: CommitmentStoredClassProps);
|
|
386
|
+
constructor(id: string, characters: (CharacterInterface | CharacterIdType)[], onRun: OnRunEvent<CommitmentInterface> | undefined, props: CommitmentStoredClassProps);
|
|
792
387
|
private readonly defaultExecutionType;
|
|
793
388
|
private readonly defaultPriority?;
|
|
794
|
-
|
|
389
|
+
readonly characters: CharacterInterface[];
|
|
795
390
|
get executionType(): ExecutionType;
|
|
796
391
|
set executionType(value: ExecutionType);
|
|
797
392
|
get priority(): number;
|
|
798
393
|
set priority(value: number);
|
|
799
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;
|
|
800
417
|
}
|
|
801
418
|
|
|
802
419
|
/**
|
|
@@ -821,7 +438,7 @@ declare class CommitmentBaseModel extends CommitmentStoredClass {
|
|
|
821
438
|
* @param character The character or characters that are in the commitment and so in the room.
|
|
822
439
|
* @param props The properties of the commitment.
|
|
823
440
|
*/
|
|
824
|
-
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);
|
|
825
442
|
private _name;
|
|
826
443
|
/**
|
|
827
444
|
* The name of the commitment.
|
|
@@ -852,9 +469,8 @@ declare class CommitmentBaseModel extends CommitmentStoredClass {
|
|
|
852
469
|
}
|
|
853
470
|
|
|
854
471
|
declare abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
private get defaultActivitiesIds();
|
|
472
|
+
constructor(categoryId: string, id: string, activities?: (ActivityInterface | ActivityIdType)[]);
|
|
473
|
+
private readonly defaultActivitiesIds;
|
|
858
474
|
private get activeActivityScheduling();
|
|
859
475
|
private get excludedActivitiesScheduling();
|
|
860
476
|
private removeActivityScheduling;
|
|
@@ -863,8 +479,8 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
|
|
|
863
479
|
private get additionalActivitiesIds();
|
|
864
480
|
private get excludedActivitiesIds();
|
|
865
481
|
get activitiesIds(): string[];
|
|
866
|
-
addActivity(activity: ActivityInterface, options?: ActiveScheduling): void;
|
|
867
|
-
removeActivity(activity: ActivityInterface |
|
|
482
|
+
addActivity(activity: ActivityInterface | ActivityIdType, options?: ActiveScheduling): void;
|
|
483
|
+
removeActivity(activity: ActivityInterface | ActivityIdType): void;
|
|
868
484
|
clearExpiredActivities(): void;
|
|
869
485
|
get activities(): ActivityInterface[];
|
|
870
486
|
}
|
|
@@ -878,7 +494,7 @@ declare class LocationStoredClass extends NavigationAbstractClass implements Loc
|
|
|
878
494
|
/**
|
|
879
495
|
* The map where the location is.
|
|
880
496
|
*/
|
|
881
|
-
_map: MapInterface, activities?: ActivityInterface[]);
|
|
497
|
+
_map: MapInterface, activities?: (ActivityInterface | ActivityIdType)[]);
|
|
882
498
|
get map(): MapInterface;
|
|
883
499
|
get rooms(): RoomInterface[];
|
|
884
500
|
}
|
|
@@ -927,7 +543,7 @@ declare class LocationBaseModel extends LocationStoredClass implements LocationI
|
|
|
927
543
|
}
|
|
928
544
|
|
|
929
545
|
declare class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface {
|
|
930
|
-
constructor(id: string, activities?: ActivityInterface[]);
|
|
546
|
+
constructor(id: string, activities?: (ActivityInterface | ActivityIdType)[]);
|
|
931
547
|
get locations(): LocationInterface[];
|
|
932
548
|
}
|
|
933
549
|
|
|
@@ -962,23 +578,20 @@ declare class MapBaseModel extends MapStoredClass implements MapBaseInternalInte
|
|
|
962
578
|
}
|
|
963
579
|
|
|
964
580
|
declare class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface {
|
|
965
|
-
/**
|
|
966
|
-
* The location where the room is.
|
|
967
|
-
*/
|
|
968
581
|
private readonly _location;
|
|
969
582
|
constructor(id: string,
|
|
970
583
|
/**
|
|
971
584
|
* The location where the room is.
|
|
972
585
|
*/
|
|
973
|
-
|
|
974
|
-
activities: ActivityInterface[];
|
|
975
|
-
routine: CommitmentInterface[];
|
|
586
|
+
location: LocationInterface, activities?: (ActivityInterface | ActivityIdType)[] | {
|
|
587
|
+
activities: (ActivityInterface | ActivityIdType)[];
|
|
588
|
+
routine: (CommitmentInterface | CommitmentIdType)[];
|
|
976
589
|
});
|
|
977
590
|
get routine(): CommitmentInterface[];
|
|
978
|
-
addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void;
|
|
979
|
-
removeCommitment(commitment: CommitmentInterface |
|
|
591
|
+
addCommitment(commitment: CommitmentInterface | CommitmentIdType, options?: ActiveScheduling): void;
|
|
592
|
+
removeCommitment(commitment: CommitmentInterface | CommitmentIdType): void;
|
|
980
593
|
get location(): LocationInterface;
|
|
981
|
-
get characters(): CharacterInterface[];
|
|
594
|
+
get characters(): CharacterInterface$1[];
|
|
982
595
|
get automaticFunctions(): OnRunAsyncFunction[];
|
|
983
596
|
}
|
|
984
597
|
|
|
@@ -1039,9 +652,13 @@ interface QuestStoredClassProps {
|
|
|
1039
652
|
*/
|
|
1040
653
|
onStart?: OnRunEvent<QuestInterface>;
|
|
1041
654
|
/**
|
|
1042
|
-
*
|
|
655
|
+
* @deprecated Use {@link onContinue} instead.
|
|
1043
656
|
*/
|
|
1044
657
|
onNextStage?: OnRunEvent<QuestInterface>;
|
|
658
|
+
/**
|
|
659
|
+
* The function that will be executed when a stage end in the quest.
|
|
660
|
+
*/
|
|
661
|
+
onContinue?: OnRunEvent<QuestInterface>;
|
|
1045
662
|
}
|
|
1046
663
|
declare class QuestStoredClass extends StoredClassModel implements QuestBaseInternalInterface {
|
|
1047
664
|
private readonly _stages;
|
|
@@ -1057,26 +674,27 @@ declare class QuestStoredClass extends StoredClassModel implements QuestBaseInte
|
|
|
1057
674
|
set failed(value: boolean);
|
|
1058
675
|
private _onStart?;
|
|
1059
676
|
get onStart(): undefined | OnRunEvent<QuestInterface>;
|
|
1060
|
-
private
|
|
677
|
+
private _onContinue?;
|
|
678
|
+
get onContinue(): undefined | OnRunEvent<QuestInterface>;
|
|
1061
679
|
get onNextStage(): undefined | OnRunEvent<QuestInterface>;
|
|
1062
|
-
start(props: OnRunProps
|
|
680
|
+
start(props: OnRunProps): Promise<void>;
|
|
1063
681
|
/**
|
|
1064
682
|
* @deprecated Use {@link advanceIfCompleted} instead.
|
|
1065
683
|
*/
|
|
1066
|
-
goNextIfCompleted(props: OnRunProps
|
|
1067
|
-
advanceIfCompleted(props: OnRunProps
|
|
684
|
+
goNextIfCompleted(props: OnRunProps): Promise<boolean>;
|
|
685
|
+
advanceIfCompleted(props: OnRunProps): Promise<boolean>;
|
|
1068
686
|
/**
|
|
1069
687
|
* @deprecated Use {@link continue} instead.
|
|
1070
688
|
*/
|
|
1071
|
-
goNext(props: OnRunProps
|
|
1072
|
-
continue(props: OnRunProps
|
|
689
|
+
goNext(props: OnRunProps): Promise<boolean>;
|
|
690
|
+
continue(props: OnRunProps): Promise<boolean>;
|
|
1073
691
|
/**
|
|
1074
692
|
* @deprecated Use {@link advanceUnconditionally} instead.
|
|
1075
693
|
*/
|
|
1076
|
-
forceGoNext(props: OnRunProps
|
|
1077
|
-
advanceUnconditionally(props: OnRunProps
|
|
694
|
+
forceGoNext(props: OnRunProps): Promise<boolean>;
|
|
695
|
+
advanceUnconditionally(props: OnRunProps): Promise<boolean>;
|
|
1078
696
|
get currentStageMustStart(): boolean;
|
|
1079
|
-
startCurrentStage(props: OnRunProps
|
|
697
|
+
startCurrentStage(props: OnRunProps): Promise<void>;
|
|
1080
698
|
}
|
|
1081
699
|
|
|
1082
700
|
declare class QuestBaseModel extends QuestStoredClass {
|
|
@@ -1143,7 +761,7 @@ declare class StageStoredClass extends StoredClassModel implements StageBaseInte
|
|
|
1143
761
|
get startDate(): number | undefined;
|
|
1144
762
|
get canStart(): boolean;
|
|
1145
763
|
inizialize(): void;
|
|
1146
|
-
start(props: OnRunProps
|
|
764
|
+
start(props: OnRunProps): Promise<void>;
|
|
1147
765
|
private _deltaDateRequired?;
|
|
1148
766
|
get deltaDateRequired(): number;
|
|
1149
767
|
private _questsRequired;
|
|
@@ -1192,211 +810,8 @@ declare class StageBaseModel extends StageStoredClass {
|
|
|
1192
810
|
get canStart(): boolean;
|
|
1193
811
|
}
|
|
1194
812
|
|
|
1195
|
-
declare class NavigatorHandler {
|
|
1196
|
-
get rooms(): RoomInterface[];
|
|
1197
|
-
get locations(): LocationInterface[];
|
|
1198
|
-
get maps(): MapInterface[];
|
|
1199
|
-
get currentRoomId(): string | undefined;
|
|
1200
|
-
get currentRoom(): RoomInterface | undefined;
|
|
1201
|
-
set currentRoom(room: RoomInterface | string);
|
|
1202
|
-
get currentLocation(): LocationInterface | undefined;
|
|
1203
|
-
get currentMap(): MapInterface | undefined;
|
|
1204
|
-
/**
|
|
1205
|
-
* Clear all the expired activities.
|
|
1206
|
-
*/
|
|
1207
|
-
clearExpiredActivities(): void;
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
declare class QuestHandler {
|
|
1211
|
-
/**
|
|
1212
|
-
* The quests registered in the game.
|
|
1213
|
-
*/
|
|
1214
|
-
get quests(): QuestInterface[];
|
|
1215
|
-
/**
|
|
1216
|
-
* The quests that are started, so they are in progress or completed or failed.
|
|
1217
|
-
*/
|
|
1218
|
-
get startedQuests(): QuestInterface[];
|
|
1219
|
-
/**
|
|
1220
|
-
* The quests that are in progress.
|
|
1221
|
-
*/
|
|
1222
|
-
get inProgressQuests(): QuestInterface[];
|
|
1223
|
-
/**
|
|
1224
|
-
* The quests that are completed.
|
|
1225
|
-
*/
|
|
1226
|
-
get completedQuests(): QuestInterface[];
|
|
1227
|
-
/**
|
|
1228
|
-
* The quests that are failed.
|
|
1229
|
-
*/
|
|
1230
|
-
get failedQuests(): QuestInterface[];
|
|
1231
|
-
/**
|
|
1232
|
-
* The quests that are not started.
|
|
1233
|
-
*/
|
|
1234
|
-
get notStartedQuests(): QuestInterface[];
|
|
1235
|
-
/**
|
|
1236
|
-
* Get the quest by the id.
|
|
1237
|
-
* @param id The id of the quest.
|
|
1238
|
-
* @returns The quest with the id.
|
|
1239
|
-
*/
|
|
1240
|
-
find(id: string): QuestInterface | undefined;
|
|
1241
|
-
/**
|
|
1242
|
-
* Start the quests that must start on the current stage.
|
|
1243
|
-
*/
|
|
1244
|
-
startsStageMustBeStarted(props: OnRunProps$1): Promise<void>;
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
declare class RoutineHandler {
|
|
1248
|
-
/**
|
|
1249
|
-
* Get the temporary commitments by its id.
|
|
1250
|
-
* @returns The temporary commitments.
|
|
1251
|
-
*/
|
|
1252
|
-
private get temporaryRoutine();
|
|
1253
|
-
get commitmentsIds(): string[];
|
|
1254
|
-
/**
|
|
1255
|
-
* This feature adds the commitments during the game session.
|
|
1256
|
-
* @param commitment The commitment or commitments to add.
|
|
1257
|
-
* @param roomId The id of the room where the commitment is.
|
|
1258
|
-
*/
|
|
1259
|
-
add(commitment: CommitmentInterface[] | CommitmentInterface, roomId: string, options?: ActiveScheduling): void;
|
|
1260
|
-
/**
|
|
1261
|
-
* Get the commitments added during the game session.
|
|
1262
|
-
* @param id The id of the commitment.
|
|
1263
|
-
* @returns The commitment or undefined if not found.
|
|
1264
|
-
*/
|
|
1265
|
-
find(id: string): CommitmentInterface | undefined;
|
|
1266
|
-
/**
|
|
1267
|
-
* Remove the commitments added during the game session.
|
|
1268
|
-
* @param commitment The commitment or commitment id to remove.
|
|
1269
|
-
* @param roomId The id of the room where the commitment is.
|
|
1270
|
-
*/
|
|
1271
|
-
remove(commitment: CommitmentInterface | string, roomId?: string): void;
|
|
1272
|
-
/**
|
|
1273
|
-
* Clear all the expired commitments.
|
|
1274
|
-
*/
|
|
1275
|
-
clearExpiredRoutine(): void;
|
|
1276
|
-
get characterCommitments(): {
|
|
1277
|
-
[character: string]: [CommitmentInterface, string];
|
|
1278
|
-
};
|
|
1279
|
-
/**
|
|
1280
|
-
* Get the current commitments. The hidden commitments are not included.
|
|
1281
|
-
* 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.
|
|
1282
|
-
* Higher priority commitments are calculated using the following steps:
|
|
1283
|
-
* 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.
|
|
1284
|
-
* 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.
|
|
1285
|
-
* 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.
|
|
1286
|
-
* @returns The current commitments.
|
|
1287
|
-
*/
|
|
1288
|
-
get currentRoutine(): CommitmentInterface[];
|
|
1289
|
-
get roomCommitments(): {
|
|
1290
|
-
[roomId: string]: CommitmentInterface[];
|
|
1291
|
-
};
|
|
1292
|
-
/**
|
|
1293
|
-
* Get the character commitment.
|
|
1294
|
-
* @param character The character.
|
|
1295
|
-
* @returns The commitment or undefined if not found.
|
|
1296
|
-
*/
|
|
1297
|
-
getCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined;
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
declare class TimeHandler {
|
|
1301
|
-
initialize(settings: TimeSettings): void;
|
|
1302
|
-
get dayStartTime(): number;
|
|
1303
|
-
get dayEndTime(): number;
|
|
1304
|
-
get defaultTimeSpent(): number;
|
|
1305
|
-
get timeSlots(): TimeSlotInterface[];
|
|
1306
|
-
get weekLength(): number;
|
|
1307
|
-
get weekendStartDay(): number;
|
|
1308
|
-
/**
|
|
1309
|
-
* Week days name
|
|
1310
|
-
* @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
|
|
1311
|
-
* @returns The name of the week day.
|
|
1312
|
-
* @example
|
|
1313
|
-
* ```ts
|
|
1314
|
-
* (weekDayNumber: number) => {
|
|
1315
|
-
* const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
1316
|
-
* return weekDaysNames[weekDayNumber];
|
|
1317
|
-
* }
|
|
1318
|
-
* ```
|
|
1319
|
-
*/
|
|
1320
|
-
get getDayName(): ((weekDayNumber: number) => string) | undefined;
|
|
1321
|
-
/**
|
|
1322
|
-
* Get the current time. Time is a numeric variable used to determine and manage time during a day/date.
|
|
1323
|
-
* 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.
|
|
1324
|
-
*/
|
|
1325
|
-
get currentTime(): number;
|
|
1326
|
-
set currentTime(value: number | undefined);
|
|
1327
|
-
/**
|
|
1328
|
-
* Get the current date. Date is a numeric variable used to determine and manage the number of days passed.
|
|
1329
|
-
* It's recommended to use currentDate as if it were the current day.
|
|
1330
|
-
*/
|
|
1331
|
-
get currentDate(): number;
|
|
1332
|
-
set currentDate(value: number | undefined);
|
|
1333
|
-
/**
|
|
1334
|
-
* If the current day is greater than or equal to the weekend start day, then it will return true.
|
|
1335
|
-
*/
|
|
1336
|
-
get isWeekend(): boolean;
|
|
1337
|
-
/**
|
|
1338
|
-
* Get the current week day number (from: 1 - to: {@link weekLength}).
|
|
1339
|
-
* For example, if the week length is 7 and the current day is 10, then the result will be 4.
|
|
1340
|
-
*/
|
|
1341
|
-
get currentWeekDayNumber(): number;
|
|
1342
|
-
/**
|
|
1343
|
-
* Get the current week day name. If the week days names are not defined, then it will return undefined.
|
|
1344
|
-
* 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'.
|
|
1345
|
-
* @default ""
|
|
1346
|
-
*/
|
|
1347
|
-
get currentDayName(): string;
|
|
1348
|
-
/**
|
|
1349
|
-
* Get the current {@link timeSlots} index.
|
|
1350
|
-
* You can use this property to create "Image that changes based on the time period":
|
|
1351
|
-
* @example
|
|
1352
|
-
* ```tsx
|
|
1353
|
-
* import { weekLength } from '@drincs/nqtr';
|
|
1354
|
-
*
|
|
1355
|
-
* function changeBackground() {
|
|
1356
|
-
* return (
|
|
1357
|
-
* <img src={`background-currentTimeSlot.currentTimeSlot.png`} />
|
|
1358
|
-
* )
|
|
1359
|
-
* }
|
|
1360
|
-
*/
|
|
1361
|
-
get currentTimeSlot(): number;
|
|
1362
|
-
/**
|
|
1363
|
-
* This function will increase the current time by the given time spent.
|
|
1364
|
-
* 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.
|
|
1365
|
-
* @param delta is the time spent in times (default: {@link defaultTimeSpent})
|
|
1366
|
-
* @returns currentTimeSlot.currentTime
|
|
1367
|
-
*/
|
|
1368
|
-
increaseTime(delta?: number): number;
|
|
1369
|
-
/**
|
|
1370
|
-
* This function will increase the current date by the given delta.
|
|
1371
|
-
* @param delta is the number of days to increase (default: 1)
|
|
1372
|
-
* @param time is the time of the new day (default: {@link dayStartTime})
|
|
1373
|
-
* @returns timeTracker.currentDate
|
|
1374
|
-
*/
|
|
1375
|
-
increaseDate(delta?: number, time?: number): number;
|
|
1376
|
-
/**
|
|
1377
|
-
* This function will check if the current time is between the given times.
|
|
1378
|
-
* @param fromTime the starting time. If the {@link currentTime} is equal to this time, the function will return true.
|
|
1379
|
-
* @param toTime the ending time.
|
|
1380
|
-
* @returns true if the current time is between the given times, otherwise false.
|
|
1381
|
-
*/
|
|
1382
|
-
nowIsBetween(fromTime: number | undefined, toTime: number | undefined): boolean;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
declare const timeTracker: TimeHandler;
|
|
1386
|
-
declare const navigator: NavigatorHandler;
|
|
1387
|
-
declare const routine: RoutineHandler;
|
|
1388
|
-
declare const questsNotebook: QuestHandler;
|
|
1389
|
-
|
|
1390
|
-
declare const handlers_navigator: typeof navigator;
|
|
1391
|
-
declare const handlers_questsNotebook: typeof questsNotebook;
|
|
1392
|
-
declare const handlers_routine: typeof routine;
|
|
1393
|
-
declare const handlers_timeTracker: typeof timeTracker;
|
|
1394
|
-
declare namespace handlers {
|
|
1395
|
-
export { handlers_navigator as navigator, handlers_questsNotebook as questsNotebook, handlers_routine as routine, handlers_timeTracker as timeTracker };
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
813
|
declare const nqtr: {
|
|
1399
|
-
handlers: typeof handlers;
|
|
814
|
+
handlers: typeof handlers$1;
|
|
1400
815
|
registries: typeof registries;
|
|
1401
816
|
ActivityBaseModel: typeof ActivityBaseModel;
|
|
1402
817
|
ActivityStoredClass: typeof ActivityStoredClass;
|
|
@@ -1414,4 +829,4 @@ declare const nqtr: {
|
|
|
1414
829
|
StageStoredClass: typeof StageStoredClass;
|
|
1415
830
|
};
|
|
1416
831
|
|
|
1417
|
-
export {
|
|
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 };
|