import type { EntityBase } from '../entity-base' ; import { FilterLink } from '../filter' ; import { Orderable } from '../order' ; import type { Filterable } from '../filter' ; import { DeSerializers } from '../de-serializers' ; import { Link } from './link' ; param filters returns internal export function toFilterableList < EntityT extends EntityBase , DeSerializersT extends DeSerializers , LinkedEntityT extends EntityBase > ( filters ) { return filters . map ( f => ( f instanceof OneToManyLink ? f . _filters : f ) ) ; } internal export class OneToManyLink < EntityT extends EntityBase , DeSerializersT extends DeSerializers , LinkedEntityT extends EntityBase > extends Link < EntityT , DeSerializersT , LinkedEntityT > { _filters : FilterLink < EntityT , DeSerializersT , LinkedEntityT > ; _orderBy : Orderable < LinkedEntityT > [ ] = [ ] ; _top : number ; _skip : number ; clone ( ) { const clonedLink = super . clone ( ) ; clonedLink . _filters = this . _filters ; clonedLink . _orderBy = this . _orderBy ; clonedLink . _top = this . _top ; clonedLink . _skip = this . _skip ; return clonedLink ; } param filters returns filter ( ... expressions ) { const link = this . clone ( ) ; link . _filters = new FilterLink ( this , toFilterableList ( expressions ) ) ; return link ; } returns orderBy ( ... orderBy ) { const link = this . clone ( ) ; link . _orderBy = orderBy ; return link ; } param top returns top ( top ) { const link = this . clone ( ) ; link . _top = top ; return link ; } param skip returns skip ( skip ) { const link = this . clone ( ) ; link . _skip = skip ; return link ; } }