import { type TemplateResult } from 'lit';
import type IgcFileInputComponent from '../file-input/file-input.js';
export declare const asPercent: (part: number, whole: number) => number;
export declare const clamp: (number: number, min: number, max: number) => number;
export declare function numberOfDecimals(number: number): number;
export declare function roundPrecise(number: number, magnitude?: number): number;
export declare function numberInRangeInclusive(value: number, min: number, max: number): boolean;
/**
 * Returns whether an element has a Left-to-Right directionality.
 */
export declare function isLTR(element: HTMLElement): boolean;
/**
 * Builds a string from format specifiers and replacement parameters.
 * Will coerce non-string parameters to their string representations.
 *
 * @example
 * ```typescript
 * formatString('{0} says "{1}".', 'John', 'Hello'); // 'John says "Hello".'
 * formatString('{1} is greater than {0}', 0, 1); // '1 is greater than 0'
 * ```
 */
export declare function formatString(template: string, ...params: unknown[]): string;
/**
 * Parse the passed `value` as a number or return the `fallback` if it can't be done.
 *
 * @example
 * ```typescript
 * asNumber('5'); // 5
 * asNumber('3.14'); // 3.14
 * asNumber('five'); // 0
 * asNUmber('five', 5); // 5
 * ```
 */
export declare function asNumber(value: unknown, fallback?: number): number;
/**
 * Returns the value wrapped between the min and max bounds.
 *
 * If the value is greater than max, returns the min and vice-versa.
 * If the value is between the bounds, it is returned unchanged.
 *
 * @example
 * ```typescript
 * wrap(1, 4, 2); // 2
 * wrap(1, 4, 5); // 1
 * wrap(1, 4, -1); // 4
 * ```
 */
export declare function wrap(min: number, max: number, value: number): number;
export declare function isDefined<T = unknown>(value: T): value is T & ({} | null);
export type IterNodesOptions<T = Node> = {
    show?: keyof typeof NodeFilter;
    filter?: (node: T) => boolean;
};
export declare function iterNodes<T extends Node>(root: Node, options?: IterNodesOptions<T>): Generator<T>;
export declare function getRoot(element: Element, options?: GetRootNodeOptions): Document | ShadowRoot;
export declare function getElementByIdFromRoot(root: HTMLElement, id: string): HTMLElement | null;
export declare function isElement(node: unknown): node is Element;
export declare function isDocument(node: unknown): node is Document;
/**
 * Finds the first element in the event's composed path that matches the provided predicate, which can be either a string selector or a function.
 *
 * @param predicate - A string representing a CSS selector or a function that takes an Element and returns a boolean indicating a match.
 * @param event - The event whose composed path will be searched for the matching element.
 * @returns The first Element that matches the predicate, or undefined if no match is found.
 *
 * @example
 * ```typescript
 * // Using a string selector
 * const button = getElementFromPath('button', event);
 * ```
 * ```typescript
 * // Using a predicate function
 * const customElement = getElementFromPath((el) => el.tagName === 'MY-ELEMENT', event);
 * ```
 */
export declare function getElementFromPath<K extends keyof HTMLElementTagNameMap>(predicate: K, event: Event): HTMLElementTagNameMap[K] | undefined;
export declare function getElementFromPath<T extends Element>(predicate: string | ((element: Element) => boolean), event: Event): T | undefined;
export declare function stopPropagation(event: Event): void;
export declare function first<T>(arr: T[]): T;
export declare function last<T>(arr: T[]): T;
export declare function modulo(n: number, d: number): number;
/**
 * Splits an array into chunks of a specified size and returns a generator that yields each chunk.
 *
 * @example
 * ```typescript
 * [...chunk([1, 2, 3, 4, 5], 2)]; // [[1, 2], [3, 4], [5]]
 * ```
 *
 * @throws If the `size` parameter is not a safe integer greater than or equal to 1.
 */
export declare function chunk<T>(arr: T[], size: number): Generator<T[]>;
export declare function splitToWords(text: string): string[];
export declare function toKebabCase(text: string): string;
export declare function isFunction(value: unknown): value is CallableFunction;
export declare function isString(value: unknown): value is string;
export declare function isObject(value: unknown): value is object;
export declare function isPlainObject(value: unknown): value is Record<PropertyKey, unknown>;
export declare function isEventListenerObject(x: unknown): x is EventListenerObject;
export declare function addWeakEventListener(element: Element, event: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
type EventTypeOf<T extends keyof HTMLElementEventMap | keyof WindowEventMap> = (HTMLElementEventMap & WindowEventMap)[T];
/**
 * Safely adds an event listener to an HTMLElement, automatically handling
 * server-side rendering environments by doing nothing if `isServer` is true.
 * This function also correctly binds the `handler`'s `this` context to the `target` element
 * and ensures proper event type inference.
 */
export declare function addSafeEventListener<E extends keyof HTMLElementEventMap | keyof WindowEventMap>(target: HTMLElement, eventName: E, handler: (event: EventTypeOf<E>) => unknown, options?: boolean | AddEventListenerOptions): void;
/**
 * Returns whether a given collection is empty.
 */
export declare function isEmpty<T, U extends object>(x: ArrayLike<T> | Set<T> | Map<U, T>): boolean;
/**
 * Ensures the given value is wrapped in an array. If the value is already an array, it is returned as-is. If the value is undefined, an empty array is returned.
 *
 * @example
 * ```typescript
 * asArray(5); // [5]
 * asArray([1, 2, 3]); // [1, 2, 3]
 * asArray(undefined); // []
 * ```
 */
export declare function asArray<T>(value?: T | T[]): T[];
/**
 * Splits an array into two based on a predicate function, returning a tuple of [truthy, falsy] arrays.
 *
 * @example
 * ```typescript
 * const [evens, odds] = partition([1, 2, 3, 4], x => x % 2 === 0);
 * console.log(evens); // [2, 4]
 * console.log(odds); // [1, 3]
 * ```
 */
export declare function partition<T>(array: T[], isTruthy: (value: T) => boolean): [truthy: T[], falsy: T[]];
/** Returns the center x/y coordinate of a given element. */
export declare function getCenterPoint(element: Element): {
    x: number;
    y: number;
};
/** Returns the scale factor of a given element based on its bounding client rect and offset dimensions. */
export declare function getScaleFactor(element: HTMLElement): {
    x: number;
    y: number;
};
export declare function roundByDPR(value: number): number;
export declare function scrollIntoView(element?: HTMLElement | null, config?: ScrollIntoViewOptions): void;
export declare function isRegExp(value: unknown): value is RegExp;
export declare function equal<T>(a: unknown, b: T, visited?: WeakSet<WeakKey>): boolean;
/**
 *  Escapes any potential regex syntax characters in a string, and returns a new string
 *  that can be safely used as a literal pattern for the `RegExp()` constructor.
 *
 *  @remarks
 *  Substitute with `RegExp.escape` once it has enough support:
 *
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape#browser_compatibility
 */
export declare function escapeRegex(value: string): string;
/** Required utility type for specific props */
export type RequiredProps<T, K extends keyof T> = T & {
    [P in K]-?: T[P];
};
export declare function setStyles(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
/**
 * Merges the properties of `source` into `target` performing a recursive deep merge over POJOs and arrays.
 *
 * @remarks
 * This function mutates the `target` object.
 * If that is not the desired outcome, see {@link toMerged} for another approach.
 */
export declare function merge<T extends Record<PropertyKey, any>, S extends Record<PropertyKey, any>>(target: T, source: S): T & S;
/**
 * Just like {@link merge} but it does not mutate the `target` object instead
 * mutating a structured clone of it.
 */
export declare function toMerged<T extends Record<PropertyKey, any>, S extends Record<PropertyKey, any>>(target: T, source: S): T & S;
/**
 * Similar to Lit's `ifDefined` directive except one can check `assertion`
 * and bind a different `value` through this wrapper.
 */
export declare function bindIf<T>(assertion: unknown, value: T): NonNullable<T>;
export declare function nanoid(size?: number): string;
export declare function hasFiles(input: HTMLInputElement | IgcFileInputComponent): boolean;
/** @internal */
export declare function trimmedHtml(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult;
/**
 * Returns whether the given element is currently an open popover or not.
 * This is useful to determine if the popover is open without relying on the `open` property, which may not be in sync with the actual popover state if the opening/closing animations are still running.
 * Note: This function only works for elements that use the `:popover-open` pseudo-class to indicate
 */
export declare function isPopoverOpen(element?: Element): boolean;
/**
 * Returns the nearest visible ancestor of a given node, traversing through shadow DOM boundaries if necessary. If no visible ancestor is found, returns null.
 */
export declare function getVisibleAncestor(startNode: Node): HTMLElement | null;
export {};
