import type { SetItemT, Transaction } from './types'; import type Bookshelf from '@metabrainz/bookshelf'; import type { ORM } from '..'; /** * Get the intersection of two arrays of objects using a custom comparison * function. The two arrays represent two versions of a single set - one array * is the set before a particular change and the other is the same set after * that change. * * @param {Array} oldSet - The old array to compare * @param {Array} newSet - The new array to compare * @param {Function} comparisonFunc - Function to compare items from the two * arrays * * @returns {Array} - An array representing the intersection of the two * arrays */ export declare function getUnchangedItems(oldSet: Array, newSet: Array, comparisonFunc: (obj: Item, other: Item) => boolean): Array; /** * Get any items in the new version of the set that aren't present in the old * version using a custom comparison function. The two arrays represent two * versions of a single set - one array is the set before a particular change * and the other is the same set after that change. * * @param {Array} oldSet - The old array to compare * @param {Array} newSet - The new array to compare * @param {Function} comparisonFunc - Function to compare items from the two * arrays * * @returns {Array} - An array representing the difference of the two * arrays */ export declare function getAddedItems(oldSet: Array, newSet: Array, comparisonFunc: (obj: Item, other: Item) => boolean): Array; /** * Get any items in the old version of the set that aren't present in the new * version using a custom comparison function. The two arrays represent two * versions of a single set - one array is the set before a particular change * and the other is the same set after that change. * * @param {Array} oldSet - The old array to compare * @param {Array} newSet - The new array to compare * @param {Function} comparisonFunc - Function to compare items from the two * arrays * * @returns {Array} - An array representing the difference of the two * arrays */ export declare function getRemovedItems(oldSet: Array, newSet: Array, comparisonFunc: (obj: Item, other: Item) => boolean): Array; export declare const removeItemsFromSet: typeof getRemovedItems; export declare function createNewSetWithItems(orm: ORM, transacting: Transaction, SetModel: Bookshelf.ModelSubclass, unchangedItems: Array, addedItems: Array, itemsAttribute: string, idAttribute?: string): Promise; export declare function createNewRelationshipAttributeSetWithItems(orm: ORM, transacting: Transaction, SetModel: Bookshelf.ModelSubclass, unchangedItems: Array, addedItems: Array, itemsAttribute: string, idAttribute?: string): Promise;