UNPKG

ng-hub-ui-table

Version:

Highly customizable Angular table and list components with pagination, sorting and filtering support.

82 lines (81 loc) 3.8 kB
import { Signal } from '@angular/core'; /** * Creates a debounced version of a given signal. The returned signal updates its value * only after the specified debounce time has elapsed since the last change in the source signal. * * @template T - The type of the signal's value. * @param sourceSignal - The source signal to debounce. * @param debounceDelay - Either a number (ms) or a signal<number> indicating debounce delay. * @returns A new signal that emits debounced values from the source signal. */ export declare function debouncedSignal<T>(sourceSignal: Signal<T>, debounceDelay?: number | Signal<number>): Signal<T>; /** * Determines if two objects or two values are equivalent. * * Two objects or values are considered equivalent if at least one of the following is true: * * * Both objects or values pass `===` comparison. * * Both objects or values are of the same type and all of their properties are equal by * comparing them with `equals`. * * @param o1 Object or value to compare. * @param o2 Object or value to compare. * @returns true if arguments are equal. */ export declare function equals(o1: any, o2: any): boolean; /** * Checks if a value is defined and not null. * * @param {any} value - is of type `any`, which means it can accept any data type. * * @returns a boolean value. */ export declare function isDefined(value: any): boolean; /** * Checks if the given item is an object and not an array. * * @param {any} item - is of type "any", which means it can be any data type. * * @returns a boolean value. */ export declare function isObject(item: any): boolean; /** * Recursively merges two objects, combining their properties into a new object. * * @param {any} target - is the object that you want to merge the `source` object into. * @param {any} source - is an object that contains the properties and values that you want to merge into the `target` object. * * @returns the merged object, which is the result of merging the `target` and `source` objects. */ export declare function mergeDeep(target: any, source: any): any; /** * Generates a unique ID of a specified length by randomly selecting characters from a predefined set of characters. * * @param {number} length - is the desired length of the generated unique ID. * * @returns a unique id string. */ export declare function generateUniqueId(length: number): string; /** * Replaces placeholders in a string with corresponding values from a given object. * * @param {string} expr - a string that represents the expression to be interpolated. It may contain * placeholders that will be replaced with values from the `params` object. * @param {any} [params] - an optional object that contains the values to be interpolated into the `expr` * string. It is used to replace placeholders in the `expr` string with actual values. * * @returns returns the interpolated string. If `params` is not provided, it returns the original * `expr` string. If `params` is provided, it replaces placeholders in the `expr` string with corresponding values from `params` * and returns the interpolated string. */ export declare function interpolateString(expr?: string, params?: any, templateMatcher?: RegExp): string; /** * Retrieves the value of a nested property from an object using dot notation. * * @param {any} target - the object from which you want to retrieve a value. * @param {string} key - a string that represents the property or nested properties of the `target` object that you want to * retrieve the value from. The `key` can be a single property name or a dot-separated string representing a nested property path. * * @returns the value of the specified key in the target object. */ export declare function getValue(target: any, key: string): any;