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.
49 lines (48 loc) • 1.99 kB
TypeScript
import type { Container } from "../../Core/Container";
import type { ICoordinates } from "../../Core/Interfaces/ICoordinates";
import { Particle } from "../../Core/Particle";
import type { IDimension } from "../../Core/Interfaces/IDimension";
import type { ISvgPath } from "./Interfaces/ISvgPath";
import type { IContainerPlugin } from "../../Core/Interfaces/IContainerPlugin";
import type { IOptions } from "../../Options/Interfaces/IOptions";
import type { RecursivePartial } from "../../Types";
import type { IPolygonMask } from "./Options/Interfaces/IPolygonMask";
import { PolygonMask } from "./Options/Classes/PolygonMask";
import type { IDelta } from "../../Core/Interfaces/IDelta";
import { OutModeDirection } from "../../Enums";
declare type IPolygonMaskOptions = IOptions & {
polygon: IPolygonMask;
};
export declare class PolygonMaskInstance implements IContainerPlugin {
private readonly container;
redrawTimeout?: number;
raw?: ICoordinates[];
paths?: ISvgPath[];
dimension: IDimension;
offset?: ICoordinates;
readonly path2DSupported: boolean;
readonly options: PolygonMask;
private polygonMaskMoveRadius;
constructor(container: Container);
initAsync(options?: RecursivePartial<IPolygonMaskOptions>): Promise<void>;
resize(): void;
stop(): void;
particlesInitialization(): boolean;
particlePosition(position?: ICoordinates): ICoordinates | undefined;
particleBounce(particle: Particle, delta: IDelta, direction: OutModeDirection): boolean;
clickPositionValid(position: ICoordinates): boolean;
draw(context: CanvasRenderingContext2D): void;
private polygonBounce;
private checkInsidePolygon;
private parseSvgPath;
private downloadSvgPath;
private drawPoints;
private randomPoint;
private getRandomPoint;
private getRandomPointByLength;
private getEquidistantPointByIndex;
private getPointByIndex;
private createPath2D;
private initRawData;
}
export {};