@drincs/nqtr 0.1.0 → 0.1.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
@@ -48,62 +48,153 @@ interface ActivityProps {
48
48
  */
49
49
  icon?: GraphicItemType;
50
50
  }
51
+ /**
52
+ * The function that is called when the activity is runned.
53
+ */
54
+ type OnRunActivityEvent<T> = (activity: T, yourParams?: {
55
+ [key: string]: any;
56
+ }) => void;
51
57
  declare abstract class ActivityStoredAbstract {
52
- constructor(onRun: (activity: ActivityStoredAbstract) => void, props: ActivityProps);
58
+ /**
59
+ * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
60
+ * @param props The activity properties.
61
+ */
62
+ constructor(onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
53
63
  abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
54
64
  abstract getStorageProperty<T>(propertyName: string): T | undefined;
55
65
  abstract get id(): string;
56
66
  private defaultName?;
67
+ /**
68
+ * The name
69
+ */
57
70
  get name(): string;
58
71
  set name(value: string | undefined);
59
72
  private defaultFromHour?;
73
+ /**
74
+ * The hour when the activity starts. If the activity is not started yet, it will be hidden.
75
+ */
60
76
  get fromHour(): number;
61
77
  set fromHour(value: number | undefined);
62
78
  private defaultToHour?;
79
+ /**
80
+ * The hour when the activity ends. If the activity is ended yet, it will be hidden.
81
+ */
63
82
  get toHour(): number;
64
83
  set toHour(value: number | undefined);
65
84
  private defaultFromDay?;
85
+ /**
86
+ * The day when the activity starts. If the activity is not started yet, it will be hidden.
87
+ */
66
88
  get fromDay(): number | undefined;
67
89
  set fromDay(value: number | undefined);
68
90
  private defaultToDay?;
91
+ /**
92
+ * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
93
+ */
69
94
  get toDay(): number | undefined;
70
95
  set toDay(value: number | undefined);
71
96
  private defaultDisabled;
97
+ /**
98
+ * Whether is disabled.
99
+ */
72
100
  get disabled(): boolean;
73
101
  set disabled(value: boolean | string);
74
102
  private defaultHidden;
103
+ /**
104
+ * Whether is hidden. If the activity is not started yet, it will be hidden.
105
+ */
75
106
  get hidden(): boolean;
76
107
  set hidden(value: boolean | string);
77
108
  private _icon?;
109
+ /**
110
+ * The icon element.
111
+ */
78
112
  get icon(): GraphicItemType | undefined;
79
113
  private _onRun;
114
+ /**
115
+ * The function that is called when the activity is runned.
116
+ */
80
117
  get onRun(): () => void;
118
+ /**
119
+ * Whether the activity is a deadline.
120
+ * @returns Whether the activity is a deadline.
121
+ */
81
122
  isExpired(): boolean;
123
+ /**
124
+ * Export the activity properties.
125
+ * @returns The activity properties.
126
+ */
82
127
  export(): ActivityProps;
83
128
  }
129
+ /**
130
+ * The activity model.
131
+ */
84
132
  declare class ActivityModel {
85
- constructor(id: string, onRun: (activity: ActivityModel) => void, props: ActivityProps);
133
+ /**
134
+ * @param id The activity id, that must be unique.
135
+ * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
136
+ * @param props The activity properties.
137
+ */
138
+ constructor(id: string, onRun: OnRunActivityEvent<ActivityModel>, props: ActivityProps);
86
139
  private _id;
140
+ /**
141
+ * The activity id, that is unique.
142
+ */
87
143
  get id(): string;
88
144
  private _name?;
145
+ /**
146
+ * The name
147
+ */
89
148
  get name(): string | undefined;
90
149
  private _fromHour?;
150
+ /**
151
+ * The hour when the activity starts. If the activity is not started yet, it will be hidden.
152
+ */
91
153
  get fromHour(): number | undefined;
92
154
  private _toHour?;
155
+ /**
156
+ * The hour when the activity ends. If the activity is ended yet, it will be hidden.
157
+ */
93
158
  get toHour(): number | undefined;
94
159
  private _fromDay?;
160
+ /**
161
+ * The day when the activity starts. If the activity is not started yet, it will be hidden.
162
+ */
95
163
  get fromDay(): number | undefined;
96
164
  private _toDay?;
165
+ /**
166
+ * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
167
+ */
97
168
  get toDay(): number | undefined;
98
169
  private _disabled?;
170
+ /**
171
+ * Whether is disabled.
172
+ */
99
173
  get disabled(): boolean | undefined;
100
174
  private _hidden;
175
+ /**
176
+ * Whether is hidden. If the activity is not started yet, it will be hidden.
177
+ */
101
178
  get hidden(): boolean;
102
179
  private _icon?;
180
+ /**
181
+ * The icon element.
182
+ */
103
183
  get icon(): GraphicItemType | undefined;
104
184
  private _onRun;
185
+ /**
186
+ * The function that is called when the activity is runned.
187
+ */
105
188
  get onRun(): () => void;
189
+ /**
190
+ * Whether the activity is a deadline.
191
+ * @returns Whether the activity is a deadline.
192
+ */
106
193
  isDeadline(): boolean;
194
+ /**
195
+ * Export the activity properties.
196
+ * @returns The activity properties.
197
+ */
107
198
  export(): ActivityProps;
108
199
  }
109
200
 
@@ -138,16 +229,16 @@ interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
138
229
  * @example
139
230
  * ```ts
140
231
  * {
141
- * "north": atlantaMap,
142
- * "south": miamiMap,
143
- * "east": savannahMap,
144
- * "west": birminghamMap
232
+ * "north": "atlanta_map_id",
233
+ * "south": "miami_map_id",
234
+ * "east": "new_york_map_id",
235
+ * "west": "los_angeles_map_id"
145
236
  * }
146
237
  * ```
147
238
  * @default {}
148
239
  */
149
240
  neighboringMaps?: {
150
- [key: string]: TMap;
241
+ [key: string]: string;
151
242
  };
152
243
  /**
153
244
  * Whether is disabled. You can also pass a Pixi'VN flag name.
@@ -225,12 +316,18 @@ declare class MapBaseModel extends StoredClassModel {
225
316
  getLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[];
226
317
  }
227
318
 
319
+ /**
320
+ * The activity generated by the room.
321
+ */
228
322
  declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
229
- constructor(id: string, room: TRoom, onRun: (activity: ActivityStoredAbstract) => void, props: ActivityProps);
323
+ constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
230
324
  setStorageProperty<T>(_: string, __: T | undefined): void;
231
325
  getStorageProperty<T>(propertyName: string): T | undefined;
232
326
  private _id;
233
327
  get id(): string;
328
+ /**
329
+ * The room where the activity is.
330
+ */
234
331
  private _room;
235
332
  get room(): TRoom;
236
333
  export(): object;
@@ -802,19 +899,23 @@ type ITimeStlot = {
802
899
  */
803
900
  type TimeSettings = {
804
901
  /**
805
- * Minimum hour of the day (default: 0)
902
+ * Minimum hour of the day
903
+ * @default 0
806
904
  */
807
905
  minDayHours?: number;
808
906
  /**
809
- * Maximum hour of the day (default: 24)
907
+ * Maximum hour of the day
908
+ * @default 24
810
909
  */
811
910
  maxDayHours?: number;
812
911
  /**
813
- * Default time spent (default: 1)
912
+ * Default time spent
913
+ * @default 1
814
914
  */
815
915
  defaultTimeSpent?: number;
816
916
  /**
817
- * Time slots (default: [])
917
+ * Time slots
918
+ * @default []
818
919
  * @example
819
920
  * ```ts
820
921
  * [
@@ -826,15 +927,18 @@ type TimeSettings = {
826
927
  */
827
928
  timeSlots?: ITimeStlot[];
828
929
  /**
829
- * Week length (default: 7)
930
+ * Week length
931
+ * @default 7
830
932
  */
831
933
  weekLength?: number;
832
934
  /**
833
- * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6 (default: weekLength - 1)
935
+ * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6
936
+ * @default weekLength - 1
834
937
  */
835
938
  weekendStartDay?: number;
836
939
  /**
837
- * Week days names (default: [])
940
+ * Week days names
941
+ * @default []
838
942
  * @example
839
943
  * ```ts
840
944
  * ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
@@ -848,6 +952,7 @@ declare class TimeManager {
848
952
  private static editSettings;
849
953
  /**
850
954
  * Get time settings
955
+ * @default {}
851
956
  */
852
957
  static get settings(): TimeSettings;
853
958
  /**
@@ -883,8 +988,9 @@ declare class TimeManager {
883
988
  /**
884
989
  * Get the current week day name. If the week days names are not defined, then it will return undefined.
885
990
  * 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'.
991
+ * @default ""
886
992
  */
887
- static get currentDayName(): string | undefined;
993
+ static get currentDayName(): string;
888
994
  /**
889
995
  * Get the current TimeManager.timeSlots index.
890
996
  * You can use this property to create "Image that changes based on the time period":
package/dist/index.d.ts CHANGED
@@ -48,62 +48,153 @@ interface ActivityProps {
48
48
  */
49
49
  icon?: GraphicItemType;
50
50
  }
51
+ /**
52
+ * The function that is called when the activity is runned.
53
+ */
54
+ type OnRunActivityEvent<T> = (activity: T, yourParams?: {
55
+ [key: string]: any;
56
+ }) => void;
51
57
  declare abstract class ActivityStoredAbstract {
52
- constructor(onRun: (activity: ActivityStoredAbstract) => void, props: ActivityProps);
58
+ /**
59
+ * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
60
+ * @param props The activity properties.
61
+ */
62
+ constructor(onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
53
63
  abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
54
64
  abstract getStorageProperty<T>(propertyName: string): T | undefined;
55
65
  abstract get id(): string;
56
66
  private defaultName?;
67
+ /**
68
+ * The name
69
+ */
57
70
  get name(): string;
58
71
  set name(value: string | undefined);
59
72
  private defaultFromHour?;
73
+ /**
74
+ * The hour when the activity starts. If the activity is not started yet, it will be hidden.
75
+ */
60
76
  get fromHour(): number;
61
77
  set fromHour(value: number | undefined);
62
78
  private defaultToHour?;
79
+ /**
80
+ * The hour when the activity ends. If the activity is ended yet, it will be hidden.
81
+ */
63
82
  get toHour(): number;
64
83
  set toHour(value: number | undefined);
65
84
  private defaultFromDay?;
85
+ /**
86
+ * The day when the activity starts. If the activity is not started yet, it will be hidden.
87
+ */
66
88
  get fromDay(): number | undefined;
67
89
  set fromDay(value: number | undefined);
68
90
  private defaultToDay?;
91
+ /**
92
+ * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
93
+ */
69
94
  get toDay(): number | undefined;
70
95
  set toDay(value: number | undefined);
71
96
  private defaultDisabled;
97
+ /**
98
+ * Whether is disabled.
99
+ */
72
100
  get disabled(): boolean;
73
101
  set disabled(value: boolean | string);
74
102
  private defaultHidden;
103
+ /**
104
+ * Whether is hidden. If the activity is not started yet, it will be hidden.
105
+ */
75
106
  get hidden(): boolean;
76
107
  set hidden(value: boolean | string);
77
108
  private _icon?;
109
+ /**
110
+ * The icon element.
111
+ */
78
112
  get icon(): GraphicItemType | undefined;
79
113
  private _onRun;
114
+ /**
115
+ * The function that is called when the activity is runned.
116
+ */
80
117
  get onRun(): () => void;
118
+ /**
119
+ * Whether the activity is a deadline.
120
+ * @returns Whether the activity is a deadline.
121
+ */
81
122
  isExpired(): boolean;
123
+ /**
124
+ * Export the activity properties.
125
+ * @returns The activity properties.
126
+ */
82
127
  export(): ActivityProps;
83
128
  }
129
+ /**
130
+ * The activity model.
131
+ */
84
132
  declare class ActivityModel {
85
- constructor(id: string, onRun: (activity: ActivityModel) => void, props: ActivityProps);
133
+ /**
134
+ * @param id The activity id, that must be unique.
135
+ * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
136
+ * @param props The activity properties.
137
+ */
138
+ constructor(id: string, onRun: OnRunActivityEvent<ActivityModel>, props: ActivityProps);
86
139
  private _id;
140
+ /**
141
+ * The activity id, that is unique.
142
+ */
87
143
  get id(): string;
88
144
  private _name?;
145
+ /**
146
+ * The name
147
+ */
89
148
  get name(): string | undefined;
90
149
  private _fromHour?;
150
+ /**
151
+ * The hour when the activity starts. If the activity is not started yet, it will be hidden.
152
+ */
91
153
  get fromHour(): number | undefined;
92
154
  private _toHour?;
155
+ /**
156
+ * The hour when the activity ends. If the activity is ended yet, it will be hidden.
157
+ */
93
158
  get toHour(): number | undefined;
94
159
  private _fromDay?;
160
+ /**
161
+ * The day when the activity starts. If the activity is not started yet, it will be hidden.
162
+ */
95
163
  get fromDay(): number | undefined;
96
164
  private _toDay?;
165
+ /**
166
+ * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
167
+ */
97
168
  get toDay(): number | undefined;
98
169
  private _disabled?;
170
+ /**
171
+ * Whether is disabled.
172
+ */
99
173
  get disabled(): boolean | undefined;
100
174
  private _hidden;
175
+ /**
176
+ * Whether is hidden. If the activity is not started yet, it will be hidden.
177
+ */
101
178
  get hidden(): boolean;
102
179
  private _icon?;
180
+ /**
181
+ * The icon element.
182
+ */
103
183
  get icon(): GraphicItemType | undefined;
104
184
  private _onRun;
185
+ /**
186
+ * The function that is called when the activity is runned.
187
+ */
105
188
  get onRun(): () => void;
189
+ /**
190
+ * Whether the activity is a deadline.
191
+ * @returns Whether the activity is a deadline.
192
+ */
106
193
  isDeadline(): boolean;
194
+ /**
195
+ * Export the activity properties.
196
+ * @returns The activity properties.
197
+ */
107
198
  export(): ActivityProps;
108
199
  }
109
200
 
@@ -138,16 +229,16 @@ interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
138
229
  * @example
139
230
  * ```ts
140
231
  * {
141
- * "north": atlantaMap,
142
- * "south": miamiMap,
143
- * "east": savannahMap,
144
- * "west": birminghamMap
232
+ * "north": "atlanta_map_id",
233
+ * "south": "miami_map_id",
234
+ * "east": "new_york_map_id",
235
+ * "west": "los_angeles_map_id"
145
236
  * }
146
237
  * ```
147
238
  * @default {}
148
239
  */
149
240
  neighboringMaps?: {
150
- [key: string]: TMap;
241
+ [key: string]: string;
151
242
  };
152
243
  /**
153
244
  * Whether is disabled. You can also pass a Pixi'VN flag name.
@@ -225,12 +316,18 @@ declare class MapBaseModel extends StoredClassModel {
225
316
  getLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[];
226
317
  }
227
318
 
319
+ /**
320
+ * The activity generated by the room.
321
+ */
228
322
  declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
229
- constructor(id: string, room: TRoom, onRun: (activity: ActivityStoredAbstract) => void, props: ActivityProps);
323
+ constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
230
324
  setStorageProperty<T>(_: string, __: T | undefined): void;
231
325
  getStorageProperty<T>(propertyName: string): T | undefined;
232
326
  private _id;
233
327
  get id(): string;
328
+ /**
329
+ * The room where the activity is.
330
+ */
234
331
  private _room;
235
332
  get room(): TRoom;
236
333
  export(): object;
@@ -802,19 +899,23 @@ type ITimeStlot = {
802
899
  */
803
900
  type TimeSettings = {
804
901
  /**
805
- * Minimum hour of the day (default: 0)
902
+ * Minimum hour of the day
903
+ * @default 0
806
904
  */
807
905
  minDayHours?: number;
808
906
  /**
809
- * Maximum hour of the day (default: 24)
907
+ * Maximum hour of the day
908
+ * @default 24
810
909
  */
811
910
  maxDayHours?: number;
812
911
  /**
813
- * Default time spent (default: 1)
912
+ * Default time spent
913
+ * @default 1
814
914
  */
815
915
  defaultTimeSpent?: number;
816
916
  /**
817
- * Time slots (default: [])
917
+ * Time slots
918
+ * @default []
818
919
  * @example
819
920
  * ```ts
820
921
  * [
@@ -826,15 +927,18 @@ type TimeSettings = {
826
927
  */
827
928
  timeSlots?: ITimeStlot[];
828
929
  /**
829
- * Week length (default: 7)
930
+ * Week length
931
+ * @default 7
830
932
  */
831
933
  weekLength?: number;
832
934
  /**
833
- * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6 (default: weekLength - 1)
935
+ * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6
936
+ * @default weekLength - 1
834
937
  */
835
938
  weekendStartDay?: number;
836
939
  /**
837
- * Week days names (default: [])
940
+ * Week days names
941
+ * @default []
838
942
  * @example
839
943
  * ```ts
840
944
  * ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
@@ -848,6 +952,7 @@ declare class TimeManager {
848
952
  private static editSettings;
849
953
  /**
850
954
  * Get time settings
955
+ * @default {}
851
956
  */
852
957
  static get settings(): TimeSettings;
853
958
  /**
@@ -883,8 +988,9 @@ declare class TimeManager {
883
988
  /**
884
989
  * Get the current week day name. If the week days names are not defined, then it will return undefined.
885
990
  * 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'.
991
+ * @default ""
886
992
  */
887
- static get currentDayName(): string | undefined;
993
+ static get currentDayName(): string;
888
994
  /**
889
995
  * Get the current TimeManager.timeSlots index.
890
996
  * You can use this property to create "Image that changes based on the time period":