import { PipeTransform } from '@angular/core'; /** * `{{ collection | orderBy: expression : reverse : caseInsensitive }}` * * __collection__ [array or object] The collection or object to sort * * __expression__ [string] The key to determinate order * * __reverse__ (optional) [boolean] false Reverse sorting order * * __caseInsensitive__ (optional) [boolean] true Case insensitive compare for sorting * * ### __Example 1 __ : * * ```html * * import { Component } from '@angular/core'; * Component({ * selector: 'example', * template: ` *
* *
* ` * }) * * export class AppComponent { * array: any[] = [{ name: 'John'} , { name: 'Mary' }, { name: 'Adam' }]; * order: string = 'name'; * } * * ``` * * ### __Example 2 __ : * * ```html *
{{ { prop: { list: [3, 2, 1] } } | somaOrderBy: 'prop.list' | json }}
* ``` */ export declare class SomaOrderPipe 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; /** * Parse expression, split into items * @param expression * @returns */ static parseExpression(expression: string): string[]; /** * Get value by expression * * @param object * @param expression * @returns */ 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): any; /** * Sort array * * @param value * @param expression * @param reverse * @param isCaseInsensitive * @returns */ private sortArray(value, expression?, reverse?, isCaseInsensitive?); /** * Transform Object * * @param value * @param expression * @param reverse * @param isCaseInsensitive * @returns */ private transformObject(value, expression?, reverse?, isCaseInsensitive?); }