import { OperatorFunction } from '../../interfaces'; import { IterableX } from '../../iterable/iterablex'; import { FilterIterable } from '../filter'; import { bindCallback } from '../../internal/bindcallback'; export function filter( predicate: (value: T, index: number) => value is S, thisArg?: any ): OperatorFunction; export function filter( predicate: (value: T, index: number) => boolean, thisArg?: any ): OperatorFunction; export function filter( predicate: (value: TSource, index: number) => boolean, thisArg?: any ): OperatorFunction { return function filterOperatorFunction(source: Iterable): IterableX { return new FilterIterable(source, bindCallback(predicate, thisArg, 2)); }; }