UNPKG

@tsparticles/effect-trail

Version:
36 lines (35 loc) 1.18 kB
import { type Container, type ICoordinates, type IEffectDrawer, type IParticleCanvasBoundsData, type IShapeDrawData, type IShapeValues, type Particle, type RangeValue } from "@tsparticles/engine"; export interface TrailStep { break: boolean; color: string | CanvasGradient | CanvasPattern; position: ICoordinates; transformData?: { a: number; b: number; c: number; d: number; }; } export interface ITrailData extends IShapeValues { fade?: boolean; length?: RangeValue; maxWidth?: RangeValue; minWidth?: RangeValue; transform?: boolean; } export type TrailParticle = Particle & { effectData?: ITrailData; trail?: TrailStep[]; trailFade?: boolean; trailLength?: number; trailMaxWidth?: number; trailMinWidth?: number; trailTransform?: boolean; }; export declare class TrailDrawer implements IEffectDrawer<TrailParticle> { #private; constructor(container: Container); drawAfter(data: IShapeDrawData<TrailParticle>): void; isInsideCanvas(data: IParticleCanvasBoundsData<TrailParticle>): boolean; particleInit(container: Container, particle: TrailParticle): void; }