/** * Easing function for smooth animations (Material Design standard) * @param t */ declare const easeOutCubic: (t: number) => number; /** Standard Material Design animation durations */ declare const ANIMATION_DURATIONS: { SHORT: number; MEDIUM: number; LONG: number; EXTRA_LONG: number; }; /** Common easing functions */ declare const EASING_FUNCTIONS: { linear: (t: number) => number; easeIn: (t: number) => number; easeOut: (t: number) => number; easeInOut: (t: number) => number; materialStandard: (t: number) => number; }; /** Canvas drawing utilities */ /** * Creates a rounded rectangle path * @param ctx * @param x * @param y * @param width * @param height * @param radius */ declare const createRoundedRectPath: (ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number | [ number, number, number, number ]) => void; /** * Draws a filled rounded rectangle * @param ctx * @param x * @param y * @param width * @param height * @param radius * @param fillStyle */ declare const fillRoundedRect: (ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number | [ number, number, number, number ], fillStyle?: string | CanvasGradient | CanvasPattern) => void; /** * Creates a clipping region with rounded corners * @param ctx * @param x * @param y * @param width * @param height * @param radius */ declare const clipRoundedRect: (ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number | [ number, number, number, number ]) => (() => void); /** * Draws a rounded rectangle with different left and right radii * @param ctx * @param x * @param y * @param width * @param height * @param leftRadius * @param rightRadius * @param fillStyle */ declare const fillRoundedRectLR: (ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, leftRadius: number, rightRadius: number, fillStyle?: string | CanvasGradient | CanvasPattern) => void; /** * Clears a canvas with optional background color * @param ctx * @param width * @param height * @param backgroundColor */ declare const clearCanvas: (ctx: CanvasRenderingContext2D, width: number, height: number, backgroundColor?: string) => void; /** Canvas resize utilities */ /** * Observes an element for the two things that change a canvas backing store: its width, and the devicePixelRatio. * @param element * @param canvas * @param onResize */ declare const observeCanvasResize: (element: HTMLElement, canvas: HTMLCanvasElement | null | undefined, onResize: () => void) => (() => void); /** Common canvas context interface used by components */ interface CanvasContext { canvas: HTMLCanvasElement; ctx: CanvasRenderingContext2D; width: number; height: number; pixelRatio: number; } /** * Creates and initializes a canvas context with proper pixel ratio handling * @param canvas * @param width * @param height */ declare const createCanvasContext: (canvas: HTMLCanvasElement, width: number, height: number) => CanvasContext; /** * Updates canvas dimensions while preserving pixel ratio * @param context * @param width * @param height */ declare const updateCanvasDimensions: (context: CanvasContext, width: number, height: number) => void; /** * Tries to initialize a canvas with retry mechanism * @param initFn * @param onSuccess * @param signal */ declare const initializeCanvasWithRetry: (initFn: () => boolean, onSuccess?: () => void, signal?: AbortSignal) => boolean; /** * Creates a theme observer that triggers a callback on theme changes * @param _color * @param callback */ declare const createCanvasThemeObserver: (_color: string, callback: () => void) => (() => void); /** Standard animation frame manager for components */ declare class AnimationFrameManager { private animationId; /** * Starts an animation loop * @param callback */ start(callback: (timestamp: number) => void): void; /** Stops the animation loop */ stop(): void; /** Whether animation is currently running */ get isRunning(): boolean; } /** Manages multiple cleanup functions for components */ declare class CleanupManager { private cleanupFunctions; /** Adds a cleanup function */ add(cleanup: (() => void) | null | undefined): void; /** Runs all cleanup functions and clears the list */ cleanup(): void; } /** * Creates a standard canvas element with common styles * @param className * @param additionalStyles */ declare const createStyledCanvas: (className: string, additionalStyles?: Partial) => HTMLCanvasElement; export type { CanvasContext }; export { ANIMATION_DURATIONS, AnimationFrameManager, CleanupManager, EASING_FUNCTIONS, clearCanvas, clipRoundedRect, createCanvasContext, createCanvasThemeObserver, createRoundedRectPath, createStyledCanvas, easeOutCubic, fillRoundedRect, fillRoundedRectLR, initializeCanvasWithRetry, observeCanvasResize, updateCanvasDimensions };