UNPKG

tsparticles

Version:

Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.

85 lines (84 loc) 3.32 kB
import { Container } from "./Container"; import { IParticles } from "../Options/Interfaces/Particles/IParticles"; import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions"; import { AlterType, ShapeType } from "../Enums"; import { RecursivePartial } from "../Types"; import { Stroke } from "../Options/Classes/Particles/Stroke"; import { Vector } from "./Particle/Vector"; import { IBubbleParticleData, ICoordinates, ICoordinates3d, IDelta, IDistance, IHsl, IParticle, IParticleGradientAnimation, IParticleHslAnimation, IParticleLife, IParticleNumericValueAnimation, IParticleSpin, IParticleTiltValueAnimation, IParticleValueAnimation, IRgb, IShapeValues } from "./Interfaces"; import { Vector3d } from "./Particle/Vector3d"; export declare class Particle implements IParticle { readonly id: number; readonly container: Container; readonly group?: string | undefined; destroyed: boolean; lastPathTime: number; misplaced: boolean; rollAngle: number; rollSpeed: number; spawning: boolean; splitCount: number; unbreakable: boolean; wobbleAngle: number; wobbleDistance: number; wobbleSpeed: number; readonly pathDelay: number; readonly sides: number; readonly strokeWidth: number; readonly options: ParticlesOptions; readonly life: IParticleLife; readonly maxDistance: Partial<IDistance>; alterValue?: number; alterType?: AlterType; attractDistance?: number; backColor?: IHsl; close: boolean; fill: boolean; randomIndexData?: number; linksDistance?: number; linksWidth?: number; moveDrift?: number; moveSpeed?: number; maxSpeed?: number; orbitRadius?: number; orbitRotation?: number; sizeAnimationSpeed?: number; readonly direction: number; readonly stroke: Stroke; readonly position: Vector3d; readonly offset: Vector; readonly shadowColor: IRgb | undefined; readonly color?: IParticleHslAnimation; readonly gradient?: IParticleGradientAnimation; readonly opacity: IParticleNumericValueAnimation; readonly rotate: IParticleValueAnimation<number>; readonly size: IParticleNumericValueAnimation; readonly tilt: IParticleTiltValueAnimation; readonly strokeColor?: IParticleHslAnimation; readonly orbitColor?: IHsl; readonly velocity: Vector; readonly shape: ShapeType | string; readonly spin?: IParticleSpin; readonly initialPosition: Vector; readonly initialVelocity: Vector; readonly shapeData?: IShapeValues; readonly bubble: IBubbleParticleData; readonly zIndexFactor: number; constructor(id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string | undefined); isVisible(): boolean; isInsideCanvas(): boolean; draw(delta: IDelta): void; getPosition(): ICoordinates3d; getRadius(): number; getMass(): number; getFillColor(): IHsl | undefined; getStrokeColor(): IHsl | undefined; destroy(override?: boolean): void; reset(): void; private split; private calcPosition; private checkOverlap; private calculateVelocity; private loadShapeData; private loadLife; }