@porscheinformatik/clr-addons
Version:
Addon components for Clarity Angular
23 lines (22 loc) • 1.04 kB
TypeScript
/**
* Helper function to check if a primitive filter value is valid. Complex objects will always be valid.
* This function is a fallback for primitive values, if a custom filter does not set the isActive method correctly.
*
* @param value the value to check
*/
export declare function isValidFilterValue(value: unknown): boolean;
/**
* Comparator for distinctUntilChanged on the filter values stream.
* Emits only when:
* - Array length changes, or
* - A primitive value at some index changes, or
* - Any element is non-primitive (object / function / array) -> always treated as changed.
*
* Rationale:
* Objects/arrays are assumed to have unstable identity/content; any occurrence triggers a new emission.
*
* @param prev Previous emitted array of active filter values.
* @param curr Current emitted array of active filter values.
* @returns true if both arrays should be considered equal (no new emission), false otherwise.
*/
export declare function areFiltersDistinct(prev: unknown[], curr: unknown[]): boolean;