import { LoggerService } from '@acoustic-content-sdk/api'; import { BiFunction, Generator } from '@acoustic-content-sdk/utils'; import { UnaryFunction } from 'rxjs'; /** * Facade that offers the modification functions for a json object. * The original JSON object will not be modified and the modified * object will only contain the minimum number of modifications. */ export interface Updater { /** * Replaces the value pointed to by the accessor with a new value. * All values across the parent path will be cloned (shallow) if * they do not have a clone, yet. * * Pass `undefined` as the new value to delete the value. * * Returns the modified version of the top level object. */ set: BiFunction; /** * Removes the value pointed to by the accessor. * All values across the parent path will be cloned (shallow) if * they do not have a clone, yet. * * Returns the modified version of the top level object. */ del: UnaryFunction; /** * Inserts a new value into an array pointed to by the accessor. * All values across the parent path will be cloned (shallow) if * they do not have a clone, yet. * * Pass `undefined` as the new value to delete the value. * * Returns the modified version of the top level object. */ add: BiFunction; /** * Returns the top level, modified object */ get: Generator; } /** * Constructs a function that updates one or more values in a json object. * * @param aValue - the JSON structure to update * * @returns updater functions */ export declare function createUpdater(aValue: T, aLogSvc?: LoggerService): Updater;