import { BiFunction, EqualsPredicate } from '@acoustic-content-sdk/utils'; import { UnaryFunction } from 'rxjs'; import { ItemWithLinkedDocId } from '../draft/draft.utils'; /** * Reducer function that adds an item to a record */ export declare type AddRecordReducer = BiFunction, T, Record>; /** * Reducer function that adds an item to a record */ export declare type RemoveRecordReducer = BiFunction, string, Record>; /** * Reducer function that updates an item */ export declare type ItemReducer = BiFunction; /** * Creates a reducer that adds an item to a record * * @param aKey - function to extract the key from the item * @param aPredicate - predicate to check if two items are equal * * @returns the reducer */ export declare function updateRecord(aKey: UnaryFunction, aPredicate?: EqualsPredicate): AddRecordReducer; /** * Creates a reducer that removes a key from a record * * @returns the reducer */ export declare function removeRecord(): RemoveRecordReducer; export declare function updateSingleItem(aPredicate?: EqualsPredicate): ItemReducer; export interface ItemWithId { id?: string; } export interface ItemWithRevision extends ItemWithId { rev?: string; } export declare function equalsByRevision(aLeft: ItemWithRevision, aRight: ItemWithRevision): boolean; /** * Extract the delivery ID of the draft * * @param item - the item * @returns the delivery version of the ID */ export declare const keyById: UnaryFunction; export declare const updateItemsWithRevision: (aState: Record, aItem: T) => Record;