/** * Like Object.assign, but iterates over prototype chain, too. * Replacement for dojo mixin. * * Note: in most cases, the standard `Object.assign` function should be preferred when copying object properties. * This function is designed for circumstances where the prototype chain is being manipulated, for example * when using `apprt-core/delegate` or `dlang.delegate`. * * @param target Object to which the properties are assigned. * @param sources Objects from where the properties are read. * @returns the target * @example * ```typescript * import assignWithPrototype from "apprt-core/assignWithPrototype"; * let a = {x: 1, z: 1 }; * let b = {x: 2, y: 1 }; * let a1 = assignWithPrototype(a,b); * a1 === a // -> true * a1 is {x:2, y: 1, z: 1} * ``` */ declare function assignWithPrototype(target: T, ...sources: Record[]): Record; /** * Like {@link assignWithPrototype}, but allows customized assignment via `assigner` function. * * The `assigner` will be invoked for each property that should be assigned to the target. * The function has the signature `(target, name, value) => void`, and can act like a filter during assignment. * @param target Object to which the properties are assigned. * @param assigner The custom assignment function. * @param sources Objects from where the properties are read. * @returns the target * @example * ```typescript * const a: any = { x: 1, z: 1 }; * const b = { x: 2, _calc() {} }; * const c = { y: 2, _hidden: "test" }; * const a1 = assignWithPrototypeCustomized( * a, * (target, name, value) => { * if (name.startsWith("_")) { * return; * } * target[name] = value; * }, * b, * c * ); * a1 === a; // -> true * // a1 is {x:2, y: 2, z: 1} * ``` */ declare function assignWithPrototypeCustomized(target: T, assigner: (target: T, name: string, value: any) => void, ...sources: Record[]): Record; /** * A recursive assignment of of properties from sources into target. * The recursive means that object properties will be merged and not replaced. * * @param target Object to which the properties are assigned. * @param sources Objects from where the properties are read. * @returns the target * @example * ```ts * import assignRecursiveWithPrototype from "apprt-core/assignRecursiveWithPrototype"; * const a: any = { x: 1, z: { a: 1 } }; * const b = { x: 2, z: { b: 1 } }; * const a1 = assignRecursiveWithPrototype(a, b); * a1 === a; // -> true * // a1 is {x:2, z: { a: 1, b: 1 }} * ``` */ declare function assignRecursiveWithPrototype(target: T, ...sources: Record[]): Record; export { assignRecursiveWithPrototype, assignWithPrototype, assignWithPrototypeCustomized, assignWithPrototype as default };