Create Worker Instance.
Target Canvas (null creates a fullscreen overlay)
Worker Instance Options
Worker Connector (defaults to the bundled worker script)
Destroy Instance. Stops the worker, removes listeners and the overlay canvas.
Start a Continuous Emitter.
Streams particles at rate per second until stop(). What it follows is measured on the main thread and
sent to the worker.
Worker-Safe Emitter Options
Emitter Handle
Fire Burst (or Several Bursts at Once).
Worker-Safe Burst Options, or an Array of Them
Awaitable Burst Handle (rejects if the worker reports invalid options)
Return Canvas Element.
Canvas Element
Return Live Particle Count.
Particle Count (worker mode: updated a few times per second)
Return the Adaptive Quality Level.
Always 0 without the adaptiveQuality option.
Level: 0 full quality, 1 CSS resolution, 2 no shadows / shine / trails, 3 fewer particles
(worker mode: updated a few times per second)
Return Counters. The worker-mode replacement for hooks (which cannot run in a worker): live, spawned and died particles and finished bursts. Works the same in main-thread fallback mode.
Counters (worker mode: updated a few times per second)
Return Destroyed State.
Destroyed State
Check Whether pause() Is in Effect.
Paused Flag
StaticisCheck Browser Support for Worker Rendering.
Target Canvas
Supported Flag
Return Worker Mode State.
true when drawing happens in a worker, false for the main-thread fallback
Fire on Every Click.
Bursts start at the click position unless the options set their own origin.
Element (or window) to Listen On
Optionaloptions: WorkerFireInput | ((event: MouseEvent) => WorkerFireInput)
Worker-Safe Burst Options, or a Function Building Them from the Click Event
Trigger Event and Burst Callback
Unsubscribe Function
Pause Everything. Freezes every running burst on its current frame; bursts fired while paused wait as well.
Stop All Bursts and Clear Canvas.
Resume After pause().
Konfeti Instance that Simulates and Draws in a Web Worker. The canvas is handed to the worker as an
OffscreenCanvas, so confetti stays smooth while the page is busy. WithoutOffscreenCanvassupport it transparently falls back to the main thread (isWorker()isfalse). Created bycreateWorker().