konfeti - v0.6.0
    Preparing search index...

    Type Alias KonfetiHandle

    KonfetiHandle: PromiseLike<void> & {
        getParticleCount(): number;
        getSeed(): number;
        isFinished(): boolean;
        isPaused(): boolean;
        pause(): void;
        resume(): void;
        stop(): void;
    }

    Burst Control Handle. Returned by fire() (on Konfeti or any instance). Awaitable: resolves when every particle of the burst is gone (or it is stopped).

    Type Declaration

    • getParticleCount: function
      • Return Live Particle Count.

        Returns number

        Live Particle Count

    • getSeed: function
      • Return the Random Seed. Fire the same options with this seed to get the same burst again: the same particles with the same colors, sizes and launch values, and exactly the same motion on instances with fixedTimestep. For a combined handle from fire([...]), the seed of the first burst (give each entry its own seed to replay a list).

        Returns number

        Seed

        const seed = Konfeti.fire().getSeed();
        Konfeti.fire({ seed }); // the same burst again
    • isFinished: function
      • Return Finished State.

        Returns boolean

        Finished State

    • isPaused: function
      • Return Paused State.

        Returns boolean

        Paused State

    • pause: function
      • Freeze Burst in Place. Particles stay visible but stop moving and aging.

        Returns void

    • resume: function
      • Resume Paused Burst.

        Returns void

    • stop: function
      • Remove Burst Immediately. Clears its particles and resolves the handle.

        Returns void

    const burst = Konfeti.fire();
    burst.pause();
    setTimeout(() => burst.resume(), 500);
    await burst; // finished