UNPKG

1.41 kBTypeScriptView Raw
1import { Entity } from '../entity';
2import { Link, SimpleTypeFields } from '../selectable';
3import { ComplexTypePropertyFields } from '../selectable/complex-type-property-fields';
4import { Order } from './order';
5import { OrderLink } from './order-link';
6/**
7 * A union of all types that can be used for ordering.
8 * @typeparam EntityT - Type of the entity to be ordered
9 */
10export declare type Orderable<EntityT extends Entity> = Order<EntityT> | OrderLink<EntityT, Entity>;
11/**
12 * A union of all types that can be used as input for ordering.
13 * @typeparam EntityT - Type of the entity to be ordered
14 */
15export declare type OrderableInput<EntityT extends Entity> = SimpleTypeFields<EntityT> | Link<EntityT, Entity> | ComplexTypePropertyFields<EntityT, any>;
16/**
17 * Create new Order by `orderBy._fieldName` in ascending order.
18 * @typeparam EntityT - Type of the entity to be ordered
19 * @param orderBy - Field or link to be ordered by
20 * @returns New order
21 */
22export declare function asc<EntityT extends Entity>(orderBy: OrderableInput<EntityT>): Order<EntityT>;
23/**
24 * Create new Order by `orderBy._fieldName` in descending order.
25 * @typeparam EntityT - Type of the entity to be ordered
26 * @param orderBy - Field or link to be ordered by
27 * @returns New order
28 */
29export declare function desc<EntityT extends Entity>(orderBy: OrderableInput<EntityT>): Order<EntityT>;
30//# sourceMappingURL=orderable.d.ts.map
\No newline at end of file