export default syncArrays; /** * Provides a function that synchronizes two arrays, arr1 and * arr2. arr2 is a subset of arr1, it includes the elements of arr1 that passes * the filter. When elements are added to/removed from arr1, arr2 is updated to * include the elements of arr1 that pass the filter. When the order of * elements in arr2 changes, arr1 is reordered to have the same order as arr2. * * This can for example be used to synchronize the array of layers in the map * with the array of selected layers, where layers may be added to/removed from * the map, and the order of selected layers may change. * * let dereg = ngeoSyncArrays(map.getLayers().getArray(), selectedLayers, * true, scope, function(layer) { * // exclude the layer at index 0 in the map * return map.getLayers().indexOf(layer) !== 0; * }); * * This will return a function that can be called to cancel synchronization. * * @param {T[]} arr1 Array 1. * @param {T[]} arr2 Array 2. * @param {boolean} reverse `true` if arr2 is in reverse order, `false` * otherwise. * @param {angular.IScope} scope Angular scope. Used to watch arr1 and arr2 * using $watchCollection. * @param {function(T):boolean} filter Filter function. * @returns {function()} Function to call to stop synchronization * @template T * @hidden */ declare function syncArrays(arr1: T[], arr2: T[], reverse: boolean, scope: angular.IScope, filter: (arg0: T) => boolean): () => any;