/** * Copyright 2015 CANAL+ Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ type MergeRecursively = S extends [ infer First, ...infer Rest ] ? MergeRecursively, Rest extends object[] ? Rest : never> : T; type MergeObjects = { [K in OptionalPropertyOfTNotInS | OptionalProperty]?: K extends keyof S ? S[K] : K extends keyof T ? T[K] : never; } & { [K in Exclude | OptionalProperty>]: K extends keyof S ? S[K] : K extends keyof T ? T[K] : never; }; type OptionalProperty = Exclude<{ [K in keyof T]: T extends Record ? never : K; }[keyof T], undefined>; type OptionalPropertyOfTNotInS = Exclude<{ [K in keyof T]: T extends Record ? never : K; }[keyof T], undefined | { [K in keyof S]: S extends Record ? K : never; }[keyof S]>; /** * Very simple implementation of Object.assign. * Should be sufficient for all use-cases here. * * Does not support symbols, but this should not be a problem as browsers * supporting symbols generally support Object.assign; * * @param {Object} target * @param {Array.} ...sources * @returns {Object} */ declare function objectAssign(target: T, ...sources: U): MergeRecursively; declare const _default: typeof objectAssign; export default _default;