UNPKG

ngx-order-pipe

Version:

Angular order pipe, order collection by a field

80 lines (79 loc) 1.91 kB
import { PipeTransform } from '@angular/core'; export declare class OrderPipe implements PipeTransform { /** * Check if a value is a string * * @param value */ static isString(value: any): boolean; /** * Sorts values ignoring the case * * @param a * @param b */ static caseInsensitiveSort(a: any, b: any): any; /** * Default compare method * * @param a * @param b */ static defaultCompare(a: any, b: any): 0 | 1 | -1; /** * Parse expression, split into items * @param expression * @returns {string[]} */ static parseExpression(expression: string): string[]; /** * Get value by expression * * @param object * @param expression * @returns {any} */ static getValue(object: any, expression: string[]): any; /** * Set value by expression * * @param object * @param value * @param expression */ static setValue(object: any, value: any, expression: string[]): void; transform(value: any | any[], expression?: any, reverse?: boolean, isCaseInsensitive?: boolean, comparator?: Function): any; /** * Sort array * * @param value * @param expression * @param reverse * @param isCaseInsensitive * @param comparator * @returns {any[]} */ private sortArray; /** * Transform Object * * @param value * @param expression * @param reverse * @param isCaseInsensitive * @param comparator * @returns {any[]} */ private transformObject; /** * Apply multiple expressions * * @param value * @param {any[]} expressions * @param {boolean} reverse * @param {boolean} isCaseInsensitive * @param {Function} comparator * @returns {any} */ private multiExpressionTransform; }