import { DiffResult } from "./types"; /** * * @memberof eg.ListDiffer * @static * @function * @param - Previous List 이전 목록 * @param - List to Update 업데이트 할 목록 * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. * @example * import { diff } from "@egjs/list-differ"; * // script => eg.ListDiffer.diff * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); * // List before update * // [1, 2, 3, 4, 5] * console.log(result.prevList); * // Updated list * // [4, 3, 6, 2, 1] * console.log(result.list); * // Index array of values added to `list` * // [0, 1, 5] * console.log(result.added); * // Index array of values removed in `prevList` * // [5] * console.log(result.removed); * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] * console.log(result.changed); * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) * // [[4, 3], [3, 4], [2, 6]] * console.log(result.pureChanged); * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) * // [[4, 1], [4, 2], [4, 3]] * console.log(result.ordered); * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] * console.log(result.maintained); */ export declare function diff(prevList: T[], list: T[], findKeyCallback?: (e: T, i: number, arr: T[]) => any): DiffResult;