@drincs/pixi-vn 1.8.4 → 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/ContainerMemory-BjcfYRU7.d.cts +392 -0
  2. package/dist/ContainerMemory-BjcfYRU7.d.ts +392 -0
  3. package/dist/HistoryChoiceMenuOption-CEmjDDJH.d.cts +53 -0
  4. package/dist/HistoryChoiceMenuOption-CN7NkcxU.d.ts +53 -0
  5. package/dist/HistoryGameState-3ztYdv84.d.cts +12 -0
  6. package/dist/HistoryGameState-D4t2fY9x.d.ts +12 -0
  7. package/dist/HistoryStep-DtOryKAZ.d.cts +76 -0
  8. package/dist/HistoryStep-DtOryKAZ.d.ts +76 -0
  9. package/dist/OpenedLabel-DJby8qPc.d.ts +8 -0
  10. package/dist/OpenedLabel-t6PvSzaL.d.cts +8 -0
  11. package/dist/SoundManagerInterface-TgOPqm2L.d.cts +436 -0
  12. package/dist/SoundManagerInterface-TgOPqm2L.d.ts +436 -0
  13. package/dist/StepLabelType-CN97wZzm.d.cts +27 -0
  14. package/dist/StepLabelType-CN97wZzm.d.ts +27 -0
  15. package/dist/StorageGameState-BJy57o6K.d.ts +27 -0
  16. package/dist/StorageGameState-CtjNJpvE.d.cts +27 -0
  17. package/dist/{StoredClassModel-C9mQxPg-.d.cts → StoredClassModel-Bykjdn8S.d.cts} +1 -1
  18. package/dist/{StoredClassModel-upXPNQTp.d.ts → StoredClassModel-uMifeNzV.d.ts} +1 -1
  19. package/dist/canvas.cjs +2 -2
  20. package/dist/canvas.d.cts +54 -464
  21. package/dist/canvas.d.ts +54 -464
  22. package/dist/canvas.mjs +2 -2
  23. package/dist/characters.cjs +1 -1
  24. package/dist/characters.d.cts +5 -5
  25. package/dist/characters.d.ts +5 -5
  26. package/dist/characters.mjs +1 -1
  27. package/dist/chunk-3GXLF557.mjs +1 -0
  28. package/dist/chunk-F3AVLCQB.mjs +1 -0
  29. package/dist/{chunk-YCWXA3OR.mjs → chunk-PZ55RNCZ.mjs} +1 -1
  30. package/dist/chunk-UK6MT3QS.mjs +1 -0
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.d.cts +5 -114
  33. package/dist/core.d.ts +5 -114
  34. package/dist/core.mjs +1 -1
  35. package/dist/history.cjs +1 -1
  36. package/dist/history.d.cts +7 -11
  37. package/dist/history.d.ts +7 -11
  38. package/dist/history.mjs +1 -1
  39. package/dist/index.cjs +2 -2
  40. package/dist/index.d.cts +20 -826
  41. package/dist/index.d.ts +20 -826
  42. package/dist/index.mjs +2 -2
  43. package/dist/motion.cjs +1 -1
  44. package/dist/motion.mjs +1 -1
  45. package/dist/narration.cjs +2 -2
  46. package/dist/narration.d.cts +57 -22
  47. package/dist/narration.d.ts +57 -22
  48. package/dist/narration.mjs +2 -2
  49. package/dist/pixi/index.d.cts +12 -0
  50. package/dist/sound.cjs +1 -1
  51. package/dist/sound.d.cts +4 -435
  52. package/dist/sound.d.ts +4 -435
  53. package/dist/sound.mjs +1 -1
  54. package/dist/storage.cjs +1 -1
  55. package/dist/storage.d.cts +4 -27
  56. package/dist/storage.d.ts +4 -27
  57. package/dist/storage.mjs +1 -1
  58. package/dist/vite-listener.d.cts +1 -1
  59. package/dist/vite-listener.d.ts +1 -1
  60. package/dist/vite-listener.mjs +1 -1
  61. package/dist/vite.d.cts +1 -1
  62. package/dist/vite.d.ts +1 -1
  63. package/dist/vite.mjs +1 -1
  64. package/package.json +1 -1
  65. package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
  66. package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
  67. package/dist/chunk-K7JIC2F2.mjs +0 -1
  68. package/dist/chunk-V34PMA2H.mjs +0 -1
  69. package/dist/chunk-Z4GZCINS.mjs +0 -1
@@ -0,0 +1,392 @@
1
+ import { UPDATE_PRIORITY, PointData, Container, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
2
+
3
+ interface TickerArgs {
4
+ }
5
+
6
+ interface Ticker<TArgs extends TickerArgs> {
7
+ /**
8
+ * Arguments to pass to the ticker
9
+ */
10
+ args: TArgs;
11
+ /**
12
+ * Duration in seconds to run the ticker
13
+ */
14
+ duration?: number;
15
+ /**
16
+ * Priority of the ticker
17
+ */
18
+ priority?: UPDATE_PRIORITY;
19
+ /**
20
+ * Get the alias of the ticker class. This variable is used in the system to get the ticker class by id, {@link RegisteredTickers.getInstance}
21
+ */
22
+ readonly alias: string;
23
+ /**
24
+ * The id of the ticker. Must be unique for each ticker instance.
25
+ */
26
+ readonly id: string;
27
+ /**
28
+ * The aliases of the canvas elements that are connected to this ticker
29
+ */
30
+ canvasElementAliases: string[];
31
+ /**
32
+ * Completes the animation and applies the final state.
33
+ */
34
+ complete: (options?: {
35
+ ignoreTickerSteps?: boolean;
36
+ }) => Promise<void> | void;
37
+ /**
38
+ * Stops the animation at its current state, and prevents it from resuming when the animation is played again.
39
+ */
40
+ stop: () => void;
41
+ /**
42
+ * Starts the ticker. This will start the ticker and begin the animation.
43
+ */
44
+ start: () => void;
45
+ /**
46
+ * Pauses the animation.
47
+ */
48
+ pause: () => void;
49
+ /**
50
+ * Plays the animation.
51
+ */
52
+ play: () => void;
53
+ /**
54
+ * Checks if the ticker is paused.
55
+ * @returns true if the ticker is paused, false otherwise.
56
+ */
57
+ readonly paused: boolean;
58
+ }
59
+
60
+ /**
61
+ * TickerHistory is a class that contains the name of a class and the arguments that were used to create it.
62
+ */
63
+ interface TickerInfo<TArgs extends TickerArgs> {
64
+ /**
65
+ * If this ticker was created by steps
66
+ */
67
+ createdByTicketSteps?: {
68
+ canvasElementAlias: string;
69
+ id: string;
70
+ };
71
+ ticker: Ticker<TArgs>;
72
+ }
73
+ interface TickerHistory<TArgs extends TickerArgs> {
74
+ id: string;
75
+ args: TArgs;
76
+ /**
77
+ * The aliases of the canvas elements that are connected to this ticker
78
+ */
79
+ canvasElementAliases: string[];
80
+ priority?: UPDATE_PRIORITY;
81
+ duration?: number;
82
+ paused?: boolean;
83
+ }
84
+
85
+ type PauseType = {
86
+ /**
87
+ * The type of the value
88
+ */
89
+ type: "pause";
90
+ /**
91
+ * Duration in seconds
92
+ */
93
+ duration: number;
94
+ };
95
+
96
+ type RepeatType = "repeat";
97
+
98
+ interface TickersStep<TArgs extends TickerArgs> {
99
+ /**
100
+ * Ticker class name
101
+ */
102
+ ticker: string;
103
+ /**
104
+ * Duration in seconds. If is undefined, the step will end only when the animation is finished.
105
+ */
106
+ duration?: number;
107
+ /**
108
+ * Arguments to pass to the ticker
109
+ */
110
+ args: TArgs;
111
+ /**
112
+ * Priority of the ticker
113
+ */
114
+ priority?: UPDATE_PRIORITY;
115
+ }
116
+ /**
117
+ * The steps of the tickers
118
+ */
119
+ interface TickersSequence {
120
+ /**
121
+ * The step number
122
+ */
123
+ currentStepNumber: number;
124
+ /**
125
+ * The steps of the tickers
126
+ */
127
+ steps: (TickersStep<any> | RepeatType | PauseType)[];
128
+ }
129
+
130
+ /**
131
+ * This class is used to create a canvas element to add into a Pixi Application.
132
+ * You can use {@link canvas.add()} to add this element into the application.
133
+ * This class should be implemented and the memory method should be overridden.
134
+ * You must use the {@link canvasComponentDecorator} to register the canvas in the game.
135
+ * In Ren'Py is a displayable.
136
+ * @example
137
+ * ```ts
138
+ * const CANVAS_EXAMPLE_ID = "CanvasExample";
139
+ *
140
+ * \@canvasComponentDecorator({
141
+ * name: CANVAS_EXAMPLE_ID,
142
+ * })
143
+ * export class CanvasExample extends Container implements CanvasBaseItem<Memory> {
144
+ * get memory(): Memory {
145
+ * return {
146
+ * pixivnId: CANVAS_EXAMPLE_ID,
147
+ * // ... other properties
148
+ * }
149
+ * }
150
+ * async setMemory(value: Memory) {
151
+ * // ... set other properties
152
+ * }
153
+ * }
154
+ * ```
155
+ */
156
+ declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
157
+ constructor(..._options: any);
158
+ /**
159
+ * This method return the memory of the canvas element.
160
+ * @throws {PixiError} when the method is not overridden in the subclass.
161
+ */
162
+ get memory(): T2;
163
+ /**
164
+ * This method set the memory of the canvas element.
165
+ * @throws {PixiError} when the method is not overridden in the subclass.
166
+ */
167
+ setMemory(_value: T2): Promise<void> | void;
168
+ /**
169
+ * Get the id of the canvas element. This variable is used in the system to get the canvas element by id
170
+ */
171
+ pixivnId: string;
172
+ }
173
+
174
+ /**
175
+ * Interface for the canvas base memory
176
+ */
177
+ interface CanvasBaseItemMemory {
178
+ pixivnId: string;
179
+ /**
180
+ * The index of the container in its parent, if it has one
181
+ */
182
+ index?: number;
183
+ /**
184
+ * The label of the parent container, if it has one
185
+ */
186
+ parentLabel?: string;
187
+ label?: string;
188
+ zIndex?: number;
189
+ }
190
+
191
+ /**
192
+ * Interface exported canvas
193
+ */
194
+ interface CanvasGameState {
195
+ tickers: {
196
+ [id: string]: TickerHistory<any>;
197
+ };
198
+ tickersSteps: {
199
+ [alias: string]: {
200
+ [tickerId: string]: TickersSequence;
201
+ };
202
+ };
203
+ elements: {
204
+ [alias: string]: CanvasBaseItemMemory;
205
+ };
206
+ stage: Partial<ContainerMemory>;
207
+ /**
208
+ * @deprecated
209
+ */
210
+ elementAliasesOrder: string[];
211
+ tickersToCompleteOnStepEnd: {
212
+ tikersIds: {
213
+ id: string;
214
+ }[];
215
+ stepAlias: {
216
+ id: string;
217
+ alias: string;
218
+ }[];
219
+ };
220
+ }
221
+
222
+ interface AdditionalPositionsExtensionProps {
223
+ /**
224
+ * is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
225
+ * For example:
226
+ * - if you set align to 0.5, the element will be in the center of the canvas.
227
+ * - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
228
+ * - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
229
+ *
230
+ * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
231
+ */
232
+ align?: Partial<PointData> | number;
233
+ /**
234
+ * is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
235
+ * For example:
236
+ * - if you set align to 0.5, the element will be in the center of the canvas.
237
+ * - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
238
+ * - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
239
+ *
240
+ * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
241
+ */
242
+ xAlign?: number;
243
+ /**
244
+ * is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
245
+ * For example:
246
+ * - if you set align to 0.5, the element will be in the center of the canvas.
247
+ * - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
248
+ * - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
249
+ *
250
+ * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
251
+ */
252
+ yAlign?: number;
253
+ /**
254
+ * is a way to set the position of the element in the canvas calculated in percentage.
255
+ * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
256
+ * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
257
+ * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
258
+ * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
259
+ *
260
+ * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
261
+ */
262
+ percentagePosition?: Partial<PointData> | number;
263
+ /**
264
+ * is a way to set the position of the element in the canvas calculated in percentage.
265
+ * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
266
+ * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
267
+ * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
268
+ * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
269
+ *
270
+ * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
271
+ */
272
+ percentageX?: number;
273
+ /**
274
+ * is a way to set the position of the element in the canvas calculated in percentage.
275
+ * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
276
+ * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
277
+ * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
278
+ * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
279
+ *
280
+ * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
281
+ */
282
+ percentageY?: number;
283
+ }
284
+ interface AdditionalPositionsExtension {
285
+ /**
286
+ * is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
287
+ * For example:
288
+ * - if you set align to 0.5, the element will be in the center of the canvas.
289
+ * - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
290
+ * - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
291
+ *
292
+ * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
293
+ */
294
+ align: Partial<PointData> | number;
295
+ /**
296
+ * is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
297
+ * For example:
298
+ * - if you set align to 0.5, the element will be in the center of the canvas.
299
+ * - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
300
+ * - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
301
+ *
302
+ * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
303
+ */
304
+ xAlign: number;
305
+ /**
306
+ * is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
307
+ * For example:
308
+ * - if you set align to 0.5, the element will be in the center of the canvas.
309
+ * - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
310
+ * - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
311
+ *
312
+ * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
313
+ */
314
+ yAlign: number;
315
+ /**
316
+ * is a way to set the position of the element in the canvas calculated in percentage.
317
+ * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
318
+ * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
319
+ * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
320
+ * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
321
+ *
322
+ * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
323
+ */
324
+ percentagePosition: Partial<PointData> | number;
325
+ /**
326
+ * is a way to set the position of the element in the canvas calculated in percentage.
327
+ * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
328
+ * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
329
+ * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
330
+ * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
331
+ *
332
+ * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
333
+ */
334
+ percentageX: number;
335
+ /**
336
+ * is a way to set the position of the element in the canvas calculated in percentage.
337
+ * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
338
+ * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
339
+ * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
340
+ * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
341
+ *
342
+ * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
343
+ */
344
+ percentageY: number;
345
+ readonly positionType: "pixel" | "percentage" | "align";
346
+ readonly positionInfo: {
347
+ x: number;
348
+ y: number;
349
+ type: "pixel" | "percentage" | "align";
350
+ };
351
+ }
352
+ declare function analizePositionsExtensionProps<T extends AdditionalPositionsExtensionProps>(props?: T): T | undefined;
353
+
354
+ type ContainerChild = Container & CanvasBaseItem<any>;
355
+
356
+ interface ListenerExtensionMemory {
357
+ onEvents?: OnEventsHandlers;
358
+ }
359
+ interface OnEventsHandlers {
360
+ [name: string]: string;
361
+ }
362
+ interface ListenerExtension {
363
+ /**
364
+ * Add a listener for a given event.
365
+ * @example
366
+ * ```ts
367
+ * export class Events {
368
+ * \@eventDecorator()
369
+ * static eventExample(event: FederatedEvent, component: Sprite) {
370
+ * // event code here
371
+ * }
372
+ * }
373
+ *
374
+ * sprite.on("pointerdown", Events.eventExample);
375
+ * ```
376
+ */
377
+ on: Container["on"];
378
+ readonly onEventsHandlers: OnEventsHandlers;
379
+ }
380
+ declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn: (...args: never[]) => unknown): boolean;
381
+
382
+ /**
383
+ * Interface for the canvas container memory
384
+ */
385
+ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends ContainerOptions<C>, CanvasBaseItemMemory, ListenerExtensionMemory, AdditionalPositionsExtensionProps {
386
+ /**
387
+ * The elements contained in this container
388
+ */
389
+ elements: CanvasBaseItemMemory[];
390
+ }
391
+
392
+ export { type AdditionalPositionsExtension as A, CanvasBaseItem as C, type ListenerExtension as L, type OnEventsHandlers as O, type PauseType as P, type RepeatType as R, type Ticker as T, type AdditionalPositionsExtensionProps as a, type CanvasBaseItemMemory as b, type CanvasGameState as c, type ContainerChild as d, type ContainerMemory as e, type ListenerExtensionMemory as f, type TickerArgs as g, type TickerHistory as h, type TickerInfo as i, type TickersSequence as j, addListenerHandler as k, analizePositionsExtensionProps as l };