Merge pull request #5814 from use-strict/angularjs-filter-service

angularjs - better granularity for filter service parameter types
This commit is contained in:
Masahiro Wakame
2015-09-20 14:06:27 +09:00
2 changed files with 33 additions and 1 deletions

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;
}
/**