/** * Generate schema for passed object. * * @param {Array|object} object An object to analyze. * @returns {Array|object} */ export declare function duckSchema(object: unknown[] | object): unknown; /** * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`. * Creates temporary dummy function to call it as constructor. * Described in ticket: https://github.com/handsontable/handsontable/pull/516. * * @param {object} Child The child class. * @param {object} Parent The parent class. * @returns {object} */ export declare function inherit(Child: Function, Parent: Function): object; /** * Perform shallow extend of a target object with extension's own properties. * * @param {object} target An object that will receive the new properties. * @param {object} extension An object containing additional properties to merge into the target. * @param {string[]} [writableKeys] An array of keys that are writable to target object. * @returns {object} */ export declare function extend(target: Record, extension: Record, writableKeys?: string[]): object; /** * Perform deep extend of a target object with extension's own properties. * * @param {object} target An object that will receive the new properties. * @param {object} extension An object containing additional properties to merge into the target. */ export declare function deepExtend(target: Record, extension: Record): void; /** * Perform deep clone of an object. * Clones plain objects, arrays, and primitives recursively, preserving undefined-valued properties. * Non-plain objects (Date, RegExp, Map, Set, class instances) are returned by reference. * * @param {T} obj An object that will be cloned. * @returns {T} */ export declare function deepClone(obj: T): T; /** * Shallow clone object. * * @param {object} object An object to clone. * @returns {object} */ export declare function clone(object: object): object; /** * Extend the Base object (usually prototype) of the functionality the `mixins` objects. * * @param {object} Base Base object which will be extended. * @param {object} mixins The object of the functionality will be "copied". * @returns {object} */ export declare function mixin(Base: Function, ...mixins: object[]): object; /** * Checks if two objects or arrays are (deep) equal. * * @param {object|Array} object1 The first object to compare. * @param {object|Array} object2 The second object to compare. * @returns {boolean} */ export declare function isObjectEqual(object1: object | unknown[], object2: object | unknown[]): boolean; /** * Determines whether given object is a plain Object. * Note: String and Array are not plain Objects. * * @param {*} object An object to check. * @returns {boolean} */ export declare function isObject(object: unknown): boolean; /** * Type-guard variant of {@link isObject} that narrows the value to `Record`. * Use this instead of `isObject` when you need TypeScript to narrow the type after the check. * {@link isObject} intentionally returns `boolean` to preserve downstream compatibility. * * @param {*} value The value to check. * @returns {boolean} */ export declare function isPlainObject(value: unknown): value is Record; /** * @param {object} object The object on which to define the property. * @param {string} property The name of the property to be defined or modified. * @param {*} value The value associated with the property. * @param {object} options The descriptor for the property being defined or modified. */ export declare function defineGetter(object: object, property: string, value: unknown, options: PropertyDescriptor): void; /** * A specialized version of `.forEach` for objects. * * @param {object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {object} Returns `object`. */ export declare function objectEach(object: Record, iteratee: (value: V, key: string, object: Record) => unknown): Record; export declare function objectEach(object: object, iteratee: (value: unknown, key: string, object: object) => unknown): object; /** * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`). * * @param {object} object Object which value will be exported. * @param {string} name Object property name. * @returns {T | undefined} */ export declare function getProperty(object: Record, name: string): T | undefined; /** * Set a property value on the provided object. Works on nested object prop names as well (e.g. `first.name`). * * @param {object} object Object to work on. * @param {string} name Prop name. * @param {*} value Value to be assigned at the provided property. */ export declare function setProperty(object: Record, name: string, value: unknown): void; /** * Return object length (recursively). * * @param {*} object Object for which we want get length. * @returns {number} */ export declare function deepObjectSize(object: unknown): number; /** * Create object with property where its value change will be observed. * * @param {*} [defaultValue=undefined] Default value. * @param {string} [propertyToListen='value'] Property to listen. * @returns {object} */ export interface ObjectPropListener extends Record { isTouched(): boolean; value: unknown; } /** * */ export declare function createObjectPropListener(defaultValue?: unknown, propertyToListen?: string): ObjectPropListener; /** * Check if at specified `key` there is any value for `object`. * * @param {object} object Object to search value at specific key. * @param {string} key String key to check. * @returns {boolean} */ export declare function hasOwnProperty(object: object, key: string | number): boolean; /** * Assign default values to an object. * * @param {object} target The object to assign defaults to. * @param {object} defaults The default values to assign. * @returns {object} The object with defaults assigned. */ export declare function assignObjectDefaults(target: Record, defaults: Record): Record; /** * Deeply merges two objects. * For every key: * - If both source and target values are plain objects, they are merged recursively. * - Otherwise, the source value replaces the target value. * * @param {object} target The target object. * @param {object} source The source object. * @returns {object} The merged object. */ export declare function deepMerge(target?: Record, source?: Record): Record; /** * Checks if the value is a key/value object. * * @param {*} value The value to check. * @returns {boolean} */ export declare function isKeyValueObject(value: unknown): boolean;