tsparticles
Version:
Easily create highly customizable particle, confetti and fireworks 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.
51 lines (50 loc) • 1.85 kB
TypeScript
import type { Container, IContainerPlugin, ICoordinates, IDelta, IDimension, Particle } from "../../Core";
import type { IPolygonMaskOptions } from "./Types";
import type { ISvgPath } from "./Interfaces/ISvgPath";
import { OutModeDirection } from "../../Enums";
import { PolygonMask } from "./Options/Classes/PolygonMask";
import type { RecursivePartial } from "../../Types";
/**
* Polygon Mask manager
* @category Polygon Mask Plugin
*/
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;
/**
* Deprecate SVGPathElement.getPathSegAtLength removed in:
* Chrome for desktop release 62
* Chrome for Android release 62
* Android WebView release 62
* Opera release 49
* Opera for Android release 49
*/
private downloadSvgPath;
private drawPoints;
private randomPoint;
private getRandomPoint;
private getRandomPointByLength;
private getEquidistantPointByIndex;
private getPointByIndex;
private createPath2D;
private initRawData;
}