ts-flex-query
Version:
Flexible and type-safe data queries
16 lines (15 loc) • 716 B
TypeScript
import { Expression } from '../../core/expression';
import { PipeOperator } from '../../core/pipe-operator';
import { ObjectValueSelector } from '../../helpers/object-value-selector';
export declare class SortOperator implements PipeOperator {
readonly specs: SortSpecification[];
constructor(specs: SortSpecification[]);
instantiate(input: Expression): Expression<any>;
}
interface SortSpecification<in T = any> {
value: ObjectValueSelector<T>;
isAscending: boolean;
}
type SortElement<T> = ObjectValueSelector<NonNullable<T>> | [ObjectValueSelector<NonNullable<T>>, 'asc' | 'desc'];
export declare function orderBy<T>(...elements: NoInfer<SortElement<T>[]>): PipeOperator<T[], T[]>;
export {};