angularjs - better granularity for filter service parameter types

This commit is contained in:
Ciuca, Alexandru
2015-09-14 17:12:44 +03:00
parent 9ce3cd4ded
commit d0a264d5ff
2 changed files with 33 additions and 1 deletions
+17 -1
View File
@@ -782,7 +782,23 @@ declare module angular {
*
* @param name Name of the filter function to retrieve
*/
(name: string): Function;
(name: string): IFilterFunc;
}
interface IFilterFunc {
<T>(array: T[], expression: string | IFilterPatternObject | IFilterPredicateFunc<T>, comparator?: IFilterComparatorFunc<T>|boolean): T[];
}
interface IFilterPatternObject {
[name: string]: string;
}
interface IFilterPredicateFunc<T> {
(value: T, index: number, array: T[]): T[];
}
interface IFilterComparatorFunc<T> {
(actual: T, expected: T): boolean;
}
/**