ngx-order-pipe
Version:
Angular order pipe, order collection by a field
83 lines (82 loc) • 2.1 kB
TypeScript
import { PipeTransform } from "@angular/core";
import * as i0 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, returns sorted array
*
* @param array
* @param expression
* @param reverse
* @param isCaseInsensitive
* @param comparator
* @returns {Type[]}
*/
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;
static ɵfac: i0.ɵɵFactoryDeclaration<OrderPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<OrderPipe, "orderBy", false>;
}