1 | import type { Container } from "./Container";
|
2 | import type { Particle } from "./Particle";
|
3 | import type { IContainerPlugin, ICoordinates, IDelta, IDimension, IParticle, IRgb } from "./Interfaces";
|
4 | export declare class Canvas {
|
5 | private readonly container;
|
6 | element?: HTMLCanvasElement;
|
7 | readonly size: IDimension;
|
8 | resizeFactor?: IDimension;
|
9 | private context;
|
10 | private generatedCanvas;
|
11 | private coverColor?;
|
12 | private trailFillColor?;
|
13 | private originalStyle?;
|
14 | constructor(container: Container);
|
15 | init(): void;
|
16 | loadCanvas(canvas: HTMLCanvasElement, generatedCanvas?: boolean): void;
|
17 | destroy(): void;
|
18 | paint(): void;
|
19 | clear(): void;
|
20 | windowResize(): void;
|
21 | resize(): void;
|
22 | drawConnectLine(p1: IParticle, p2: IParticle): void;
|
23 | drawGrabLine(particle: IParticle, lineColor: IRgb, opacity: number, mousePos: ICoordinates): void;
|
24 | drawParticle(particle: Particle, delta: IDelta): void;
|
25 | drawPlugin(plugin: IContainerPlugin, delta: IDelta): void;
|
26 | drawParticlePlugin(plugin: IContainerPlugin, particle: Particle, delta: IDelta): void;
|
27 | initBackground(): void;
|
28 | draw<T>(cb: (context: CanvasRenderingContext2D) => T): T | undefined;
|
29 | private initCover;
|
30 | private initTrail;
|
31 | private getPluginParticleColors;
|
32 | private initStyle;
|
33 | private paintBase;
|
34 | private lineStyle;
|
35 | }
|