/** * Creates a transformer that only runs if a condition is met * @param predicate * @param transformer */ declare const when: (predicate: (obj: T, context: C) => boolean, transformer: (obj: T, context: C) => T) => (obj: T, context: C) => T; /** * Joins class names, filtering out falsy values * @param classes */ declare const classNames: (...classes: (string | undefined | null | false)[]) => string; /** Result interface for background color lookup */ interface BackgroundResult { /** The computed background color value */ color: string; /** The element from which the color was obtained */ element: HTMLElement | null; } /** * Gets the computed background color of an element or its ancestors. * @param element */ declare const getInheritedBackground: (element: HTMLElement, maxDepth?: number) => BackgroundResult; /** * Converts a color to RGBA format with specified opacity * @param color * @param opacity */ declare const colorToRGBA: (color: string, opacity: number) => string; /** * Checks if a value is a plain object * @param value */ declare const isObject: (value: unknown) => value is Record; /** * Accesses a nested property of an object using a string path * @param obj * @param path */ declare const byString: (obj: T, path: string) => R | undefined; type Cancellable = F & { cancel(): void; }; /** * Creates a throttled function that only invokes the provided function at most once per every specified wait milliseconds. * @param fn * @param wait * @param options * @param options.leading * @param options.trailing */ declare const throttle: unknown>(fn: T, wait: number, options?: { leading?: boolean; trailing?: boolean; }) => Cancellable<(...args: Parameters) => void>; /** * Creates a debounced function that delays invoking the provided function until after the specified wait milliseconds have elapsed since the last time it was invoked. * @param fn * @param wait * @param options * @param options.leading * @param options.maxWait */ declare const debounce: unknown>(fn: T, wait: number, options?: { leading?: boolean; maxWait?: number; }) => Cancellable<(...args: Parameters) => void>; /** * Creates a function that is restricted to invoking the provided function once. * @param fn */ declare const once: unknown>(fn: T) => ((...args: Parameters) => ReturnType); type ThemeChangeCallback = () => void; declare const onThemeChange: (callback: ThemeChangeCallback) => (() => void); /** * Gets a theme color from CSS variables, with optional alpha/opacity support. * @param varName */ declare function getThemeColor(varName: string, options?: { alpha?: number; fallback?: string; element?: Element | null; onThemeChange?: ThemeChangeCallback; }): string; /** Attributes whose value is a URL, and so must be checked before assignment. */ declare const URL_ATTRIBUTES: Set; /** Whether a URL is safe to assign to a navigable attribute. */ declare const isSafeUrl: (url: string) => boolean; /** Returns the URL if its scheme is allowed, otherwise an empty string. */ declare const safeUrl: (url: string) => string; export { URL_ATTRIBUTES, byString, classNames, colorToRGBA, debounce, getInheritedBackground, getThemeColor, isObject, isSafeUrl, once, safeUrl, throttle, when }; export { PASSIVE_EVENTS, TOUCH_CONFIG, hasTouchSupport, normalizeEvent } from "./mobile.js";