@drincs/pixi-vn 1.8.4 → 1.8.7

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 (64) 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-Z4GZCINS.mjs → chunk-3M6A7TU2.mjs} +1 -1
  28. package/dist/chunk-BQRPDCUT.mjs +1 -0
  29. package/dist/{chunk-YCWXA3OR.mjs → chunk-IFPF4NRX.mjs} +1 -1
  30. package/dist/core.cjs +1 -1
  31. package/dist/core.d.cts +5 -114
  32. package/dist/core.d.ts +5 -114
  33. package/dist/core.mjs +1 -1
  34. package/dist/history.cjs +1 -1
  35. package/dist/history.d.cts +7 -11
  36. package/dist/history.d.ts +7 -11
  37. package/dist/history.mjs +1 -1
  38. package/dist/index.cjs +2 -2
  39. package/dist/index.d.cts +20 -826
  40. package/dist/index.d.ts +20 -826
  41. package/dist/index.mjs +2 -2
  42. package/dist/motion.cjs +1 -1
  43. package/dist/motion.mjs +1 -1
  44. package/dist/narration.cjs +1 -1
  45. package/dist/narration.d.cts +57 -22
  46. package/dist/narration.d.ts +57 -22
  47. package/dist/narration.mjs +1 -1
  48. package/dist/pixi/index.d.cts +12 -0
  49. package/dist/sound.cjs +1 -1
  50. package/dist/sound.d.cts +4 -435
  51. package/dist/sound.d.ts +4 -435
  52. package/dist/sound.mjs +1 -1
  53. package/dist/storage.cjs +1 -1
  54. package/dist/storage.d.cts +4 -27
  55. package/dist/storage.d.ts +4 -27
  56. package/dist/storage.mjs +1 -1
  57. package/dist/vite-listener.d.cts +1 -1
  58. package/dist/vite-listener.d.ts +1 -1
  59. package/dist/vite.d.cts +1 -1
  60. package/dist/vite.d.ts +1 -1
  61. package/package.json +1 -1
  62. package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
  63. package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
  64. package/dist/chunk-V34PMA2H.mjs +0 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { PlayerOptions, Player, ToneAudioNode, Param, ReverbOptions, FeedbackDelayOptions, FreeverbOptions, DelayOptions, PingPongDelayOptions, GateOptions, AutoFilterOptions, BiquadFilterOptions, OnePoleFilterOptions, FeedbackCombFilterOptions, FilterOptions, ChorusOptions, PhaserOptions, TremoloOptions, VibratoOptions, CompressorOptions, MidSideCompressorOptions, MultibandCompressorOptions, LimiterOptions, GreaterThanOptions, GreaterThanZeroOptions, DistortionOptions, BitCrusherOptions, Panner3DOptions, AutoPannerOptions, StereoWidenerOptions } from 'tone';
1
+ import { S as SoundGameState, c as SoundManagerInterface } from './SoundManagerInterface-TgOPqm2L.js';
2
2
  import * as canvasUtils from '@drincs/pixi-vn/canvas';
3
- import { StoredChoiceInterface, StorageElementType as StorageElementType$1, OpenedLabel as OpenedLabel$1 } from '@drincs/pixi-vn/canvas';
4
3
  export * from '@drincs/pixi-vn/canvas';
5
4
  import * as characterUtils from '@drincs/pixi-vn/characters';
6
5
  export * from '@drincs/pixi-vn/characters';
@@ -11,705 +10,26 @@ export * from '@drincs/pixi-vn/history';
11
10
  import * as narrationUtils from '@drincs/pixi-vn/narration';
12
11
  import { NarrationGameState } from '@drincs/pixi-vn/narration';
13
12
  export * from '@drincs/pixi-vn/narration';
14
- import { UPDATE_PRIORITY, PointData, Container, ContainerOptions, ApplicationOptions } from '@drincs/pixi-vn/pixi.js';
13
+ import { ApplicationOptions } from '@drincs/pixi-vn/pixi.js';
15
14
  export { AllFederatedEventMap, ApplicationOptions, AssetSrc, AssetsBundle, AssetsManifest, FederatedEvent, LoadParserName, ResolvedAsset, ResolvedSrc, UnresolvedAsset } from '@drincs/pixi-vn/pixi.js';
16
15
  import * as soundUtils from '@drincs/pixi-vn/sound';
17
16
  export * from '@drincs/pixi-vn/sound';
18
17
  import * as storageUtils from '@drincs/pixi-vn/storage';
19
18
  export * from '@drincs/pixi-vn/storage';
20
- import { LRUCache } from 'lru-cache';
21
- import { CharacterInterface, GameStepState } from '@drincs/pixi-vn';
22
- import { Difference } from 'microdiff';
19
+ export { C as CachedMap } from './CachedMap-DZLvJAnA.js';
20
+ import { P as PauseType, R as RepeatType, c as CanvasGameState } from './ContainerMemory-BjcfYRU7.js';
21
+ import { H as HistoryGameState } from './HistoryGameState-D4t2fY9x.js';
22
+ import { S as StorageGameState } from './StorageGameState-BJy57o6K.js';
23
+ import { O as OpenedLabel } from './OpenedLabel-DJby8qPc.js';
23
24
  import { Devtools } from '@pixi/devtools';
25
+ import 'tone';
26
+ import 'lru-cache';
27
+ import '@drincs/pixi-vn';
28
+ import './HistoryStep-DtOryKAZ.js';
29
+ import 'microdiff';
30
+ import './StorageElementType-C7ETezlL.js';
24
31
 
25
- interface MediaInterface extends Pick<Player, "blockTime" | "disposed" | "loaded" | "loop" | "loopEnd" | "loopStart" | "mute" | "now" | "playbackRate" | "reverse" | "restart" | "start" | "stop" | "chain" | "disconnect" | "volume" | "state"> {
26
- /**
27
- * Whether the sound is currently paused.
28
- */
29
- paused: boolean;
30
- /**
31
- * @deprecated Use {@link mute} instead.
32
- */
33
- muted: boolean;
34
- /**
35
- * @deprecated Use {@link playbackRate} instead.
36
- */
37
- speed: number;
38
- }
39
- interface MediaMemory extends Partial<Omit<PlayerOptions, "url" | "volume">> {
40
- /**
41
- * The volume of this sound in the linear range [0, 1], where 0 is silence
42
- * and 1 is full volume. Stored and restored in linear form; converted
43
- * to/from Tone.js decibels internally.
44
- */
45
- volume?: number;
46
- elapsed: number | undefined;
47
- paused: boolean;
48
- delay?: number;
49
- }
50
-
51
- interface SoundOptions extends Pick<Partial<PlayerOptions>, "loop" | "autostart" | "fadeIn" | "fadeOut" | "mute" | "loopEnd" | "loopStart" | "reverse" | "playbackRate"> {
52
- /**
53
- * The volume of this sound in the linear range [0, 1], where 0 is silence
54
- * and 1 is full volume. This is converted to decibels internally before
55
- * being passed to the Tone.js Player.
56
- */
57
- volume?: number;
58
- /**
59
- * A collection of audio filters/effects to apply to this sound.
60
- *
61
- * Install "tone" for the full list of available filters.
62
- *
63
- * @example
64
- * ```ts
65
- * import * as Tone from "tone";
66
- *
67
- * const filters = [new Tone.FeedbackDelay("8n", 0.5)];
68
- * ```
69
- */
70
- filters?: ToneAudioNode[];
71
- /**
72
- * @deprecated Use {@link playbackRate} instead.
73
- */
74
- speed?: number;
75
- /**
76
- * @deprecated Use {@link mute} instead.
77
- */
78
- muted?: boolean;
79
- }
80
- interface SoundPlayOptions extends SoundOptions {
81
- /**
82
- * The delay in seconds before playback starts. If specified, playback is
83
- * scheduled to begin after the delay has elapsed rather than starting
84
- * immediately in a paused state.
85
- */
86
- delay?: number;
87
- /**
88
- * The offset in seconds from the start of the sound at which to begin playback.
89
- */
90
- elapsed?: number;
91
- }
92
- interface SoundPlayOptionsWithChannel extends SoundPlayOptions {
93
- /**
94
- * The alias of the audio channel to play the sound on. If the channel does
95
- * not exist it will be created automatically.
96
- * Defaults to `SoundManagerInterface.defaultChannelAlias` ("general").
97
- */
98
- channel?: string;
99
- }
100
- interface ChannelOptions extends Pick<SoundPlayOptions, "filters" | "muted" | "volume"> {
101
- /**
102
- * Whether this channel is a background channel.
103
- * Background channels are special: media playing on them is not stopped
104
- * when a scene changes, but continues in the background.
105
- */
106
- background?: boolean;
107
- /**
108
- * The stereo pan position for this channel in the range [-1, 1].
109
- * -1 is full left, 0 is centre, 1 is full right.
110
- * Defaults to 0.
111
- */
112
- pan?: number;
113
- }
114
-
115
- interface AudioChannelInterface {
116
- /**
117
- * The alias of the audio channel. This is used to reference the channel when playing sounds. The alias must be unique among all channels.
118
- */
119
- readonly alias: string;
120
- /**
121
- * Plays a sound.
122
- * @param alias The media and sound (asset) alias reference.
123
- * @param options The options
124
- * @return The sound instance,
125
- * this cannot be reused after it is done playing. Returns a Promise if the sound
126
- * has not yet loaded.
127
- */
128
- play(alias: string, options?: SoundPlayOptions): Promise<MediaInterface>;
129
- /**
130
- * Plays a sound.
131
- * @param mediaAlias The media alias reference.
132
- * @param soundAlias The sound (asset) alias reference.
133
- * @param options The options
134
- * @return The sound instance,
135
- * this cannot be reused after it is done playing. Returns a Promise if the sound
136
- * has not yet loaded.
137
- */
138
- play(mediaAlias: string, soundAlias: string, options?: SoundPlayOptions): Promise<MediaInterface>;
139
- /**
140
- * The stereo pan position for this channel in the range [-1, 1].
141
- * -1 is full left, 0 is centre, 1 is full right.
142
- */
143
- pan: number;
144
- /**
145
- * The volume of the audio channel, between 0 and 1. This is multiplied with the volume of each sound played through this channel.
146
- */
147
- volume: number;
148
- /**
149
- * Whether the audio channel is muted. This is combined with the muted state of each sound played through this channel.
150
- */
151
- muted: boolean;
152
- /**
153
- * The MediaInstances currently playing through this channel. This is read-only and cannot be modified directly. Use the play method to add new MediaInstances to this channel.
154
- */
155
- readonly mediaInstances: MediaInterface[];
156
- /**
157
- * Whether this channel is a background channel.
158
- * Background channels are special channels. Unlike normal channels, media connected to a background channel does not stop when a scene changes, but continues to play in the background.
159
- */
160
- readonly background: boolean;
161
- /**
162
- * Stops all media currently playing through this channel.
163
- * @return Instance for chaining.
164
- */
165
- stopAll(): this;
166
- /**
167
- * Pauses any playing sounds.
168
- * @return Instance for chaining.
169
- */
170
- pauseAll(): this;
171
- /**
172
- * Resumes any sounds.
173
- * @return Instance for chaining.
174
- */
175
- resumeAll(): this;
176
- /**
177
- * Toggle muted property for all sounds.
178
- * @return `true` if all sounds are muted.
179
- */
180
- toggleMuteAll(): boolean;
181
- /**
182
- * Useful for inserting channel-wide audio effects such as reverb, delay or EQ.
183
- *
184
- * Install "tone" to use this method.
185
- *
186
- * @param nodes One or more Tone.js {@link ToneAudioNode} instances to chain in series.
187
- * @return Instance for chaining.
188
- *
189
- * @example
190
- * ```ts
191
- * import * as Tone from "tone";
192
- *
193
- * const channel = sound.findChannel("music");
194
- *
195
- * // Create a reverb effect and wait for its impulse response to be ready.
196
- * const reverb = new Tone.Reverb({ decay: 2.5 });
197
- *
198
- * // Route the channel through the reverb to the master output.
199
- * channel.chain(reverb);
200
- * ```
201
- */
202
- chain(...nodes: ToneAudioNode[]): this;
203
- /**
204
- * **Advanced** — the raw `Tone.Param<"decibels">` for this channel's volume.
205
- *
206
- * Unlike the {@link volume} property (which uses a linear 0–1 scale), this
207
- * Param works directly in **decibels** and exposes all Tone.js automation
208
- * methods such as `rampTo`, `linearRampTo`, and `exponentialRampTo`.
209
- *
210
- * Use this when you need to smoothly automate volume over time instead of
211
- * setting it instantly.
212
- *
213
- * @example
214
- * ```ts
215
- * const channel = sound.findChannel("music");
216
- *
217
- * // Fade the volume from its current level to -12 dB over 3 seconds.
218
- * channel.volumeParam.rampTo(-12, 3);
219
- *
220
- * // Fade to silence over 2 seconds.
221
- * channel.volumeParam.rampTo(-Infinity, 2);
222
- * ```
223
- */
224
- readonly volumeParam: Param<"decibels">;
225
- /**
226
- * **Advanced** — the raw `Tone.Param<"audioRange">` for this channel's
227
- * stereo pan position.
228
- *
229
- * Unlike the {@link pan} property (which sets the value instantly), this
230
- * Param exposes all Tone.js automation methods such as `rampTo`,
231
- * `linearRampTo`, and `exponentialRampTo`.
232
- *
233
- * Use this when you need to smoothly automate panning over time instead of
234
- * setting it instantly. Values range from -1 (full left) to 1 (full right).
235
- *
236
- * @example
237
- * ```ts
238
- * const channel = sound.findChannel("music");
239
- *
240
- * // Gradually pan to the left over 3 seconds.
241
- * channel.panParam.rampTo(-1, 3);
242
- *
243
- * // Return to centre over 2 seconds.
244
- * channel.panParam.rampTo(0, 2);
245
- * ```
246
- */
247
- readonly panParam: Param<"audioRange">;
248
- }
249
-
250
- type SoundFilterMemory = ({
251
- filterType: "ReverbFilter";
252
- } & Omit<Partial<ReverbOptions>, "context">) | ({
253
- filterType: "FeedbackDelayFilter";
254
- } & Omit<Partial<FeedbackDelayOptions>, "context">) | ({
255
- filterType: "FreeverbFilter";
256
- } & Omit<Partial<FreeverbOptions>, "context">) | ({
257
- filterType: "DelayFilter";
258
- } & Omit<Partial<DelayOptions>, "context">) | ({
259
- filterType: "PingPongDelayFilter";
260
- } & Omit<Partial<PingPongDelayOptions>, "context">) | ({
261
- filterType: "GateFilter";
262
- } & Omit<Partial<GateOptions>, "context">) | ({
263
- filterType: "AutoFilterFilter";
264
- } & Omit<Partial<AutoFilterOptions>, "context">) | ({
265
- filterType: "BiquadFilterFilter";
266
- } & Omit<Partial<BiquadFilterOptions>, "context">) | ({
267
- filterType: "OnePoleFilterFilter";
268
- } & Omit<Partial<OnePoleFilterOptions>, "context" | "frequency">) | ({
269
- filterType: "FeedbackCombFilterFilter";
270
- } & Omit<Partial<FeedbackCombFilterOptions>, "context">) | ({
271
- filterType: "CustomFilter";
272
- } & Omit<Partial<FilterOptions>, "context">) | ({
273
- filterType: "ChorusFilter";
274
- } & Omit<Partial<ChorusOptions>, "context">) | ({
275
- filterType: "PhaserFilter";
276
- } & Omit<Partial<PhaserOptions>, "context">) | ({
277
- filterType: "TremoloFilter";
278
- } & Omit<Partial<TremoloOptions>, "context">) | ({
279
- filterType: "VibratoFilter";
280
- } & Omit<Partial<VibratoOptions>, "context">) | ({
281
- filterType: "CompressorFilter";
282
- } & Omit<Partial<CompressorOptions>, "context">) | ({
283
- filterType: "MidSideCompressorFilter";
284
- } & Omit<Partial<MidSideCompressorOptions>, "context">) | ({
285
- filterType: "MultibandCompressorFilter";
286
- } & Omit<Partial<MultibandCompressorOptions>, "context">) | ({
287
- filterType: "LimiterFilter";
288
- } & Omit<Partial<LimiterOptions>, "context">) | ({
289
- filterType: "GreaterThanFilter";
290
- } & Omit<Partial<GreaterThanOptions>, "context">) | ({
291
- filterType: "GreaterThanZeroFilter";
292
- } & Omit<Partial<GreaterThanZeroOptions>, "context">) | ({
293
- filterType: "DistortionFilter";
294
- } & Omit<Partial<DistortionOptions>, "context">) | ({
295
- filterType: "BitCrusherFilter";
296
- } & Omit<Partial<BitCrusherOptions>, "context">) | ({
297
- filterType: "Panner3DFilter";
298
- } & Omit<Partial<Panner3DOptions>, "context">) | ({
299
- filterType: "AutoPannerFilter";
300
- } & Omit<Partial<AutoPannerOptions>, "context">) | ({
301
- filterType: "StereoWidenerFilter";
302
- } & Omit<Partial<StereoWidenerOptions>, "context">);
303
-
304
- interface ExportedSound {
305
- options: SoundOptions;
306
- filters?: SoundFilterMemory[];
307
- }
308
- interface SoundPlay {
309
- stepIndex: number;
310
- paused: boolean;
311
- options?: SoundPlayOptions | string;
312
- }
313
- interface ExportedSoundPlay extends SoundPlay {
314
- sound: ExportedSound;
315
- }
316
- /**
317
- * Interface exported sounds
318
- */
319
- interface SoundGameState {
320
- /**
321
- * @deprecated
322
- */
323
- soundsPlaying?: {
324
- [key: string]: ExportedSoundPlay;
325
- };
326
- mediaInstances: {
327
- [key: string]: {
328
- channelAlias: string;
329
- soundAlias: string;
330
- stepCounter: number;
331
- options: MediaMemory & {
332
- filters?: SoundFilterMemory[];
333
- delay?: number;
334
- };
335
- /**
336
- * @deprecated Use options.paused instead.
337
- */
338
- paused?: boolean;
339
- };
340
- };
341
- }
342
-
343
- interface SoundManagerInterface {
344
- /** Master volume in the range [0, 1]. */
345
- volumeAll: number;
346
- /**
347
- * @deprecated Global playback speed. This is not a well-supported feature and may be removed in a future release. Use individual sound speed options instead.
348
- */
349
- speedAll: number;
350
- /**
351
- * The default channel alias used when playing a sound without specifying a
352
- * channel. Defaults to `"general"`.
353
- */
354
- defaultChannelAlias: string;
355
- /**
356
- * @deprecated Register sound assets directly via `PIXI.Assets` instead.
357
- */
358
- add(alias: string, options: string): void;
359
- /**
360
- * Plays a sound.
361
- * @param alias The media and sound (asset) alias reference.
362
- * @param options The options.
363
- * @returns The media instance (resolves immediately if already loaded).
364
- */
365
- play(alias: string, options?: SoundPlayOptionsWithChannel): Promise<MediaInterface>;
366
- play(mediaAlias: string, soundAlias: string, options?: SoundPlayOptionsWithChannel): Promise<MediaInterface>;
367
- /**
368
- * Plays a non-persistent ("transient") sound (e.g. UI / menu sounds).
369
- * Transient playback is not tracked in save/export state.
370
- */
371
- playTransient(alias: string, options?: Partial<PlayerOptions>): Promise<Player>;
372
- /**
373
- * Find a tracked media instance by alias.
374
- */
375
- find(alias: string): MediaInterface | undefined;
376
- /**
377
- * Stop a tracked media instance and remove it from the manager.
378
- */
379
- stop(alias: string): void;
380
- /**
381
- * Pause a tracked media instance.
382
- */
383
- pause(alias: string): MediaInterface | undefined;
384
- /**
385
- * Resume a paused media instance.
386
- */
387
- resume(alias: string): MediaInterface | undefined;
388
- /** Duration in seconds of the loaded sound with the given alias. */
389
- duration(alias: string): number;
390
- /** Toggle mute on all sounds. Returns the new muted state. */
391
- toggleMuteAll(): boolean;
392
- /**
393
- * Whether all sounds are currently muted. Note that individual channels or media instances may still be muted or unmuted; this is just the global master mute state.
394
- */
395
- readonly muted: boolean;
396
- /** Mute all sounds. */
397
- muteAll(): this;
398
- /** Unmute all sounds. */
399
- unmuteAll(): this;
400
- /** Stop all sounds. */
401
- stopAll(): this;
402
- /** Pause all sounds. */
403
- pauseAll(): this;
404
- /** Resume all sounds. */
405
- resumeAll(): this;
406
- /**
407
- * Temporarily pause all currently-playing sounds (or just those in the given
408
- * channel) without persisting the paused state. Useful for overlays / pause
409
- * menus.
410
- *
411
- * Only sounds that are **actively playing** at the time of the call are paused;
412
- * sounds that were already paused beforehand are left untouched so that they
413
- * remain paused when {@link resumeUnsavedAll} is called later.
414
- *
415
- * When called without a channel argument all transient players started with
416
- * {@link playTransient} are also stopped.
417
- */
418
- pauseUnsavedAll(channel?: string): this;
419
- /**
420
- * Resume all sounds (or just those in the given channel) that were paused by
421
- * the most recent call to {@link pauseUnsavedAll}. Sounds that were already
422
- * paused before `pauseUnsavedAll` was called are **not** resumed.
423
- */
424
- resumeUnsavedAll(channel?: string): this;
425
- /**
426
- * Stop all transient media instances started with {@link playTransient}.
427
- */
428
- stopTransientAll(): this;
429
- /** Load one or more sound assets. */
430
- load(...alias: string[]): Promise<void>;
431
- /** Trigger background loading of one or more sound assets. */
432
- backgroundLoad(...alias: string[]): Promise<void>;
433
- /** Trigger background loading of a sound bundle. */
434
- backgroundLoadBundle(alias: string): Promise<void>;
435
- /** Stop all sounds and clear internal state. */
436
- clear(): void;
437
- /**
438
- * Add a new audio channel.
439
- * Returns the created channel, or `undefined` if the alias already exists.
440
- */
441
- addChannel(alias: string | string[], options?: ChannelOptions): AudioChannelInterface | undefined;
442
- /**
443
- * Find the channel for the given alias, creating it if it does not yet exist.
444
- */
445
- findChannel(alias: string): AudioChannelInterface;
446
- /** All registered audio channels. */
447
- readonly channels: AudioChannelInterface[];
448
- /**
449
- * Export the current sound state, including currently playing sounds and their options, for saving or debugging purposes. This is not guaranteed to be stable across versions and may contain implementation details; it is not intended for use in general application code.
450
- */
451
- export(): SoundGameState;
452
- /**
453
- * Restore a sound state exported by {@link export}. This will stop any currently playing sounds and replace them with the sounds specified in the exported state. This is not guaranteed to be stable across versions and may contain implementation details; it is not intended for use in general application code.
454
- */
455
- restore(data: object): Promise<void>;
456
- }
457
-
458
- declare class CachedMap<K extends {}, V extends {}> implements Map<K, V> {
459
- readonly cache: LRUCache<K, V>;
460
- readonly map: Map<K, V>;
461
- constructor(options: {
462
- cacheSize: number;
463
- });
464
- get [Symbol.iterator](): () => MapIterator<[K, V]>;
465
- get [Symbol.toStringTag](): string;
466
- clear(): void;
467
- delete(key: K): boolean;
468
- get forEach(): (callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any) => void;
469
- get(key: K): V | undefined;
470
- has(key: K): boolean;
471
- set(key: K, value: V): this;
472
- get size(): number;
473
- entries(): MapIterator<[K, V]>;
474
- keys(): MapIterator<K>;
475
- values(): MapIterator<V>;
476
- }
477
-
478
- interface TickerArgs {
479
- }
480
-
481
- interface TickerHistory<TArgs extends TickerArgs> {
482
- id: string;
483
- args: TArgs;
484
- /**
485
- * The aliases of the canvas elements that are connected to this ticker
486
- */
487
- canvasElementAliases: string[];
488
- priority?: UPDATE_PRIORITY;
489
- duration?: number;
490
- paused?: boolean;
491
- }
492
-
493
- type PauseType = {
494
- /**
495
- * The type of the value
496
- */
497
- type: "pause";
498
- /**
499
- * Duration in seconds
500
- */
501
- duration: number;
502
- };
503
-
504
- type RepeatType = "repeat";
505
-
506
- interface TickersStep<TArgs extends TickerArgs> {
507
- /**
508
- * Ticker class name
509
- */
510
- ticker: string;
511
- /**
512
- * Duration in seconds. If is undefined, the step will end only when the animation is finished.
513
- */
514
- duration?: number;
515
- /**
516
- * Arguments to pass to the ticker
517
- */
518
- args: TArgs;
519
- /**
520
- * Priority of the ticker
521
- */
522
- priority?: UPDATE_PRIORITY;
523
- }
524
- /**
525
- * The steps of the tickers
526
- */
527
- interface TickersSequence {
528
- /**
529
- * The step number
530
- */
531
- currentStepNumber: number;
532
- /**
533
- * The steps of the tickers
534
- */
535
- steps: (TickersStep<any> | RepeatType | PauseType)[];
536
- }
537
-
538
- /**
539
- * This class is used to create a canvas element to add into a Pixi Application.
540
- * You can use {@link canvas.add()} to add this element into the application.
541
- * This class should be implemented and the memory method should be overridden.
542
- * You must use the {@link canvasComponentDecorator} to register the canvas in the game.
543
- * In Ren'Py is a displayable.
544
- * @example
545
- * ```typescript
546
- * const CANVAS_EXAMPLE_ID = "CanvasExample";
547
- *
548
- * \@canvasComponentDecorator({
549
- * name: CANVAS_EXAMPLE_ID,
550
- * })
551
- * export class CanvasExample extends Container implements CanvasBaseItem<Memory> {
552
- * get memory(): Memory {
553
- * return {
554
- * pixivnId: CANVAS_EXAMPLE_ID,
555
- * // ... other properties
556
- * }
557
- * }
558
- * async setMemory(value: Memory) {
559
- * // ... set other properties
560
- * }
561
- * }
562
- * ```
563
- */
564
- declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
565
- constructor(..._options: any);
566
- /**
567
- * This method return the memory of the canvas element.
568
- * @throws {PixiError} when the method is not overridden in the subclass.
569
- */
570
- get memory(): T2;
571
- /**
572
- * This method set the memory of the canvas element.
573
- * @throws {PixiError} when the method is not overridden in the subclass.
574
- */
575
- setMemory(_value: T2): Promise<void> | void;
576
- /**
577
- * Get the id of the canvas element. This variable is used in the system to get the canvas element by id
578
- */
579
- pixivnId: string;
580
- }
581
-
582
- /**
583
- * Interface for the canvas base memory
584
- */
585
- interface CanvasBaseItemMemory {
586
- pixivnId: string;
587
- /**
588
- * The index of the container in its parent, if it has one
589
- */
590
- index?: number;
591
- /**
592
- * The label of the parent container, if it has one
593
- */
594
- parentLabel?: string;
595
- label?: string;
596
- zIndex?: number;
597
- }
598
-
599
- /**
600
- * Interface exported canvas
601
- */
602
- interface CanvasGameState {
603
- tickers: {
604
- [id: string]: TickerHistory<any>;
605
- };
606
- tickersSteps: {
607
- [alias: string]: {
608
- [tickerId: string]: TickersSequence;
609
- };
610
- };
611
- elements: {
612
- [alias: string]: CanvasBaseItemMemory;
613
- };
614
- stage: Partial<ContainerMemory>;
615
- /**
616
- * @deprecated
617
- */
618
- elementAliasesOrder: string[];
619
- tickersToCompleteOnStepEnd: {
620
- tikersIds: {
621
- id: string;
622
- }[];
623
- stepAlias: {
624
- id: string;
625
- alias: string;
626
- }[];
627
- };
628
- }
629
-
630
- interface AdditionalPositionsExtensionProps {
631
- /**
632
- * 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.
633
- * For example:
634
- * - if you set align to 0.5, the element will be in the center of the canvas.
635
- * - 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.
636
- * - 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.
637
- *
638
- * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
639
- */
640
- align?: Partial<PointData> | number;
641
- /**
642
- * 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.
643
- * For example:
644
- * - if you set align to 0.5, the element will be in the center of the canvas.
645
- * - 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.
646
- * - 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.
647
- *
648
- * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
649
- */
650
- xAlign?: number;
651
- /**
652
- * 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.
653
- * For example:
654
- * - if you set align to 0.5, the element will be in the center of the canvas.
655
- * - 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.
656
- * - 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.
657
- *
658
- * **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
659
- */
660
- yAlign?: number;
661
- /**
662
- * is a way to set the position of the element in the canvas calculated in percentage.
663
- * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
664
- * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
665
- * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
666
- * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
667
- *
668
- * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
669
- */
670
- percentagePosition?: Partial<PointData> | number;
671
- /**
672
- * is a way to set the position of the element in the canvas calculated in percentage.
673
- * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
674
- * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
675
- * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
676
- * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
677
- *
678
- * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
679
- */
680
- percentageX?: number;
681
- /**
682
- * is a way to set the position of the element in the canvas calculated in percentage.
683
- * For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
684
- * - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
685
- * - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
686
- * - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
687
- *
688
- * **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
689
- */
690
- percentageY?: number;
691
- }
692
-
693
- type ContainerChild = Container & CanvasBaseItem<any>;
694
-
695
- interface ListenerExtensionMemory {
696
- onEvents?: OnEventsHandlers;
697
- }
698
- interface OnEventsHandlers {
699
- [name: string]: string;
700
- }
701
-
702
- /**
703
- * Interface for the canvas container memory
704
- */
705
- interface ContainerMemory<C extends ContainerChild = ContainerChild> extends ContainerOptions<C>, CanvasBaseItemMemory, ListenerExtensionMemory, AdditionalPositionsExtensionProps {
706
- /**
707
- * The elements contained in this container
708
- */
709
- elements: CanvasBaseItemMemory[];
710
- }
711
-
712
- var version = "1.8.4";
32
+ var version = "1.8.7";
713
33
 
714
34
  /**
715
35
  * @deprecated
@@ -783,132 +103,6 @@ declare const SYSTEM_RESERVED_STORAGE_KEYS: {
783
103
  LAST_STEP_GLUED: string;
784
104
  };
785
105
 
786
- type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
787
- type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
788
- type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
789
- [key: string | number | symbol]: NonFunctionStorage;
790
- };
791
- /**
792
- * StorageElementType are all the types that can be stored in the storage
793
- */
794
- type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
795
- [key: string | number | symbol]: StorageElementType;
796
- } | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
797
- [key: string | number | symbol]: NonFunctionStorage;
798
- };
799
- /**
800
- * StorageObjectType are all the types that can be stored in the storage
801
- */
802
- type StorageObjectType = Record<string | number | symbol, StorageElementType>;
803
-
804
- interface StorageGameStateItem<T = StorageElementType> {
805
- key: string;
806
- value: T;
807
- }
808
- /**
809
- * Interface exported storage data
810
- */
811
- type StorageGameState = {
812
- /**
813
- * @deprecated
814
- */
815
- base?: StorageGameStateItem[];
816
- /**
817
- * @deprecated
818
- */
819
- temp?: StorageGameStateItem[];
820
- tempDeadlines: StorageGameStateItem<number>[];
821
- /**
822
- * @deprecated
823
- */
824
- flags?: string[];
825
- main: StorageGameStateItem[];
826
- };
827
-
828
- /**
829
- * is a string containing the name of the label.
830
- * It is used to {@link narration.registeredLabels} to get the label class.
831
- */
832
- type LabelIdType = string;
833
-
834
- interface DialogueInterface {
835
- /**
836
- * The text of the dialogue.
837
- */
838
- text: string | string[];
839
- /**
840
- * The id of the character that is speaking.
841
- */
842
- character?: CharacterInterface | string;
843
- }
844
- type StoredDialogue = Omit<DialogueInterface, "character"> & {
845
- character: string | undefined;
846
- };
847
-
848
- interface HistoryStep {
849
- /**
850
- * The difference between the previous step and the current step.
851
- */
852
- diff?: Difference[];
853
- /**
854
- * The label id of the current step.
855
- */
856
- currentLabel?: LabelIdType;
857
- /**
858
- * The sha1 of the step function.
859
- */
860
- stepSha1: string;
861
- /**
862
- * Equivalent to the narration.stepCounter
863
- */
864
- index: number;
865
- /**
866
- * The data of the step of the label.
867
- */
868
- labelStepIndex: number | null;
869
- /**
870
- * Dialogue to be shown in the game
871
- */
872
- dialogue?: StoredDialogue;
873
- /**
874
- * List of choices asked of the player
875
- */
876
- choices?: StoredChoiceInterface[];
877
- /**
878
- * List of choices already made by the player
879
- */
880
- alreadyMadeChoices?: number[];
881
- /**
882
- * The input value of the player
883
- */
884
- inputValue?: StorageElementType$1;
885
- /**
886
- * The choice made by the player
887
- */
888
- choiceIndexMade?: number;
889
- /**
890
- * If true, the current dialogue will be glued to the previous one.
891
- */
892
- isGlued?: boolean;
893
- /**
894
- * Opened Labels in the current step.
895
- */
896
- openedLabels?: OpenedLabel$1[];
897
- }
898
-
899
- interface OpenedLabel {
900
- label: LabelIdType;
901
- currentStepIndex: number;
902
- }
903
-
904
- /**
905
- * Interface exported step data
906
- */
907
- interface HistoryGameState {
908
- stepsHistory: HistoryStep[];
909
- originalStepData: GameStepState | undefined;
910
- }
911
-
912
106
  interface GameState {
913
107
  pixivn_version: string;
914
108
  stepData: NarrationGameState;
@@ -970,7 +164,7 @@ declare namespace Game {
970
164
  * - `resizeMode`: The resize mode of the canvas.
971
165
  * @param devtoolsOptions Equivalent to the options you can use when initializing the [PixiJS Devtools](https://pixi-vn.com/start/canvas#use-pixijs-devtools-with-pixivn).
972
166
  * @example
973
- * ```typescript
167
+ * ```ts
974
168
  * const body = document.body
975
169
  * if (!body) {
976
170
  * throw new Error('body element not found')
@@ -1049,7 +243,7 @@ declare namespace Game {
1049
243
  /**
1050
244
  * Function to be executed at the end of the game. It should be set in the game initialization.
1051
245
  * @example
1052
- * ```typescript
246
+ * ```ts
1053
247
  * Game.onEnd(async (props) => {
1054
248
  * props.navigate("/end")
1055
249
  * })
@@ -1067,7 +261,7 @@ declare namespace Game {
1067
261
  * You can also check if the error is an instance of {@link PixiError} to handle specific errors related to Pixi’VN.
1068
262
  *
1069
263
  * @example
1070
- * ```typescript
264
+ * ```ts
1071
265
  * // Register a synchronous error handler
1072
266
  * Game.addOnError((error, props) => {
1073
267
  * props.notify("An error occurred")
@@ -1116,7 +310,7 @@ declare namespace Game {
1116
310
  * @param label Label
1117
311
  * @returns
1118
312
  * @example
1119
- * ```typescript
313
+ * ```ts
1120
314
  * Game.onLoadingLabel(async (stepId, label) => {
1121
315
  * await Assets.load('path/to/image1.png')
1122
316
  * await Assets.load('path/to/image2.png')
@@ -1134,7 +328,7 @@ declare namespace Game {
1134
328
  /**
1135
329
  * Function to be executed when navigation is requested.
1136
330
  * @example
1137
- * ```typescript
331
+ * ```ts
1138
332
  * Game.onNavigate(async (path) => {
1139
333
  * // custom navigation logic
1140
334
  * window.history.pushState({}, "title", path)
@@ -1169,4 +363,4 @@ declare const _default: {
1169
363
  PIXIVN_VERSION: string;
1170
364
  };
1171
365
 
1172
- export { CANVAS_APP_GAME_LAYER_ALIAS, CachedMap, Game, type GameState, type GameStepStateData, version as PIXIVN_VERSION, Pause, Repeat, SYSTEM_RESERVED_STORAGE_KEYS, createExportableElement, _default as default };
366
+ export { CANVAS_APP_GAME_LAYER_ALIAS, Game, type GameState, type GameStepStateData, version as PIXIVN_VERSION, Pause, Repeat, SYSTEM_RESERVED_STORAGE_KEYS, createExportableElement, _default as default };