import { DeSerializers } from '../de-serializers' ; import { EntityBase } from '../entity-base' ; import { ComplexTypePropertyFields , SimpleTypeFields , Link } from '../selectable' ; import { Order } from './order' ; import { OrderLink } from './order-link' ; typeparam internal export type Orderable < EntityT extends EntityBase > = Order < EntityT > | OrderLink < EntityT , EntityBase > ; typeparam internal export type OrderableInput < EntityT extends EntityBase , DeSerializersT extends DeSerializers > = SimpleTypeFields < EntityT > | Link < EntityT , DeSerializersT , EntityBase > | ComplexTypePropertyFields < EntityT > ; typeparam param orderBy returns internal export function asc < EntityT extends EntityBase , DeSerializersT extends DeSerializers > ( orderBy ) { if ( orderBy instanceof Link ) { return new Order ( orderBy . _fieldName ) ; } return new Order ( orderBy . fieldPath ( ) ) ; } typeparam param orderBy returns internal export function desc < EntityT extends EntityBase , DeSerializersT extends DeSerializers > ( orderBy ) { if ( orderBy instanceof Link ) { return new Order ( orderBy . _fieldName ) ; } return new Order ( orderBy . fieldPath ( ) , 'desc' ) ; }