/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /** * Inserts an object into a nested Object hierarchy. If an entry already exists, it will be overwritten. * * @param in_object - The object in which we search for the entry * @param in_path - The path within the hierarchy * @param in_newEntry - The new entry to insert * * @returns Has there already been an entry? * @alias insertInNestedObjects * @package * @hidden */ declare function insertInNestedObjects(in_object: object, ...args: [in_path: string, in_newEntry: any]): boolean; /** * Checks, whether an entry exists under the given path in a nested Object hierarchy * * @param in_object - The object in which we search for the entry * @param in_path - The path within the hierarchy * * @returns Did an entry exist under the given path in a hierarchy * @alias existsInNestedObjects * @package * @hidden */ declare function existsInNestedObjects(in_object: object, ...args: [in_path: string]): boolean; /** * Returns an entry from a nested hierarchy of objects * * @param in_object - The object in which we search for the entry * @param _path - The path within the hierarchy * * @returns The entry at the given path in a hierarchy, or undefined if none * @alias getInNestedObjects * @package * @hidden */ declare function getInNestedObjects(in_object: any, _path?: any): any | undefined; /** * Returns an entry from a nested hierarchy of objects. If it does not yet exist, the given default value is inserted. * * @param in_object - The object in which we search for the entry * @param in_path - The path within the hierarchy * @param in_default - The default value to insert into the object, if no entry is found * * @returns The entry which exists under the given path in a hierarchy otherwise undefined. * @alias getInNestedObjects * @package * @hidden */ declare function getOrInsertDefaultInNestedObjects(this: any, in_object: T, ...args: [in_path?: string, in_default?: any]): T; /** * Deletes an entry from a nested hierarchy of objects. * It will also delete all no longer needed levels of the hierarchy above the deleted entry * * @param in_object - The object in which we search for the entry * @param in_path - The path within the hierarchy * @alias deleteInNestedObjects * @package * @hidden */ declare function deleteInNestedObjects(in_object: object, ...args: [in_path: string]): void; /** * Traverses a hierarchy of nested objects and invokes the callback function for each entry * * * @param in_object - The nested object hierarchy to traverse * @param in_levels - The number of levels to descend in the hierarchy * @param in_invokeForHigherLevels - If this is set to true, the callback will also be invoked in * cases where there were not in_levels many levels present in the * hierarchy. * @param in_callback - Callback that will be invoked with the keys of all nested levels as * parameters, followed by the value at that level. If not all levels * were existent in the hierarchy, it will be passed undefined parameters * to fill up to in_levels keys. * @alias traverseNestedObjects * @package * @hidden */ declare function traverseNestedObjects(this: any, in_object: object, in_levels: number, in_invokeForHigherLevels: boolean, in_callback: { apply: (arg0: any, arg1: any[]) => void; }): void; export { insertInNestedObjects, existsInNestedObjects, getInNestedObjects, getOrInsertDefaultInNestedObjects, deleteInNestedObjects, traverseNestedObjects, }; //# sourceMappingURL=nestedObjectHelpers.d.ts.map