@drincs/nqtr 1.0.3 → 1.1.2
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 +47 -1
- package/dist/{StageInterface-BN_O8nDA.d.mts → StageInterface-DzhX29F-.d.mts} +20 -1
- package/dist/{StageInterface-BN_O8nDA.d.ts → StageInterface-DzhX29F-.d.ts} +20 -1
- package/dist/handlers.cjs +1 -1
- package/dist/handlers.d.mts +2 -2
- package/dist/handlers.d.ts +2 -2
- package/dist/handlers.mjs +1 -1
- package/dist/index-CT-JfKIo.d.mts +367 -0
- package/dist/index-DehHTT06.d.ts +367 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +51 -7
- package/dist/index.d.ts +51 -7
- package/dist/index.mjs +1 -1
- package/dist/registries.d.mts +3 -2
- package/dist/registries.d.ts +3 -2
- package/dist/vite.cjs +2 -2
- package/dist/vite.d.mts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.mjs +2 -2
- package/package.json +13 -10
- package/dist/index-CtxMgD9N.d.ts +0 -270
- package/dist/index-D0T0L2IE.d.mts +0 -270
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { R as RoomInterface, h as LocationInterface, M as MapInterface, Q as QuestInterface, C as CommitmentInterface, c as ActiveScheduling } from './StageInterface-BN_O8nDA.mjs';
|
|
2
|
-
import { RoomIdType, CommitmentIdType } from '@drincs/nqtr/registries';
|
|
3
|
-
import { OnRunProps } from '@drincs/nqtr';
|
|
4
|
-
import { CharacterInterface, CharacterIdType } from '@drincs/pixi-vn';
|
|
5
|
-
|
|
6
|
-
type TimeSlotInterface = {
|
|
7
|
-
name: string;
|
|
8
|
-
startTime: number;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Time Settings, which can be set using {@link timeTracker.editSettings}
|
|
12
|
-
*/
|
|
13
|
-
type TimeSettings = {
|
|
14
|
-
/**
|
|
15
|
-
* Minimum time of the day
|
|
16
|
-
* @default 0
|
|
17
|
-
*/
|
|
18
|
-
dayStartTime?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum time of the day
|
|
21
|
-
* @default 24
|
|
22
|
-
*/
|
|
23
|
-
dayEndTime?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Default time spent
|
|
26
|
-
* @default 1
|
|
27
|
-
*/
|
|
28
|
-
defaultTimeSpent?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Time slots
|
|
31
|
-
* @default []
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* [
|
|
35
|
-
* { name: 'Morning', startTime: 5 },
|
|
36
|
-
* { name: 'Afternoon', startTime: 12 },
|
|
37
|
-
* { name: 'Evening', startTime: 18 },
|
|
38
|
-
* { name: 'Night', startTime: 22 }
|
|
39
|
-
* ]
|
|
40
|
-
*/
|
|
41
|
-
timeSlots?: TimeSlotInterface[];
|
|
42
|
-
/**
|
|
43
|
-
* Week length
|
|
44
|
-
* @default 7
|
|
45
|
-
*/
|
|
46
|
-
weekLength?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6
|
|
49
|
-
* @default weekLength - 1
|
|
50
|
-
*/
|
|
51
|
-
weekendStartDay?: number;
|
|
52
|
-
/**
|
|
53
|
-
* Week days name
|
|
54
|
-
* @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
|
|
55
|
-
* @returns The name of the week day.
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* (weekDayNumber: number) => {
|
|
59
|
-
* const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
60
|
-
* return weekDaysNames[weekDayNumber];
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
getDayName?: (weekDayNumber: number) => string;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
declare class NavigatorHandler {
|
|
68
|
-
get rooms(): RoomInterface[];
|
|
69
|
-
get locations(): LocationInterface[];
|
|
70
|
-
get maps(): MapInterface[];
|
|
71
|
-
get currentRoomId(): string | undefined;
|
|
72
|
-
get currentRoom(): RoomInterface | undefined;
|
|
73
|
-
set currentRoom(room: RoomInterface | RoomIdType);
|
|
74
|
-
get currentLocation(): LocationInterface | undefined;
|
|
75
|
-
get currentMap(): MapInterface | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Clear all the expired activities.
|
|
78
|
-
*/
|
|
79
|
-
clearExpiredActivities(): void;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare class QuestHandler {
|
|
83
|
-
/**
|
|
84
|
-
* The quests registered in the game.
|
|
85
|
-
*/
|
|
86
|
-
get quests(): QuestInterface[];
|
|
87
|
-
/**
|
|
88
|
-
* The quests that are started, so they are in progress or completed or failed.
|
|
89
|
-
*/
|
|
90
|
-
get startedQuests(): QuestInterface[];
|
|
91
|
-
/**
|
|
92
|
-
* The quests that are in progress.
|
|
93
|
-
*/
|
|
94
|
-
get inProgressQuests(): QuestInterface[];
|
|
95
|
-
/**
|
|
96
|
-
* The quests that are completed.
|
|
97
|
-
*/
|
|
98
|
-
get completedQuests(): QuestInterface[];
|
|
99
|
-
/**
|
|
100
|
-
* The quests that are failed.
|
|
101
|
-
*/
|
|
102
|
-
get failedQuests(): QuestInterface[];
|
|
103
|
-
/**
|
|
104
|
-
* The quests that are not started.
|
|
105
|
-
*/
|
|
106
|
-
get notStartedQuests(): QuestInterface[];
|
|
107
|
-
/**
|
|
108
|
-
* Get the quest by the id.
|
|
109
|
-
* @param id The id of the quest.
|
|
110
|
-
* @returns The quest with the id.
|
|
111
|
-
*/
|
|
112
|
-
find(id: string): QuestInterface | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* Start the quests that must start on the current stage.
|
|
115
|
-
*/
|
|
116
|
-
startsStageMustBeStarted(props: OnRunProps): Promise<void>;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
declare class RoutineHandler {
|
|
120
|
-
/**
|
|
121
|
-
* Get the temporary commitments by its id.
|
|
122
|
-
* @returns The temporary commitments.
|
|
123
|
-
*/
|
|
124
|
-
private get temporaryRoutine();
|
|
125
|
-
get commitmentsIds(): string[];
|
|
126
|
-
/**
|
|
127
|
-
* This feature adds the commitments during the game session.
|
|
128
|
-
* @param commitment The commitment or commitments to add.
|
|
129
|
-
* @param roomId The id of the room where the commitment is.
|
|
130
|
-
*/
|
|
131
|
-
add(commitment: (CommitmentInterface | CommitmentIdType)[] | CommitmentInterface | CommitmentIdType, roomId: string, options?: ActiveScheduling): void;
|
|
132
|
-
/**
|
|
133
|
-
* Get the commitments added during the game session.
|
|
134
|
-
* @param id The id of the commitment.
|
|
135
|
-
* @returns The commitment or undefined if not found.
|
|
136
|
-
*/
|
|
137
|
-
find(id: string): CommitmentInterface | undefined;
|
|
138
|
-
/**
|
|
139
|
-
* Remove the commitments added during the game session.
|
|
140
|
-
* @param commitment The commitment or commitment id to remove.
|
|
141
|
-
* @param roomId The id of the room where the commitment is.
|
|
142
|
-
*/
|
|
143
|
-
remove(commitment: CommitmentInterface | CommitmentIdType, roomId?: string): void;
|
|
144
|
-
/**
|
|
145
|
-
* Clear all the expired commitments.
|
|
146
|
-
*/
|
|
147
|
-
clearExpiredRoutine(): void;
|
|
148
|
-
get characterCommitments(): {
|
|
149
|
-
[character: string]: [CommitmentInterface, string];
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Get the current commitments. The hidden commitments are not included.
|
|
153
|
-
* 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.
|
|
154
|
-
* Higher priority commitments are calculated using the following steps:
|
|
155
|
-
* 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.
|
|
156
|
-
* 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.
|
|
157
|
-
* 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.
|
|
158
|
-
* @returns The current commitments.
|
|
159
|
-
*/
|
|
160
|
-
get currentRoutine(): CommitmentInterface[];
|
|
161
|
-
get roomCommitments(): {
|
|
162
|
-
[roomId: string]: CommitmentInterface[];
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* Get the character commitment.
|
|
166
|
-
* @param character The character.
|
|
167
|
-
* @returns The commitment or undefined if not found.
|
|
168
|
-
*/
|
|
169
|
-
getCommitmentByCharacter(character: CharacterInterface | CharacterIdType): CommitmentInterface | undefined;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
declare class TimeHandler {
|
|
173
|
-
initialize(settings: TimeSettings): void;
|
|
174
|
-
get dayStartTime(): number;
|
|
175
|
-
get dayEndTime(): number;
|
|
176
|
-
get defaultTimeSpent(): number;
|
|
177
|
-
get timeSlots(): TimeSlotInterface[];
|
|
178
|
-
get weekLength(): number;
|
|
179
|
-
get weekendStartDay(): number;
|
|
180
|
-
/**
|
|
181
|
-
* Week days name
|
|
182
|
-
* @param weekDayNumber The current week day number (from: 0 - to: {@link weekLength} - 1).
|
|
183
|
-
* @returns The name of the week day.
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* (weekDayNumber: number) => {
|
|
187
|
-
* const weekDaysNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
188
|
-
* return weekDaysNames[weekDayNumber];
|
|
189
|
-
* }
|
|
190
|
-
* ```
|
|
191
|
-
*/
|
|
192
|
-
get getDayName(): ((weekDayNumber: number) => string) | undefined;
|
|
193
|
-
/**
|
|
194
|
-
* Get the current time. Time is a numeric variable used to determine and manage time during a day/date.
|
|
195
|
-
* 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.
|
|
196
|
-
*/
|
|
197
|
-
get currentTime(): number;
|
|
198
|
-
set currentTime(value: number | undefined);
|
|
199
|
-
/**
|
|
200
|
-
* Get the current date. Date is a numeric variable used to determine and manage the number of days passed.
|
|
201
|
-
* It's recommended to use currentDate as if it were the current day.
|
|
202
|
-
*/
|
|
203
|
-
get currentDate(): number;
|
|
204
|
-
set currentDate(value: number | undefined);
|
|
205
|
-
/**
|
|
206
|
-
* If the current day is greater than or equal to the weekend start day, then it will return true.
|
|
207
|
-
*/
|
|
208
|
-
get isWeekend(): boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Get the current week day number (from: 1 - to: {@link weekLength}).
|
|
211
|
-
* For example, if the week length is 7 and the current day is 10, then the result will be 4.
|
|
212
|
-
*/
|
|
213
|
-
get currentWeekDayNumber(): number;
|
|
214
|
-
/**
|
|
215
|
-
* Get the current week day name. If the week days names are not defined, then it will return undefined.
|
|
216
|
-
* 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'.
|
|
217
|
-
* @default ""
|
|
218
|
-
*/
|
|
219
|
-
get currentDayName(): string;
|
|
220
|
-
/**
|
|
221
|
-
* Get the current {@link timeSlots} index.
|
|
222
|
-
* You can use this property to create "Image that changes based on the time period":
|
|
223
|
-
* @example
|
|
224
|
-
* ```tsx
|
|
225
|
-
* import { weekLength } from '@drincs/nqtr';
|
|
226
|
-
*
|
|
227
|
-
* function changeBackground() {
|
|
228
|
-
* return (
|
|
229
|
-
* <img src={`background-currentTimeSlot.currentTimeSlot.png`} />
|
|
230
|
-
* )
|
|
231
|
-
* }
|
|
232
|
-
*/
|
|
233
|
-
get currentTimeSlot(): number;
|
|
234
|
-
/**
|
|
235
|
-
* This function will increase the current time by the given time spent.
|
|
236
|
-
* 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.
|
|
237
|
-
* @param delta is the time spent in times (default: {@link defaultTimeSpent})
|
|
238
|
-
* @returns currentTimeSlot.currentTime
|
|
239
|
-
*/
|
|
240
|
-
increaseTime(delta?: number): number;
|
|
241
|
-
/**
|
|
242
|
-
* This function will increase the current date by the given delta.
|
|
243
|
-
* @param delta is the number of days to increase (default: 1)
|
|
244
|
-
* @param time is the time of the new day (default: {@link dayStartTime})
|
|
245
|
-
* @returns timeTracker.currentDate
|
|
246
|
-
*/
|
|
247
|
-
increaseDate(delta?: number, time?: number): number;
|
|
248
|
-
/**
|
|
249
|
-
* This function will check if the current time is between the given times.
|
|
250
|
-
* @param fromTime the starting time. If the {@link currentTime} is equal to this time, the function will return true.
|
|
251
|
-
* @param toTime the ending time.
|
|
252
|
-
* @returns true if the current time is between the given times, otherwise false.
|
|
253
|
-
*/
|
|
254
|
-
nowIsBetween(fromTime: number | undefined, toTime: number | undefined): boolean;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
declare const timeTracker: TimeHandler;
|
|
258
|
-
declare const navigator: NavigatorHandler;
|
|
259
|
-
declare const routine: RoutineHandler;
|
|
260
|
-
declare const questsNotebook: QuestHandler;
|
|
261
|
-
|
|
262
|
-
declare const handlers_navigator: typeof navigator;
|
|
263
|
-
declare const handlers_questsNotebook: typeof questsNotebook;
|
|
264
|
-
declare const handlers_routine: typeof routine;
|
|
265
|
-
declare const handlers_timeTracker: typeof timeTracker;
|
|
266
|
-
declare namespace handlers {
|
|
267
|
-
export { handlers_navigator as navigator, handlers_questsNotebook as questsNotebook, handlers_routine as routine, handlers_timeTracker as timeTracker };
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export { type TimeSlotInterface as T, type TimeSettings as a, handlers as h, navigator as n, questsNotebook as q, routine as r, timeTracker as t };
|