UNPKG

2.09 kBTypeScriptView Raw
1import type { IOptions } from "./Options/Interfaces/IOptions";
2import type { Container } from "./Core/Container";
3import type { ShapeDrawerAfterEffectFunction, ShapeDrawerDestroyFunction, ShapeDrawerDrawFunction, ShapeDrawerInitFunction, RecursivePartial, SingleOrMultiple } from "./Types";
4import type { Particle } from "./Core/Particle";
5import type { IInteractor, IMovePathGenerator, IParticleUpdater, IPlugin, IShapeDrawer } from "./Core/Interfaces";
6export declare class Main {
7 #private;
8 constructor();
9 init(): void;
10 loadFromArray(tagId: string, options: RecursivePartial<IOptions>[], index?: number): Promise<Container | undefined>;
11 load(tagId: string | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>>): Promise<Container | undefined>;
12 set(id: string | HTMLElement, element: HTMLElement | RecursivePartial<IOptions>, options?: RecursivePartial<IOptions>): Promise<Container | undefined>;
13 loadJSON(tagId: string | SingleOrMultiple<string>, pathConfigJson?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
14 setJSON(id: string | HTMLElement, element: HTMLElement | SingleOrMultiple<string>, pathConfigJson?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
15 setOnClickHandler(callback: (e: Event, particles?: Particle[]) => void): void;
16 dom(): Container[];
17 domItem(index: number): Container | undefined;
18 addShape(shape: string, drawer: IShapeDrawer | ShapeDrawerDrawFunction, init?: ShapeDrawerInitFunction, afterEffect?: ShapeDrawerAfterEffectFunction, destroy?: ShapeDrawerDestroyFunction): void;
19 addPreset(preset: string, options: RecursivePartial<IOptions>, override?: boolean): void;
20 addPlugin(plugin: IPlugin): void;
21 addPathGenerator(name: string, generator: IMovePathGenerator): void;
22 addInteractor(name: string, interactorInitializer: (container: Container) => IInteractor): void;
23 addParticleUpdater(name: string, updaterInitializer: (container: Container) => IParticleUpdater): void;
24}