UNPKG

2.93 kBTypeScriptView Raw
1import type { IBounds, ICircleBouncer, ICoordinates, IDimension, IParticle } from "../Core/Interfaces";
2import { DivMode } from "../Enums";
3import type { ICharacterShape } from "../Options/Interfaces/Particles/Shape/ICharacterShape";
4import type { SingleOrMultiple } from "../Types";
5import { DivEvent } from "../Options/Classes/Interactivity/Events/DivEvent";
6import type { IModeDiv } from "../Options/Interfaces/Interactivity/Modes/IModeDiv";
7import { OutModeDirection } from "../Enums";
8declare global {
9 interface Window {
10 customRequestAnimationFrame: (callback: FrameRequestCallback) => number;
11 mozRequestAnimationFrame: (callback: FrameRequestCallback) => number;
12 oRequestAnimationFrame: (callback: FrameRequestCallback) => number;
13 msRequestAnimationFrame: (callback: FrameRequestCallback) => number;
14 webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number;
15 customCancelRequestAnimationFrame: (handle: number) => void;
16 webkitCancelRequestAnimationFrame: (handle: number) => void;
17 mozCancelRequestAnimationFrame: (handle: number) => void;
18 oCancelRequestAnimationFrame: (handle: number) => void;
19 msCancelRequestAnimationFrame: (handle: number) => void;
20 }
21}
22export declare function isSsr(): boolean;
23export declare function animate(): (callback: FrameRequestCallback) => number;
24export declare function cancelAnimation(): (handle: number) => void;
25export declare function isInArray<T>(value: T, array: SingleOrMultiple<T>): boolean;
26export declare function loadFont(character: ICharacterShape): Promise<void>;
27export declare function arrayRandomIndex<T>(array: T[]): number;
28export declare function itemFromArray<T>(array: T[], index?: number, useIndex?: boolean): T;
29export declare function isPointInside(point: ICoordinates, size: IDimension, radius?: number, direction?: OutModeDirection): boolean;
30export declare function areBoundsInside(bounds: IBounds, size: IDimension, direction?: OutModeDirection): boolean;
31export declare function calculateBounds(point: ICoordinates, radius: number): IBounds;
32export declare function deepExtend(destination: unknown, ...sources: unknown[]): unknown;
33export declare function isDivModeEnabled(mode: DivMode, divs: SingleOrMultiple<DivEvent>): boolean;
34export declare function divModeExecute(mode: DivMode, divs: SingleOrMultiple<DivEvent>, callback: (id: string, div: DivEvent) => void): void;
35export declare function singleDivModeExecute(div: DivEvent, callback: (selector: string, div: DivEvent) => void): void;
36export declare function divMode<T extends IModeDiv>(divs?: SingleOrMultiple<T>, element?: HTMLElement): T | undefined;
37export declare function circleBounceDataFromParticle(p: IParticle): ICircleBouncer;
38export declare function circleBounce(p1: ICircleBouncer, p2: ICircleBouncer): void;
39export declare function rectBounce(particle: IParticle, divBounds: IBounds): void;