/** * CSS RGB color string type * @example 'rgb(255, 0, 0)' or 'rgb(255,0,0)' */ export type CSSRgbString = `rgb(${number}, ${number}, ${number})` | `rgb(${number},${number},${number})`; export type MotionOptions = { /** * The width of the motion element. * @default 600 */ width?: number; /** * The height of the motion element. * @default 600 */ height?: number; /** * Device pixel ratio multiplier; can be less than 1. */ ratio?: number; /** * Color mode. Upon what background color will the element be displayed. * - dark: optimize for dark background. (clean and luminous glow. may be invisible on light backgrounds.) * - light: optimize for light background. (high saturation glow. not elegant on dark backgrounds.) * @default light * @note It's not possible to make a style that works well on both light and dark backgrounds. * @note If you do not know the background color, start with light. */ mode?: 'dark' | 'light'; /** * Color list. * @default ['rgb(57, 182, 255)', 'rgb(189, 69, 251)', 'rgb(255, 87, 51)', 'rgb(255, 214, 0)'] * @note The color list must be specified with 4 colors in an array, formatted as rgb color strings. */ colors?: [CSSRgbString, CSSRgbString, CSSRgbString, CSSRgbString]; /** * The width of the border. * @default 8 */ borderWidth?: number; /** * The width of the glow effect. * @default 200 * */ glowWidth?: number; /** * The border radius. * @default 8 */ borderRadius?: number; /** * Custom class names for wrapper and canvas elements. */ classNames?: string; /** * Custom styles for wrapper and canvas elements. */ styles?: Partial; /** * Skip the greeting message in console. * @deprecated Don't be a rude person 🤞. */ skipGreeting?: boolean; }; export declare class Motion { readonly element: HTMLElement; private canvas; private options; private running; private disposed; private startTime; private lastTime; private rafId; private glr; private observer?; constructor(options?: MotionOptions); start(): void; pause(): void; dispose(): void; resize(width: number, height: number, ratio?: number): void; /** * Automatically resizes the canvas to match the dimensions of the given element. * @note using ResizeObserver */ autoResize(sourceElement: HTMLElement): void; fadeIn(): Promise; fadeOut(): Promise; private checkGLError; private getGLErrorName; private setupGL; private render; private greet; } //# sourceMappingURL=Motion.d.ts.map