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.
65 lines (64 loc) • 2.6 kB
TypeScript
import { Canvas } from "./Canvas";
import { Particles } from "./Particles";
import { Retina } from "./Retina";
import { IOptions } from "../Options/Interfaces/IOptions";
import { FrameManager } from "./FrameManager";
import { RecursivePartial } from "../Types";
import { Options } from "../Options/Classes/Options";
import { Particle } from "./Particle";
import { Vector } from "./Particle/Vector";
import { IAttract, IBubble, IContainerInteractivity, IContainerPlugin, IMovePathGenerator, IRepulse, IShapeDrawer } from "./Interfaces";
export declare class Container {
readonly id: string;
started: boolean;
destroyed: boolean;
density: number;
duration: number;
pageHidden: boolean;
lastFrameTime?: number;
lifeTime: number;
fpsLimit: number;
interactivity: IContainerInteractivity;
bubble: IBubble;
repulse: IRepulse;
attract: IAttract;
zLayers: number;
readonly options: Options;
readonly sourceOptions: RecursivePartial<IOptions> | undefined;
actualOptions: Options;
readonly retina: Retina;
readonly canvas: Canvas;
readonly particles: Particles;
readonly drawer: FrameManager;
readonly drawers: Map<string, IShapeDrawer>;
readonly plugins: Map<string, IContainerPlugin>;
readonly pathGenerator: IMovePathGenerator;
private _options;
private _sourceOptions;
private paused;
private firstStart;
private currentTheme?;
private drawAnimationFrame?;
private readonly eventListeners;
private readonly intersectionObserver?;
constructor(id: string, sourceOptions?: RecursivePartial<IOptions>, ...presets: string[]);
play(force?: boolean): void;
pause(): void;
draw(force: boolean): void;
getAnimationStatus(): boolean;
setNoise(noiseOrGenerator?: IMovePathGenerator | ((particle: Particle) => Vector), init?: () => void, update?: () => void): void;
setPath(pathOrGenerator?: IMovePathGenerator | ((particle: Particle) => Vector), init?: () => void, update?: () => void): void;
destroy(): void;
exportImg(callback: BlobCallback): void;
exportImage(callback: BlobCallback, type?: string, quality?: number): void;
exportConfiguration(): string;
refresh(): Promise<void>;
reset(): Promise<void>;
stop(): void;
loadTheme(name?: string): Promise<void>;
start(): Promise<void>;
addClickHandler(callback: (evt: Event, particles?: Particle[]) => void): void;
updateActualOptions(): void;
private init;
private intersectionManager;
}