import { FeatureFilter } from './feature-filter' ; export class IdFilter extends FeatureFilter { private _accaptableIds : number [ ] ; constructor ( featureName ? , acceptableIds ? ) { super ( featureName ) ; this . _accaptableIds = acceptableIds === undefined ? [ ] : acceptableIds ; } public itemConfirmsToFilter ( id , item ) { return this . _accaptableIds . indexOf ( id ) !== - 1 ; } public get accaptableIds ( ) : number [ ] { return this . _accaptableIds ; } public set accaptableIds ( ids ) { this . _accaptableIds = ids . sort ( ) ; } public extendAccaptableIds ( newIds ) { newIds . forEach ( ( id ) => { if ( this . _accaptableIds . indexOf ( id ) === - 1 ) { this . _accaptableIds . push ( id ) ; } } ) ; this . _accaptableIds . sort ( ) ; } }