/** * Represents a parsed Filter expression. */ interface Filter { /** * Test, if a filter matches against the given object (case-insensitive). * @param obj target data object * @returns true if the filter matches */ match(obj: Record): boolean; /** * Test, if a filter matches against the given object (case-sensitive). * @param obj target data object * @returns true if the filter matches */ matchCase(obj: Record): boolean; } /** * Creates a comparator from the sortSpec. * It uses the dojo.data.util.sorter.createSortFunction. * @param {Array|ct.Hash} sortSpec sort specification. * If array is used then the objects should be formatted as follows: * { * attribute: "attributeName-string" || attribute, * descending: true|false; // Default is false. * } * * If ct.Hash is used then the keys are interpreted as attribute names * and the values must be booleans used to indicate ascending (false) or descending (true) * new ct.Hash().set("attributename",true).set("attributename2",false); * * It is also allowed to use {"attributename" : true|false}, but here only one attribute is allowed, * otherwise it is not predictable! * * @param {Object} [comparatorMap] map with attribute names to comparator functions. * { attributename : function(a,b){...} } * @returns {Function} comparator function, directly usable in Array.sort method. */ declare function arrayComparator(sortSpec: any[] | ct.Hash, comparatorMap?: Object): Function; declare function arraySort(input: any, comparatorOrSortSpec: any, comparatorMap: any): any; declare function arrayFilter(...args: any[]): Filter; declare function arrayTestFunction(filterOrTestObj: any, ignoreCase: any): any; /** * Searches the items in the array based on a filter, filter string or sample object. * @param {Array} input the array to sort. * @param {String |ct.Filter|String|Object} filterOrTestObj the filter to apply on items. * @param {Boolean} ignoreCase shall the case of attribute names be ignored (only valid with filters). */ declare function arraySearch(input: any[], filterOrTestObj: string | ct.Filter | string | Object, ignoreCase: boolean): any[]; declare function arraySearchFirst(input: any, filterOrTestObj: any, ignoreCase: any, startIndex: any): any; declare function arrayFirstIndexOf(input: any, filterOrTestObj: any, ignoreCase: any, startIndex: any): any; declare function arrayBinarySearch(input: any, item: any, comparator: any): number; declare function arrayAdd(array: any, item: any, filterOrTestObj: any, ignoreCase: any): any; declare function arrayRemove(array: any, item: any, filterOrTestObj: any, ignoreCase: any): any; declare namespace exports { export { arrayComparator }; export { arraySort }; export { arrayFilter }; export { arrayTestFunction }; export { arraySearch }; export { arraySearchFirst }; export { arrayFirstIndexOf }; export { arrayBinarySearch }; export { arrayAdd }; export { arrayRemove }; } export { arrayAdd, arrayBinarySearch, arrayComparator, arrayFilter, arrayFirstIndexOf, arrayRemove, arraySearch, arraySearchFirst, arraySort, arrayTestFunction, exports as default };