fireworks-engine 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/index.d.ts ADDED
@@ -0,0 +1,691 @@
1
+ export type HexColorString = `#${string}`;
2
+
3
+ export type FireworksEnginePresetName = 'base' | 'rocket' | 'cascade' | 'finale';
4
+ export type FireworksLaunchPresetName =
5
+ | 'button-click'
6
+ | 'success-burst'
7
+ | 'win-celebration'
8
+ | 'achievement-unlock'
9
+ | 'confetti-pop'
10
+ | 'purchase-success'
11
+ | 'victory-finale'
12
+ | 'snowfall'
13
+ | 'leaf-fall'
14
+ | 'ambient-sparkle';
15
+ export type FireworksMode = 'burst' | 'rocket';
16
+ export type RocketCascadeMode = 'burst' | 'rocket';
17
+ export type BurstColorMode = 'palette' | 'rgb' | 'single';
18
+ export type BurstFlashColorMode = 'palette' | 'rgb' | 'single';
19
+ export type BurstFormPrimitiveShape = 'circle' | 'square' | 'rectangle' | 'glyph';
20
+ export type BurstFormShape = BurstFormPrimitiveShape | 'mix';
21
+ export type BurstFormShapeInput = BurstFormShape | `${BurstFormShape}|${string}`;
22
+ export type BurstSparkShape = 'uniform' | 'spindle' | 'fade';
23
+
24
+ export type FireworksTimeoutHandle = ReturnType<typeof globalThis.setTimeout>;
25
+ export type FireworksRequestAnimationFrame = (callback: FrameRequestCallback) => number;
26
+ export type FireworksCancelAnimationFrame = (handle: number) => void;
27
+ export type FireworksLifecycleCallback = (engine: FireworksEngine) => void;
28
+
29
+ export interface FireworksRootResolverContext {
30
+ document: Document | null;
31
+ window: Window | null;
32
+ }
33
+
34
+ export type FireworksRootResolver = (
35
+ context: FireworksRootResolverContext,
36
+ ) => Element | null | undefined;
37
+
38
+ export interface FireworksCanvasOptions {
39
+ appendTarget?: Element | null;
40
+ maxDevicePixelRatio?: number;
41
+ zIndex?: number | string;
42
+ }
43
+
44
+ export interface FireworksRuntimeOptions {
45
+ document?: Document | null;
46
+ window?: Window | null;
47
+ root?: Element | FireworksRootResolver | null;
48
+ prefersReducedMotion?: (() => boolean) | null;
49
+ requestAnimationFrame?: FireworksRequestAnimationFrame | null;
50
+ cancelAnimationFrame?: FireworksCancelAnimationFrame | null;
51
+ setTimeout?: typeof globalThis.setTimeout | null;
52
+ clearTimeout?: typeof globalThis.clearTimeout | null;
53
+ now?: (() => number) | null;
54
+ }
55
+
56
+ export interface FireworksPerformanceOptions {
57
+ enableBurstQueueThrottling?: boolean;
58
+ maxBurstParticlesPerFrame?: number;
59
+ particlePressureThreshold?: number;
60
+ fastRectRadiusThreshold?: number;
61
+ }
62
+
63
+ export interface FireworksRocketCascadeOptions {
64
+ mode?: RocketCascadeMode;
65
+ bursts?: number;
66
+ childBursts?: number;
67
+ childSpeedMin?: number;
68
+ childSpeedMax?: number;
69
+ childDurationMin?: number;
70
+ childDurationMax?: number;
71
+ childDirectionDeg?: number;
72
+ childConeDeg?: number;
73
+ delay?: number;
74
+ spreadX?: number;
75
+ spreadY?: number;
76
+ burst?: FireworksBurstOverrideOptions;
77
+ child?: FireworksRocketLaunchOptions;
78
+ }
79
+
80
+ export interface FireworksRocketOptions {
81
+ enabled?: boolean;
82
+ colorMode?: BurstColorMode;
83
+ singleColor?: HexColorString | string;
84
+ palette?: string[] | readonly string[];
85
+ color?: HexColorString | string;
86
+ streakLength?: number;
87
+ finalStreakLength?: number;
88
+ thickness?: number;
89
+ speed?: number;
90
+ durationMin?: number;
91
+ durationMax?: number;
92
+ cascade?: FireworksRocketCascadeOptions;
93
+ }
94
+
95
+ export interface FireworksRocketTailEmbersOptions {
96
+ enabled?: boolean;
97
+ count?: number;
98
+ brightness?: number;
99
+ fade?: number;
100
+ spreadX?: number;
101
+ spreadY?: number;
102
+ speed?: number;
103
+ size?: number;
104
+ }
105
+
106
+ export interface FireworksBurstFormsOptions {
107
+ enabled?: boolean;
108
+ palette?: string[] | readonly string[];
109
+ count?: number;
110
+ speedMin?: number;
111
+ speedMax?: number;
112
+ directionDeg?: number;
113
+ coneDeg?: number;
114
+ gravity?: number;
115
+ lifeMin?: number;
116
+ lifeMax?: number;
117
+ sizeMin?: number;
118
+ sizeMax?: number;
119
+ spin?: number;
120
+ spinCoverage?: number;
121
+ spinDuration?: number;
122
+ spinPause?: number;
123
+ highlight?: number;
124
+ highlightAngleDeg?: number;
125
+ highlightWidth?: number;
126
+ wobble?: number;
127
+ shape?: BurstFormShapeInput;
128
+ glyph?: string;
129
+ colorMode?: BurstColorMode;
130
+ singleColor?: HexColorString | string;
131
+ }
132
+
133
+ export interface FireworksBurstSparksOptions {
134
+ enabled?: boolean;
135
+ palette?: string[] | readonly string[];
136
+ count?: number;
137
+ length?: number;
138
+ tailScale?: number;
139
+ thickness?: number;
140
+ speedMin?: number;
141
+ speedMax?: number;
142
+ directionDeg?: number;
143
+ coneDeg?: number;
144
+ gravity?: number;
145
+ lifeMin?: number;
146
+ lifeMax?: number;
147
+ shape?: BurstSparkShape;
148
+ colorMode?: BurstColorMode;
149
+ singleColor?: HexColorString | string;
150
+ }
151
+
152
+ export interface FireworksBurstCenterFlashOptions {
153
+ enabled?: boolean;
154
+ startSize?: number;
155
+ endSize?: number;
156
+ peakAlpha?: number;
157
+ attack?: number;
158
+ fade?: number;
159
+ colorMode?: BurstFlashColorMode;
160
+ color?: HexColorString | string;
161
+ innerStop?: number;
162
+ }
163
+
164
+ export interface FireworksBurstTwinkleCloudOptions {
165
+ enabled?: boolean;
166
+ count?: number;
167
+ radius?: number;
168
+ startDelay?: number;
169
+ duration?: number;
170
+ twinkleLife?: number;
171
+ brightness?: number;
172
+ size?: number;
173
+ spawnSpread?: number;
174
+ }
175
+
176
+ export interface FireworksBurstOverrideOptions {
177
+ timeScale?: number;
178
+ sizeScale?: number;
179
+ simple?: boolean;
180
+ burstForms?: FireworksBurstFormsOptions;
181
+ burstSparks?: FireworksBurstSparksOptions;
182
+ burstCenterFlash?: FireworksBurstCenterFlashOptions;
183
+ burstTwinkleCloud?: FireworksBurstTwinkleCloudOptions;
184
+ }
185
+
186
+ export interface FireworksRocketLaunchOptions extends FireworksBurstOverrideOptions {
187
+ count?: number;
188
+ rocket?: FireworksRocketOptions;
189
+ rocketTailEmbers?: FireworksRocketTailEmbersOptions;
190
+ }
191
+
192
+ export interface FireworksEngineOptions extends FireworksRocketLaunchOptions {
193
+ canvas?: FireworksCanvasOptions;
194
+ runtime?: FireworksRuntimeOptions;
195
+ performance?: FireworksPerformanceOptions;
196
+ mode?: FireworksMode;
197
+ bursts?: number;
198
+ duration?: number;
199
+ rocketCount?: number;
200
+ rocketDelay?: number;
201
+ totalDuration?: number;
202
+ onStart?: FireworksLifecycleCallback | null;
203
+ onStop?: FireworksLifecycleCallback | null;
204
+ onFinish?: FireworksLifecycleCallback | null;
205
+ }
206
+
207
+ export interface ResolvedRocketConfig {
208
+ enabled: boolean;
209
+ colorMode: BurstColorMode;
210
+ singleColor: string;
211
+ palette: string[] | readonly string[] | null;
212
+ streakLength: number;
213
+ finalStreakLength: number;
214
+ thickness: number;
215
+ speed: number;
216
+ }
217
+
218
+ export interface ResolvedRocketTailEmbersConfig {
219
+ enabled: boolean;
220
+ count: number;
221
+ brightness: number;
222
+ fade: number;
223
+ spreadX: number;
224
+ spreadY: number;
225
+ speed: number;
226
+ size: number;
227
+ }
228
+
229
+ export interface ResolvedBurstFormsConfig {
230
+ enabled: boolean;
231
+ count: number;
232
+ speedMin: number;
233
+ speedMax: number;
234
+ directionDeg: number;
235
+ coneDeg: number;
236
+ gravity: number;
237
+ lifeMin: number;
238
+ lifeMax: number;
239
+ sizeMin: number;
240
+ sizeMax: number;
241
+ spin: number;
242
+ spinCoverage: number;
243
+ spinDuration: number;
244
+ spinPause: number;
245
+ highlight: number;
246
+ highlightAngleDeg: number;
247
+ highlightWidth: number;
248
+ wobble: number;
249
+ palette: string[] | readonly string[];
250
+ simple?: boolean;
251
+ shape: BurstFormShapeInput;
252
+ glyph: string;
253
+ colorMode: BurstColorMode;
254
+ singleColor: string;
255
+ }
256
+
257
+ export interface ResolvedBurstSparksConfig {
258
+ enabled: boolean;
259
+ count: number;
260
+ speedMin: number;
261
+ speedMax: number;
262
+ directionDeg: number;
263
+ coneDeg: number;
264
+ gravity: number;
265
+ lifeMin: number;
266
+ lifeMax: number;
267
+ palette: string[] | readonly string[];
268
+ simple?: boolean;
269
+ length: number;
270
+ tailScale: number;
271
+ thickness: number;
272
+ shape: BurstSparkShape;
273
+ colorMode: BurstColorMode;
274
+ singleColor: string;
275
+ }
276
+
277
+ export interface ResolvedBurstCenterFlashConfig {
278
+ enabled: boolean;
279
+ startSize: number;
280
+ endSize: number;
281
+ peakAlpha: number;
282
+ attack: number;
283
+ fade: number;
284
+ colorMode: BurstFlashColorMode;
285
+ color: string;
286
+ innerStop: number;
287
+ }
288
+
289
+ export interface ResolvedBurstTwinkleCloudConfig {
290
+ enabled: boolean;
291
+ count: number;
292
+ radius: number;
293
+ startDelay: number;
294
+ duration: number;
295
+ twinkleLife: number;
296
+ brightness: number;
297
+ size: number;
298
+ spawnSpread: number;
299
+ }
300
+
301
+ export interface ResolvedPerformanceConfig {
302
+ enableBurstQueueThrottling: boolean;
303
+ maxBurstParticlesPerFrame: number;
304
+ particlePressureThreshold: number;
305
+ fastRectRadiusThreshold: number;
306
+ }
307
+
308
+ export interface ResolvedBurstOptions {
309
+ sizeScale: number;
310
+ simple: boolean;
311
+ burstForms: ResolvedBurstFormsConfig;
312
+ burstSparks: ResolvedBurstSparksConfig;
313
+ burstCenterFlash: ResolvedBurstCenterFlashConfig;
314
+ burstTwinkleCloud: ResolvedBurstTwinkleCloudConfig;
315
+ }
316
+
317
+ export interface FireworksFormParticle {
318
+ type: 'form';
319
+ x: number;
320
+ y: number;
321
+ vx: number;
322
+ vy: number;
323
+ gravity: number;
324
+ life: number;
325
+ maxLife: number;
326
+ radius: number;
327
+ color: string;
328
+ drag: number;
329
+ simple?: boolean;
330
+ formShape: BurstFormPrimitiveShape;
331
+ formGlyph: string;
332
+ formSpin: number;
333
+ formSpinPhase: number;
334
+ formSpinPhaseSpeed: number;
335
+ formSpinAngle: number;
336
+ formSpinAngleSpeed: number;
337
+ formSpinMinWidthScale: number;
338
+ formSpinFlipExponent: number;
339
+ formSpinRateWavePhase: number;
340
+ formSpinRateWaveSpeed: number;
341
+ formSpinRateWaveAmplitude: number;
342
+ formWidthScale: number;
343
+ formWobble: number;
344
+ formWobbleLateralSpeed: number;
345
+ formWobbleVelocity: number;
346
+ formWobbleTarget: number;
347
+ formWobbleTargetTimer: number;
348
+ }
349
+
350
+ export interface FireworksBurstSparkParticle {
351
+ type: 'burstSpark';
352
+ x: number;
353
+ y: number;
354
+ vx: number;
355
+ vy: number;
356
+ gravity: number;
357
+ life: number;
358
+ maxLife: number;
359
+ color: string;
360
+ drag: number;
361
+ simple?: boolean;
362
+ sparkLength: number;
363
+ sparkTailScale: number;
364
+ sparkThickness: number;
365
+ initialSpeed: number;
366
+ sparkShape: BurstSparkShape;
367
+ }
368
+
369
+ export interface FireworksRocketEmberParticle {
370
+ type: 'rocketEmber';
371
+ x: number;
372
+ y: number;
373
+ vx: number;
374
+ vy: number;
375
+ gravity: number;
376
+ life: number;
377
+ maxLife: number;
378
+ radius: number;
379
+ brightness: number;
380
+ drag: number;
381
+ simple?: boolean;
382
+ }
383
+
384
+ export type FireworksParticle =
385
+ | FireworksFormParticle
386
+ | FireworksBurstSparkParticle
387
+ | FireworksRocketEmberParticle;
388
+
389
+ export interface FireworksTwinkle {
390
+ x: number;
391
+ y: number;
392
+ appearAt: number;
393
+ life: number;
394
+ size: number;
395
+ alphaScale: number;
396
+ }
397
+
398
+ export interface FireworksBurstFlash {
399
+ type: 'burstFlash';
400
+ x: number;
401
+ y: number;
402
+ age: number;
403
+ life: number;
404
+ maxLife: number;
405
+ startSize: number;
406
+ endSize: number;
407
+ peakAlpha: number;
408
+ attack: number;
409
+ fade: number;
410
+ color: string;
411
+ innerStop: number;
412
+ }
413
+
414
+ export interface FireworksBurstTwinkleCloud {
415
+ type: 'burstTwinkleCloud';
416
+ x: number;
417
+ y: number;
418
+ age: number;
419
+ maxLife: number;
420
+ startDelay: number;
421
+ duration: number;
422
+ twinkleLife: number;
423
+ radius: number;
424
+ brightness: number;
425
+ size: number;
426
+ spawnSpread: number;
427
+ twinkles: FireworksTwinkle[];
428
+ }
429
+
430
+ export interface FireworksRocketTailEmbersState {
431
+ enabled: boolean;
432
+ count: number;
433
+ brightness: number;
434
+ fade: number;
435
+ spreadX: number;
436
+ spreadY: number;
437
+ speed: number;
438
+ size: number;
439
+ }
440
+
441
+ export interface FireworksRocketCascadeState {
442
+ mode: RocketCascadeMode;
443
+ bursts: number;
444
+ childBursts: number;
445
+ childSpeedMin: number | null;
446
+ childSpeedMax: number | null;
447
+ childDurationMin: number | null;
448
+ childDurationMax: number | null;
449
+ childDirectionDeg: number;
450
+ childConeDeg: number;
451
+ delay: number;
452
+ spreadX: number;
453
+ spreadY: number;
454
+ burst: ResolvedBurstOptions;
455
+ child: FireworksRocketLaunchOptions | null;
456
+ }
457
+
458
+ export interface FireworksRocket {
459
+ x: number;
460
+ y: number;
461
+ prevX: number;
462
+ prevY: number;
463
+ startX: number;
464
+ startY: number;
465
+ targetX: number;
466
+ targetY: number;
467
+ totalDx: number;
468
+ totalDy: number;
469
+ totalDistanceSq: number;
470
+ hasExplicitTarget: boolean;
471
+ hasExplicitStart: boolean;
472
+ vx: number;
473
+ vy: number;
474
+ travelSpeed: number;
475
+ life: number;
476
+ maxLife: number;
477
+ color: string;
478
+ directionX: number;
479
+ directionY: number;
480
+ rotationAngle: number;
481
+ sparkLength: number;
482
+ sparkFinalLength: number;
483
+ thickness: number;
484
+ trailTimer: number;
485
+ tailEmberAccumulator: number;
486
+ tailEmbers: FireworksRocketTailEmbersState;
487
+ burst: ResolvedBurstOptions;
488
+ cascade: FireworksRocketCascadeState;
489
+ simple: boolean;
490
+ }
491
+
492
+ export interface FireworksBurstRequest {
493
+ x: number;
494
+ y: number;
495
+ options: ResolvedBurstOptions;
496
+ flashOptions: ResolvedBurstOptions | FireworksBurstOverrideOptions;
497
+ layer: 'burstForm' | 'burstSpark';
498
+ totalCount: number;
499
+ nextIndex: number;
500
+ spawnBurstCenterFlash: boolean;
501
+ spawnBurstTwinkleCloud: boolean;
502
+ flashSpawned: boolean;
503
+ twinkleCloudSpawned: boolean;
504
+ }
505
+
506
+ export interface FireworksPresetConfig extends FireworksEngineOptions { }
507
+
508
+ export declare class FireworksEngine {
509
+ constructor(options?: FireworksEngineOptions);
510
+
511
+ documentRef: Document | null | undefined;
512
+ windowRef: Window | null | undefined;
513
+ rootRef: Element | FireworksRootResolver | null | undefined;
514
+ prefersReducedMotionRef: (() => boolean) | null | undefined;
515
+ requestAnimationFrameRef: FireworksRequestAnimationFrame | null | undefined;
516
+ cancelAnimationFrameRef: FireworksCancelAnimationFrame | null | undefined;
517
+ setTimeoutRef: typeof globalThis.setTimeout | null | undefined;
518
+ clearTimeoutRef: typeof globalThis.clearTimeout | null | undefined;
519
+ nowRef: (() => number) | null | undefined;
520
+ maxDevicePixelRatio: number;
521
+ canvasZIndex: number | string;
522
+
523
+ canvas: HTMLCanvasElement | null;
524
+ ctx: CanvasRenderingContext2D | null;
525
+ width: number;
526
+ height: number;
527
+ dpr: number;
528
+
529
+ particles: FireworksParticle[];
530
+ formPool: Array<Partial<FireworksFormParticle>>;
531
+ sparkPool: Array<Partial<FireworksBurstSparkParticle>>;
532
+ emberPool: Array<Partial<FireworksRocketEmberParticle>>;
533
+ spriteCache: Map<string, HTMLCanvasElement>;
534
+ rockets: FireworksRocket[];
535
+ flashes: FireworksBurstFlash[];
536
+ twinkleClouds: FireworksBurstTwinkleCloud[];
537
+ burstQueue: FireworksBurstRequest[];
538
+ running: boolean;
539
+ rafId: number | null;
540
+ loopFrame: (now: number) => void;
541
+ lastTime: number;
542
+ timeoutIds: Set<FireworksTimeoutHandle>;
543
+ pendingStartConfig: FireworksEngineOptions | null;
544
+ hasResizeListener: boolean;
545
+ hasDomReadyListener: boolean;
546
+ defaultLifecycleHooks: {
547
+ onStart: FireworksLifecycleCallback | null;
548
+ onStop: FireworksLifecycleCallback | null;
549
+ onFinish: FireworksLifecycleCallback | null;
550
+ };
551
+ activeLifecycleHooks: {
552
+ onStart: FireworksLifecycleCallback | null;
553
+ onStop: FireworksLifecycleCallback | null;
554
+ onFinish: FireworksLifecycleCallback | null;
555
+ };
556
+ finishLifecycleNotified: boolean;
557
+
558
+ enableBurstQueueThrottling: boolean;
559
+ timeScale: number;
560
+ sizeScale: number;
561
+
562
+ rocket: ResolvedRocketConfig;
563
+ rocketTailEmbers: ResolvedRocketTailEmbersConfig;
564
+ burstForms: ResolvedBurstFormsConfig;
565
+ burstSparks: ResolvedBurstSparksConfig;
566
+ burstCenterFlash: ResolvedBurstCenterFlashConfig;
567
+ burstTwinkleCloud: ResolvedBurstTwinkleCloudConfig;
568
+ performance: ResolvedPerformanceConfig;
569
+ maxBurstParticlesPerFrame: number;
570
+ particlePressureThreshold: number;
571
+ fastRectRadiusThreshold: number;
572
+ renderPressureMode: boolean;
573
+
574
+ /** @internal */
575
+ resize(): void;
576
+
577
+ /**
578
+ * Launches one or more rockets using the configured launch behavior.
579
+ * @param options Launch overrides applied to every rocket in the batch.
580
+ */
581
+ launchRocket(options?: FireworksRocketLaunchOptions): void;
582
+ /**
583
+ * Alias of `launchRocketAt`.
584
+ * @param x Target X coordinate in canvas pixels.
585
+ * @param y Target Y coordinate in canvas pixels.
586
+ * @param options Optional launch overrides.
587
+ */
588
+ boom(x: number, y: number, options?: FireworksRocketLaunchOptions): boolean;
589
+ /**
590
+ * Triggers a burst at the given point without showing a rocket trail.
591
+ * @param x Target X coordinate in canvas pixels.
592
+ * @param y Target Y coordinate in canvas pixels.
593
+ * @param options Optional launch overrides.
594
+ */
595
+ burst(x: number, y: number, options?: FireworksRocketLaunchOptions): boolean;
596
+ /**
597
+ * Convenience wrapper around `burst` with confetti defaults.
598
+ * @param x Target X coordinate in canvas pixels.
599
+ * @param y Target Y coordinate in canvas pixels.
600
+ * @param options Optional confetti overrides.
601
+ */
602
+ confetti(x: number, y: number, options?: FireworksRocketLaunchOptions): boolean;
603
+ /**
604
+ * Updates the engine configuration in place.
605
+ * @param options Partial engine configuration to merge into the current runtime state.
606
+ */
607
+ updateOptions(options?: FireworksEngineOptions): void;
608
+ /**
609
+ * Launches a rocket toward the given target point.
610
+ * @param targetX Target X coordinate in canvas pixels.
611
+ * @param targetY Target Y coordinate in canvas pixels.
612
+ * @param options Optional launch overrides.
613
+ */
614
+ launchRocketAt(targetX: number, targetY: number, options?: FireworksRocketLaunchOptions): boolean;
615
+ /**
616
+ * Launches a named preset toward the given target point.
617
+ * Burst-mode presets fire as direct bursts; rocket-mode presets keep their rocket flight.
618
+ * @param name Preset name to resolve before launching.
619
+ * @param targetX Target X coordinate in canvas pixels.
620
+ * @param targetY Target Y coordinate in canvas pixels.
621
+ * @param options Optional launch overrides that merge with the preset.
622
+ */
623
+ launchPresetAt(
624
+ name: FireworksEnginePresetName | FireworksLaunchPresetName | string,
625
+ targetX: number,
626
+ targetY: number,
627
+ options?: FireworksRocketLaunchOptions,
628
+ ): boolean;
629
+ /**
630
+ * Launches a rocket from a specific start point toward a target point.
631
+ * @param startX Rocket start X coordinate in canvas pixels.
632
+ * @param startY Rocket start Y coordinate in canvas pixels.
633
+ * @param targetX Target X coordinate in canvas pixels.
634
+ * @param targetY Target Y coordinate in canvas pixels.
635
+ * @param options Optional launch overrides.
636
+ */
637
+ launchRocketFromTo(
638
+ startX: number,
639
+ startY: number,
640
+ targetX: number,
641
+ targetY: number,
642
+ options?: FireworksRocketLaunchOptions,
643
+ ): boolean;
644
+ /** @internal */
645
+ finishWhenDone(): void;
646
+
647
+ /**
648
+ * Starts the engine with the provided options.
649
+ * @param config Optional engine configuration used for this start call.
650
+ */
651
+ start(config?: FireworksEngineOptions): boolean;
652
+ /**
653
+ * Starts the engine using a named preset.
654
+ * @param name Preset name to resolve before starting the engine.
655
+ */
656
+ startPreset(name?: FireworksEnginePresetName | string): boolean;
657
+ /**
658
+ * Stops the engine. Optionally clears the canvas.
659
+ * @param clearCanvas When true, clears the current canvas before stopping.
660
+ */
661
+ stop(clearCanvas?: boolean): void;
662
+ /**
663
+ * Stops the engine and releases DOM/runtime resources.
664
+ */
665
+ destroy(): void;
666
+ }
667
+
668
+ export interface FireworksRocketExplicitTarget {
669
+ x: number;
670
+ y: number;
671
+ startX?: number;
672
+ startY?: number;
673
+ }
674
+
675
+ /**
676
+ * Creates a new fireworks engine instance.
677
+ * @param options Initial engine configuration.
678
+ * @returns A new fireworks engine instance.
679
+ */
680
+ export declare function createFireworksEngine(options?: FireworksEngineOptions): FireworksEngine;
681
+
682
+ /**
683
+ * Resolves a preset name to a fully expanded engine configuration.
684
+ * @param name Preset name to resolve.
685
+ * @returns The resolved preset configuration.
686
+ */
687
+ export declare function resolveFireworksEnginePreset(
688
+ name?: FireworksEnginePresetName | string,
689
+ ): FireworksPresetConfig;
690
+
691
+ export default FireworksEngine;